From 610cae2f57ea834a2e5ee23983b81269b2e236eb Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Thu, 5 Sep 2019 11:20:01 +0100 Subject: [PATCH] Check for tmux session in prompt Before invoking the `tmux` command to unset the vim pane variable first check that a `tmux` session exists. --- prompt_fresh_setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prompt_fresh_setup b/prompt_fresh_setup index 04c9b47..ee0a6cb 100644 --- a/prompt_fresh_setup +++ b/prompt_fresh_setup @@ -110,9 +110,9 @@ fresh_line_one() { fi # Unset vim/tmux navigate flag to handle C-z and multiple vim jobs. - if [[ ! -z "$TMUX" ]]; then - tmux set-window-option -u @vim$TMUX_PANE - fi + [[ ! -z "$TMUX" ]] && \ + [[ "`tmux show-window-options`" = *"@vim$TMUX_PANE"* ]] && \ + tmux set-window-option -u @vim$TMUX_PANE # If a virtualenv is enabled, display it's basename if [[ ! -z "$VIRTUAL_ENV" ]]; then