2 ms·
Looks like it is still down - but see eg: https://askubuntu.com/questions/67283/is-it-possible-to-make-writing-to-bash-history-immediate#67306 https://askubuntu
by e12e 4y ago
Looks like it is still down - but see eg:
https://askubuntu.com/questions/67283/is-it-possible-to-make-writing-to-bash-history-immediate#67306 https://askubuntu.com/questions/67283/is-it-possible-to-make...
To wit:
> It says to put those commands in the .bashrc config:
shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
> The first command changes the history file mode to append and the second configures the history -a command to be run at each shell prompt. The -a option makes history immediately write the current/new lines to the history file.
I used to have something like this set up on my Linux laptop - the downside is that seperate shell/terminals/windows/tabs don't keep seperate history - so if you eg start a server in shell one (rails s), start editor in two - then go back to one and ctrl-c out - up arrow will now give you "vim" not "rails s".
The problem compounds if you ping, or curl in another shell etc.