Currently I am using Fedora 32 Mate spin. I usually go between using MATE Terminal and Terminator. But recently when I go to use either and have multiple tabs open if I back out of an ssh session and later want to reconnect I hit the up arrow and I get the last command from another terminal tab. I feel like its something stupid that I’ve overlooked in my .bashrc.
I have the following in my .bashrc
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
But I also have the following:
# After each command, append to the history file and reread it
#export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}"history -a;
_bash_history_sync() {
builtin history -a #1
# HISTFILESIZE=$HISTSIZE #2
builtin history -c #3
builtin history -r #4
}
history() { #5
_bash_history_sync
builtin history "$@"
}
PROMPT_COMMAND=_bash_history_sync