How to resize panes in tmux?

Quick Answer

To resize a pane in tmux, press Ctrl+b followed by one of the arrow keys to adjust in that direction. Hold Ctrl while pressing the arrow for larger adjustments.

Ctrl+b+↑/↓/←/→

Detailed Explanation

Tmux allows you to resize panes to optimize your workspace layout. You can resize panes using keyboard shortcuts, mouse interactions (if enabled), or tmux commands. Here's how to adjust pane sizes to fit your needs.

Resize using keyboard shortcuts:

  • Ctrl+b ↑ - Resize pane upward (make current pane taller)
  • Ctrl+b ↓ - Resize pane downward (make current pane shorter)
  • Ctrl+b ← - Resize pane left (make current pane narrower)
  • Ctrl+b → - Resize pane right (make current pane wider)

Resize with larger increments:

  • Ctrl+b Ctrl+↑ - Resize pane upward by 5 cells
  • Ctrl+b Ctrl+↓ - Resize pane downward by 5 cells
  • Ctrl+b Ctrl+← - Resize pane left by 5 cells
  • Ctrl+b Ctrl+→ - Resize pane right by 5 cells

Resize with precise commands:

  • Ctrl+b : then type resize-pane -U 10 - Resize up by 10 cells
  • Ctrl+b : then type resize-pane -D 10 - Resize down by 10 cells
  • Ctrl+b : then type resize-pane -L 10 - Resize left by 10 cells
  • Ctrl+b : then type resize-pane -R 10 - Resize right by 10 cells

Special resize options:

  • Ctrl+b : then type resize-pane -t 1 -U 10 - Resize pane 1 up by 10 cells
  • Ctrl+b : then type resize-pane -Z - Toggle zoom (maximize/restore) current pane
  • Ctrl+b z - Shortcut to toggle zoom on current pane

Mouse Mode

If mouse mode is enabled (set -g mouse on in your .tmux.conf), you can resize panes by clicking and dragging the pane border.

Pro Tip

Use Ctrl+b Alt+1 through Ctrl+b Alt+5 to quickly switch between preset layouts like even-horizontal, even-vertical, main-horizontal, main-vertical, and tiled.