To maximize a pane in tmux, press Ctrl+b z. This toggles the current pane between maximized (full window) and its normal size. The same key combination will restore the pane to its original position and size. This "zoom" feature is perfect for temporarily focusing on a specific pane without changing your overall layout.
Ctrl+b z
The pane maximization feature in tmux (often called "zoom") allows you to temporarily expand a pane to fill the entire window, making it easier to focus on a specific task, view more content, or work with complex text editors and applications.
To maximize the current pane:
When a pane is maximized, you'll notice a "Z" indicator in the status line (if your status line is configured to show it), which helps you remember that you're in a zoomed state.
You can also maximize a pane using the tmux command prompt:
# Enter command mode with Ctrl+b :, then type: resize-pane -Z
The -Z
flag toggles the zoom state of the pane. This is the same command that Ctrl+b z executes behind the scenes.
If you want to use a different key for maximizing panes, you can set up a custom keybinding in your ~/.tmux.conf
file:
# Remap zoom to Ctrl+b m unbind z bind m resize-pane -Z
This example changes the zoom keybinding from z to m, which some users find more intuitive (for "maximize").
To make it more obvious when a pane is zoomed, you can add a zoom indicator to your tmux status line by including #{?window_zoomed_flag,Z,}
in your status-right or status-left configuration:
# Add to ~/.tmux.conf to show zoom status in status line set -g status-right "#{?window_zoomed_flag,[Z],} | %H:%M %d-%b"
This will display a "[Z]" in the status line whenever a pane is zoomed, making it easier to remember that you're in a maximized state.
The maximize feature is particularly useful in these scenarios:
Create a key binding to maximize a pane and immediately enter copy mode, which is useful for reviewing large outputs:
# Add to ~/.tmux.conf bind C-z resize-pane -Z \; copy-mode
With this configuration, pressing Ctrl+b Ctrl+z will maximize the current pane and immediately enter copy mode, allowing you to scroll and search.
Instead of maximizing a single pane, you might want to consider these alternatives: