How to switch directly to a pane in Tmux?

You can jump directly to a pane by typing pane's index while it is showed by display-panes command.

From man tmux:

display-panes [-t target-client]
                   (alias: displayp)
             Display a visible indicator of each pane shown by target-client.
             See the display-panes-time, display-panes-colour, and
             display-panes-active-colour session options.  While the indicator
             is on screen, a pane may be selected with the ‘0’ to ‘9’ keys.

Or instead of typing command, you can use:

C-b q
  • C-b send prefix key
  • q display panes indexes

Ctrlbq (the tmux defualt prefix sequence plus q) will briefly display the pane indexes, if you enter the index number while they are dsiplayed, your cursor will move to that pane.

If you have a large number of panes and the display time is too short, you can configure tmux to display the index for a specified interval with the display-panes-time option in your ~/.tmux.conf. The value is in milliseconds.


I know this isn't necessarily what you asked for, but enabling mouse support is pretty easy and most terminal emulators support it.

You may simply click on the pane you want to switch to. :)

Tags:

Tmux