vim-tmux-navigator icon indicating copy to clipboard operation
vim-tmux-navigator copied to clipboard

Cannot switch panes from plugin script running inside vim

Open artemvmin opened this issue 6 years ago • 1 comments

When I execute a vim plugin that requires running a shell command, the tmux-navigator key bindings become unresponsive until the script finishes running and control is returned to vim. However, a pane switch binding does register while the script is executing.

artemvmin avatar Nov 06 '18 00:11 artemvmin

My temporary workaround is to check that no other processes are running besides bash and vim:

is_vim="[[ -n ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'
&& -z ps -o comm= -t '#{pane_tty}' \ | grep -iEv '^(bash|n?vim?x?)$' ]]"

I'm sure this would fail on some corner cases, but works for my purposes, both local and ssh. (I had to remove the grep -q flag for the statement to work inside the test block.)

artemvmin avatar Nov 09 '18 18:11 artemvmin