Switch split panels in tmux: once per command

I was a happy tmux user for a while, but there was one behavior that hit me. When I switch panels using the ^ b-arrow, and then immediately press the up arrow (for example, to get a command from the history), the window panel switches again. I understand that this can be useful if you want to quickly move across several panels, but for me it is a pain in the back, as I continue to finish in glasses that I never wanted to be on.

So, is there a way to set tmux so that the ^ b-arrow command only switches the panel once and ignores any subsequent arrow key presses?

+55
tmux
Dec 02 '12 at 11:01
source share
3 answers

This is because the default bindings for the arrow keys are set using bind-key -r , indicating that they can be repeated. There are two ways to disable this.

First, you can use set-option repeat-time 0 to completely disable the repeat. This will affect all bindings. I find it very annoying when resizing panels.

Secondly, you can change the arrow key bindings to use bind-key without the -r option:

 bind-key Up select-pane -U bind-key Down select-pane -D bind-key Left select-pane -L bind-key Right select-pane -R 
+65
Dec 02 '12 at 15:50
source share

If you navigate panels many times, why not set up global mappings, so you don’t need to use prefixes at all, for example. bind -n Ch select-pane -L to display ctrl-h to switch left, like Vim.

See http://robots.thoughtbot.com/seamlessly-navigate-vim-and-tmux-splits for an even better solution that also moves through Vim windows.

+7
Apr 04 '14 at 10:28
source share

Another option is to snap to go to the previous panel if you are moving back and forth between the same two panels.

 bind-key Ca last-pane 
+3
Apr 7 '13 at 1:38 on
source share



All Articles