3 ms·
>For your 1st issue, you can setup bash to append commands rather than overwrite them. Good, but even better (IMHO) is to write one history file for each termi
by jcynix 3y ago
>For your 1st issue, you can setup bash to append commands rather than overwrite them.
Good, but even better (IMHO) is to write one history file for each terminal window, shell and level as in
export HISTFILE=$HOME/.history/${TTY##*/}.$SHLVL
And then I tell zsh to add timestamps
setopt APPENDHISTORY # don't overwrite HISTFILE
setopt EXTENDEDHISTORY # add timestamps to HISTFILE
setopt HISTIGNORESPACE # aka setopt -g
set HIST_FIND_NO_DUPS # don't show duplicates on ctrl-R
Now I can grep my history and, based on other work notes I take, can even limit my search by date/time if needed.