A split tmux window sends keyboard input only to the active pane. Select the intended pane before running commands so typing reaches the right shell, editor, log view, or monitor without changing the layout or interrupting the other panes.
Pane focus can move through default prefix bindings or through the select-pane command. The common interactive path is Ctrl-b q to show pane numbers, Ctrl-b o to cycle, or Ctrl-b plus an arrow key to move toward a neighboring pane.
Pane indexes belong to one tmux window, and they can change when panes are killed, split, or rearranged. The command examples were verified with tmux 3.6 on Ubuntu 26.04; use the configured prefix instead of Ctrl-b when the session has a custom prefix.
Related: How to split a pane horizontally in tmux
Related: How to split a pane vertically in tmux
Related: How to resize panes in tmux
Related: How to change tmux prefix key to Ctrl-a
Steps to select a tmux pane:
- Show pane numbers in the current window when the target pane is visible but not obvious.
Ctrl-b q
The default q binding runs display-panes and overlays each pane with its number for a short time.
- Press the target pane number before the overlay disappears.
2
Replace 2 with the number shown on the pane that should receive input.
- Cycle to the next pane when repeated movement is enough to reach the target.
Ctrl-b o
The default o binding runs select-pane -t :.+.
- Move directly to an adjacent pane with the arrow binding that points toward it.
Ctrl-b Left Ctrl-b Right Ctrl-b Up Ctrl-b Down
These default bindings run select-pane with -L, -R, -U, or -D.
- Select a known pane from the tmux command prompt when its pane index is already known.
Ctrl-b : select-pane -t :.2
The :.2 target means pane 2 in the current window.
- Select a pane from a normal shell when a script or detached check needs an explicit target.
$ tmux select-pane -t work:0.2
The target format is session:window.pane. In this example work:0.2 means pane 2 in window 0 of session work.
- Confirm the active pane with display-message after selecting it.
$ tmux display-message -p -t work:0 '#{pane_index}: #{pane_id} active=#{pane_active}' 2: %1 active=1The active=1 field confirms that tmux is focused on pane 2 for the target window.
- List all panes when the selected pane still needs to be compared with the rest of the window.
$ tmux list-panes -t work:0 -F '#{pane_index}: #{pane_id} active=#{pane_active}' 0: %0 active=0 1: %2 active=0 2: %1 active=1The line with active=1 is the pane that receives input in the target window.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.