4 ms·
This will do what you want: Append this to your .bashrc. ```export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"``` -a = append to hist
by UI_at_80x24 2y ago
This will do what you want:
Append this to your .bashrc.
```export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"```
-a = append to history file
-c = 'clear' aka write the history file
-r = reload
Every time you hit 'enter' this will add the command to the history file, and will reload your bash prompt history.
That means that every terminal window will share a common history file and you don't need to close the TERM to 'save' the session to history.
This is ESPECIALLY helpful on remote (SSH) connections.
Downside:
You 'Up Arrow' history gets altered by every term window you have running. So you can't just blindly `up` to repeat a command.
It takes a little to get used to, but VERY handy.
This allows EV