Hi,
For a long time I've noticed lost history from multiple Terminal tab/windows. It seems
like the last tab or window to close is the history that gets written to .bash_history,
and everything else is just lost.
Somehow I found this:
https://web.archive.org/web/20090815205011/http://www.cuberick.com/2008/1...
I've implemented the suggested two line change to .bash_profile:
# User specific environment and startup programs
shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
The resulting behavior appears to be shells still have their own unique histories while
active. But once closed, their histories become merged (interlaced based on the time they
were issued?) and available when a new shell is created.
I think this would be a pretty cool yet subtle Fedora 39 feature. However,
a) I'm uncertain exactly where this belongs as a default, .bashrc or .bash_profile or
some parent file that's copied to create these files (for new users);
b) if this is (still) an optimal way to go about it;
c) what are the possible negative side effects?
Any thoughts?
--
Chris Murphy