I noticed that esc will also start listening for instructions to switch panes. I'm new to Tmux, I copied a Tmux conf file earlier today which should only have enabled alt to switch panes, so I'm not sure if this conf file enabled it or if it's standard in Tmux 2.3.
Seeing as I tend to start moving around after entering normal mode, this annoys the hell out of me. Can anyone tell me how to disable pane switching with esc?
Found this, which fixed the problem for me: https://unix.stackexchange.com/questions/23138/esc-key-causes-a-small-delay-in-terminal-due-to-its-alt-behavior
Add to your ~/.tmux.conf
:
set -s escape-time 0
I think your ~/.tmux.conf file contains lines like below:
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
These lines bind Alt-h(j,k,l) to switch pane without need of prefix key. But it seems that ESC+h(j,k,l) will also trigger the Alt-h(j,k,l). I don't know why either.
My way to fix it:
Change the key binding above in .tmux.conf to the new one below:
bind -n C-j select-pane -D \; display-panes
bind -n C-k select-pane -U \; display-panes
bind -n C-h select-pane -L \; display-panes
bind -n C-l select-pane -R \; display-panes
Restart your tmux. This will remove your previous M-(h,j,k,l) binding, and the new binding will take effect.
The meaning of the new binding is to: Use Ctrl-vim keys without prefix key to switch pane, and at the same time, show the pane indicator: the current active pane index's color will be red.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With