So I end-up with never-closing task-based window sessions and occasionally copy-paste commands to a safe file for future reference.
I really should investigate the root cause some day...
So I end-up with never-closing task-based window sessions and occasionally copy-paste commands to a safe file for future reference.
I really should investigate the root cause some day...
shopt -s histappend
In your .bashrc should do. To have it write after every command take a look at http://unix.stackexchange.com/a/1292(In zsh I believe it's:
setopt inc_append_history
setopt share_history
) shopt -s histappend
export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
in your ~/.bashrc.Also, if you want fresh history in an already opened window (assuming you added the above), do "history -n". E.g. if you typed "longcommand" in window1, then switch to window2, do "history -n" and uparrow, and "longcommand" will be there.
A much better system would be to have a user daemon centralize history (among other things). The benefits would be numerous:
- Better performance
- (optional) Sync between concurrent shells
- No history overwriting problems / race conditions
In addition, this daemon could be used to enable other programs such as autojump. These programs work with the current system, but are based on a hack and as such have needlessly poor performance.
As much as I like my command line, I think it would be very worthwile to rethink this whole system from scratch.