bash_history: исправлен дубль в PROMPT_COMMAND при повторном source
This commit is contained in:
parent
7da8d37b25
commit
f9ef87dc12
@ -8,4 +8,7 @@ HISTTIMEFORMAT="%F %T "
|
||||
shopt -s histappend
|
||||
|
||||
# After each command: flush to file, reload from file (syncs across all panes/windows)
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }history -a; history -c; history -r"
|
||||
# Guard against double-sourcing (e.g. multiple tmux panes all source ~/.bashrc)
|
||||
if [[ "$PROMPT_COMMAND" != *"history -a; history -c; history -r"* ]]; then
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND%;};} history -a; history -c; history -r"
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user