From bb5c7850c613cab8ec7caf6f3ebda6bfff8ac052 Mon Sep 17 00:00:00 2001 From: Sherry Seibel Date: Wed, 19 Jan 2022 16:13:23 -0500 Subject: [PATCH] Modify `grep` to stop pane switch freeze More information can be found here: https://github.com/christoomey/vim-tmux-navigator/issues/299 --- tmux/tmux.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tmux/tmux.conf b/tmux/tmux.conf index a7c8eb31c6..765e8c3aa4 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -26,8 +26,8 @@ bind -r L resize-pane -R 5 # Smart pane switching with awareness of Vim splits. # See: https://github.com/christoomey/vim-tmux-navigator -is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + +is_vim="ps -a | grep -qE '#{s|/dev/||:pane_tty}''.*(n?)vim'" bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' @@ -36,7 +36,7 @@ bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" -if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" bind-key -T copy-mode-vi 'C-h' select-pane -L