Re: Mate terminal randomly doesn't save history on some tabs
Reply #1 –
I would add the following line to ~/.bashrc:
PROMPT_COMMAND="history -a"
If you are working with several terminals at the same time and want to have a single history, the following line at the end of ~/.bashrc will help:
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
To ensure that nothing disappears from the history, the limit of (500) must either be increased or cancelled completely.
RTFM:
https://www.baeldung.com/linux/bash-histsize-vs-histfilesize
#
# clean bash history with no limit
#
HISTCONTROL="ignorespace"
HISTIGNORE="checkupdates*:history*:sudo*"
HISTTIMEFORMAT='%d/%m/%y %T '
HISTFILESIZE=
HISTSIZE=
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"