- Add both files in this gist to $BASH_HOME.
https://gist.github.com/chmaynard/dbcaed11534dc54bdc90856d18...
- Install .bash-preexec.sh in $HOME (see https://github.com/rcaloras/bash-preexec).
- Append this command to your shell startup file (e.g. $BASH_HOME/.bashrc):
source $BASH_HOME/bash_history.sh
Enjoy! Please share your feedback in the gist comments section.
(Memo to self: Package this up in a repo with a proper README.)