I have a tmux window with 2 panes (pane-ids: 0 and 1). In the pane 0 there is vim launched. I want to fire a combination of two commands from tmux command-prompt:
:send-keys -t 0 "iabc" ; swap-pane -D
The keys iabc
are to enter Insert mode in vim and type. It doesn't matter what they are - just intended to be input for vim. Unfortunately this doesn't work. The swap-pane
does work but the sent keys are not "consumed" by vim until after I manually press some key in the vim's pane or call a separate send-keys
again and then suddenly the "suspended" action takes effect. It looks like the vim's process cannot consume input because of swapping the containing pane at the same time.
Eventually I need a binding like: bind-key s send-keys -t 0 "iabc" \; swap-pane -D
but I observed it behaved exactly the same on a command-prompt level.
I tried many different binding versions with multiple send-keys
s and sequences and neither works so please don't suggest untested guesses because I've already wasted a whole lot of time for it :( I need to achieve it in a single bind-key
. I'll appreciate any help or explanation of this failure.
tmux 3.0a, vim 8.1, bash 5.0.17(1), Ubuntu 20.04.1 LTS