How to move between tmux panes?

By Romain Dorgueil

Short answer

tmux select-pane -L     # focus the pane to the left (-R right, -U up, -D down)
tmux select-pane -t :.+ # focus the next pane in order, wrapping around

From the keyboard, prefix then an arrow key moves the focus in that direction. prefix o cycles to the next pane and wraps around. prefix q overlays a number on each pane; type it to jump straight there.

Details

The arrow binds are repeatable (-r), so after one prefix you can keep tapping arrows within the repeat timeout to walk across panes without pressing the prefix again. Directional moves pick the neighbour in that direction based on the layout, which is what you want when you can see where you are going.

prefix o runs select-pane -t :.+, stepping to the next pane in index order and looping back to the first after the last. It ignores the visual layout, so it is the fastest way to touch every pane in turn.

prefix q runs display-panes: each pane shows a large number, and pressing that digit focuses the pane. The overlay stays up for display-panes-time, 1000 ms by default, so raise that option if you need longer to read the numbers. The digits are the pane indexes, which start at 0 unless you set pane-base-index 1.

To bounce back to the pane you just left, prefix ; toggles the last active pane, the pane-level twin of prefix l for windows.

Verified on tmux 3.2a: from a pane at the left edge, select-pane -R moves focus to the right column and select-pane -D to the pane below; select-pane -t :.+ cycles through all panes and returns to the first.

Related