From f9ef87dc126d359b4fc6db284d042adb641bc7a8 Mon Sep 17 00:00:00 2001 From: lukas91 Date: Tue, 9 Jun 2026 13:12:00 +0500 Subject: [PATCH] =?UTF-8?q?bash=5Fhistory:=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=B4=D1=83=D0=B1=D0=BB=D1=8C?= =?UTF-8?q?=20=D0=B2=20PROMPT=5FCOMMAND=20=D0=BF=D1=80=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=BE=D0=BC=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmux/tmux/bash_history.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tmux/tmux/bash_history.sh b/tmux/tmux/bash_history.sh index f927cd0..a08c568 100644 --- a/tmux/tmux/bash_history.sh +++ b/tmux/tmux/bash_history.sh @@ -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