1
0

bash_history: исправлен дубль в PROMPT_COMMAND при повторном source

This commit is contained in:
lukas91 2026-06-09 13:12:00 +05:00
parent 7da8d37b25
commit f9ef87dc12

View File

@ -8,4 +8,7 @@ HISTTIMEFORMAT="%F %T "
shopt -s histappend shopt -s histappend
# After each command: flush to file, reload from file (syncs across all panes/windows) # 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