I use mainly Terminator, and it's usually opened with 3 split terminal windows. I also use Gnome terminal for various reasons.
I'm wondering how is bash history handled in this case as I sometimes miss previously issued commands when I run history
For example, my prompt shows current bash history line (\!
) and if I launch Terminator with 3 split terminal windows I get same history line (let's say 100) on all terminals. Which history will be saved?
Also launching Gnome Terminal after using Terminator I get line 100 at startup regardless all commands issued before in Terminator
Best Answer
The bash session that is saved is the one for the terminal that is closed the latest. If you want to save the commands for every session, you could use the trick explained here.
Anyway, you'll need to take into account that commands from different sessions will be mixed in your history file so it won't be so straightforward to read it later.
See also: