3 ms·
>...or in which of my 50+ open and not committed shells... I suffered this frustration too, but adding this to my .bashrc solved it: #write to history fil
by UI_at_80x24 4y ago
>...or in which of my 50+ open and not committed shells...
I suffered this frustration too, but adding this to my .bashrc solved it:
#write to history file at each shell prompt
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
Every time a command is executed it's written to history right away. What you loose: the scroll-back buffer in each window pertaining to that session. So if you have a window running a set of commands, and you just 'up arrow' to re-run, you loose that because all history gets appended.
I too would generally have 20+ open xterm windows but this gave instant command-to-history that I needed. fzf also helps instead of relying on up-arrow.