dotfiles.2022/_home/dot_sz.shrc.d/bash.post/11_persistent.history
Gal@Shefet 09a810495f Fixed omp prompt
Fixed: .envrc shows up when `direnv` does not exists
Fixed: history hook was running before _omp_hook, losing the latest
       error code.
2022-09-27 13:02:30 -04:00

8 lines
460 B
Text

export HISTCONTROL=ignoreboth:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
[[ -z "$(printenv PROMPT_COMMAND | grep 'history -')" ]] && \
export PROMPT_COMMAND="$PROMPT_COMMAND; history -a; history -c; history -r"