0

I can successfully switch panes in tmux with the following command:

Ctrl+bleft arrow (or any other direction)

However, because I am impatient, I usually want to start typing in the new pane immediately. For example, to switch panes and then start typing, I might type either of the following sequences:

Ctrl+bleft arrowright arrow

Ctrl+bleft arrowEscdown arrow

Both of these sequences, when typed quickly, result in unintended consequences. When I type the final arrow key, tmux is still in function mode and either switches back to a different pane or resizes the current pane, respectively.

Therefore, how can I quickly switch panes and begin typing in the new pane immediately?

I would prefer to leave all of tmux's default settings (especially escape-time and display-panes-time) at their default values and am looking for more of a key-sequence solution instead.

I believe another way to phrase this question more broadly is: In tmux, how do I switch from function mode to meta mode without waiting for time equal to tmux's escape-time setting to pass by?

  • 1
    The point of escape-time is that some sequences of characters are ambiguous, so timing is used to differentiate them. Would you be open to using different sequences to switch panes? Out of the box ctrl-b semicolon will toggle between two panes and ctrl-b o will cycle through the panes. Many people have config files which provide other key sequences to move between panes. – icarus Feb 17 at 4:48
  • Wow, Ctrl+b ; (control + b, semicolon) works great and seems to be exactly what I'm looking for. I noticed that if I have more than two panes, this keyboard command will even ignore the other panes. If you'd like to post this comment as an answer, I'll accept it. – Leo Galleguillos Feb 18 at 16:04
3

By default the arrow keys are bound with the -r flag so they repeat:

$ tmux lsk -Tprefix Left
bind-key -r -T prefix Left select-pane -L

You need to either bind them without -r, or change repeat-time to 0.

escape-time is for something different (partial escape sequences from the terminal) and is not important once tmux knows what key has been pressed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.