Resizing panes in tmux changes how much space each command area gets inside the current window, which is useful when one pane needs more room for an editor, logs, or long command output while the others can stay smaller.
The default tmux resize workflow is keyboard-driven and works on the active pane only, so the main things to know are which pane currently has focus and which direction you want its border to move. In current tmux releases, the default prefix is Ctrl-b, then Ctrl plus an arrow key resizes by one cell and Meta plus an arrow key resizes by five cells.
The examples below assume you are already inside a tmux window that contains at least two panes and that your terminal passes the resize keys through to tmux. If you changed the prefix or your terminal captures Alt or Meta, use your custom prefix or fall back to the tmux command prompt noted below.
Related: How to split a pane horizontally in tmux
Related: How to split a pane vertically in tmux
Related: How to enable mouse support in tmux
Steps to resize panes in tmux:
- Confirm the current window already contains at least two panes before resizing.
Need another pane first: How to split a pane horizontally in tmux or How to split a pane vertically in tmux.
- Move focus to the pane that should grow or shrink before you use the resize keys.
Prefix + o Prefix + Left Prefix + Right Prefix + Up Prefix + Down
The resize action always affects the active pane, so changing focus first keeps you from moving the wrong border.
- Press the prefix and then Ctrl-Left or Ctrl-Right to shrink or grow the active pane by one column.
Prefix + Ctrl-Left Prefix + Ctrl-Right
- Press the prefix and then Ctrl-Up or Ctrl-Down to shrink or grow the active pane by one row.
Prefix + Ctrl-Up Prefix + Ctrl-Down
- Press the prefix and then Meta-Left, Meta-Right, Meta-Up, or Meta-Down to resize faster in five-cell steps.
Prefix + Meta-Left Prefix + Meta-Right Prefix + Meta-Up Prefix + Meta-Down
On most keyboards Meta is the Alt key, so these default bindings are commonly used as Alt+Arrow after the tmux prefix.
- Repeat the same direction key while tmux still accepts repeatable prefix bindings when you need several small adjustments in a row.
The current default resize bindings are marked repeatable in tmux, which lets you keep tapping the direction key without typing the full prefix sequence every time.
- Verify the pane sizes after resizing with tmux list-panes.
$ tmux list-panes -t demo:0 -F '#{pane_index}: #{pane_width}x#{pane_height} active=#{pane_active}' 0: 50x24 active=1 1: 29x24 active=0In this example pane 0 is the active pane and is wider than pane 1, which confirms that the resize took effect.
Notes
- The resize examples assume the default tmux prefix is Ctrl-b, so use your own prefix if you changed it in .tmux.conf.
- If your terminal or desktop environment captures Alt or Meta, open the tmux command prompt with Prefix + : and run one of the directional resize-pane commands instead.
resize-pane -L 5 resize-pane -R 5 resize-pane -U 5 resize-pane -D 5
- Use absolute sizing from the tmux command prompt when a pane needs a fixed width or height.
resize-pane -x 80 resize-pane -y 20
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.
