How to zoom a pane in tmux

A split tmux window can make an editor, log view, or command output hard to read when each pane has only a small part of the terminal. Zooming temporarily expands the active pane to fill the window while the other panes stay alive and hidden behind it.

The default zoom binding is C-b z when the prefix is still C-b. It runs resize-pane -Z, which toggles the active pane between the full-window zoomed view and its original place in the layout.

A zoomed window shows the tmux zoom flag, and the same state can be checked with window_zoomed_flag. The command examples were verified with tmux 3.6 on Ubuntu 26.04; commands that resize, split, swap, or otherwise change pane positions can unzoom the window automatically.

Steps to zoom a pane in tmux:

  1. Confirm the current window contains at least two panes before using zoom.
  2. Show pane numbers when the pane that should fill the window is not active.
    C-b q

    The zoom command affects the active pane.

  3. Press the target pane number before the overlay closes.
    1

    Replace 1 with the pane number shown by tmux.

  4. Press the default zoom binding.
    C-b z

    The pane expands to fill the tmux window. The other panes are hidden from view but their programs keep running.

  5. Open the tmux command prompt when the shortcut is inconvenient or the prefix has been customized.
    C-b :
    resize-pane -Z

    The command-prompt form toggles zoom for the active pane, just like the default C-b z binding.

  6. Run resize-pane -Z from a normal shell when automation needs an explicit pane target.
    $ tmux resize-pane -Z -t zoomdemo:0.0

    Replace zoomdemo:0.0 with the target pane. The format is session:window.pane, so this example means pane 0 in window 0 of session zoomdemo.

  7. Confirm the window is zoomed with display-message.
    $ tmux display-message -p -t zoomdemo:0 '#{window_panes} panes zoomed=#{window_zoomed_flag}'
    2 panes zoomed=1

    The zoomed=1 field confirms that one pane is filling the window while the window still has two panes.

  8. Toggle zoom again to restore the original pane layout.
    C-b z

    Running resize-pane -Z a second time performs the same unzoom action.

  9. Confirm the layout has returned to the unzoomed state.
    $ tmux display-message -p -t zoomdemo:0 '#{window_panes} panes zoomed=#{window_zoomed_flag}'
    2 panes zoomed=0

    The zoomed=0 field confirms that tmux returned to the normal split-pane layout.