Fixed PROMPT_COMMAND from being duplicated

This commit is contained in:
Gal Szkolnik 2022-06-07 13:50:15 -04:00
parent 9b5c2c497c
commit 1701cc1189
1 changed files with 3 additions and 1 deletions

View File

@ -4,4 +4,6 @@ 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
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
if ! [[ "$PROMPT_COMMAND" =~ "history -a; history -c; history -r;" ]]; then
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
fi