Pane Management
Panes split a window into multiple independent terminals. This lets you view your editor, logs, and shell simultaneously without switching windows.
Think of panes as the "split view" inside a single window tab. Each pane runs its own shell.
Splitting Panes
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b % | `Ctrl+Space | ` |
Ctrl+b " | Ctrl+Space - | Horizontal split (top and bottom) |
From command line:
# vertical split
tmux split-window -h -t work:0
# horizontal split
tmux split-window -v -t work:0
# split with a start command
tmux split-window -h "tail -f /var/log/app.log"
The added prefix-free shortcuts produce the same results as their default counterparts:
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b ←/→/↑/↓ | Alt+←/→/↑/↓ | select-pane -L/R/U/D |
Ctrl+b ←/→/↑/↓ | Alt+h/j/k/l | select-pane -L/D/U/R (vim-style) |
Ctrl+b z | Alt+z | resize-pane -Z (toggle zoom) |
Navigating Between Panes
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b ←/↑/→/↓ | Alt+←/↑/→/↓ or Alt+h/j/k/l | Move focus by arrow key |
Ctrl+b o | Ctrl+Space o | Cycle through panes |
Ctrl+b ; | Ctrl+Space ; | Last active pane |
Ctrl+b q | Ctrl+Space q | Show pane numbers briefly (press number to jump) |
Resizing Panes
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b Alt+arrows | Ctrl+Space Alt+arrows | Resize by 5 cells |
Ctrl+b Ctrl+arrows | Ctrl+Space Ctrl+arrows | Resize by 1 cell |
| — | Ctrl+Space, then j, then Alt+h/j/k/l | Vim-style resize by 5 cells (left/down/up/right) |
On the custom Ctrl+Space prefix setup, Ctrl+Space then j enters a resize key table. After that, hold Alt while pressing h, j, k, or l to resize left, down, up, or right in five-cell increments. Repeating the Alt-modified direction repeats the resize; release Alt to stop. Plain h/j/k/l are not resize commands in this mode.
Or use the command prompt:
:resize-pane -L 10 # left
:resize-pane -R 10 # right
:resize-pane -U 5 # up
:resize-pane -D 5 # down
Zoom (Full-Screen a Pane)
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b z | Ctrl+Space z or Alt+z | Toggle zoom on current pane |
One pane fills the whole window. Press again to return to split view.
Use zoom when you need to focus on one task, then unzoom to return to your multi-pane layout.
Closing Panes
# inside the pane
exit
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b x | Ctrl+Space x | Kill current pane (confirm with y) |
# kill specific pane from outside
tmux kill-pane -t work:0.1 # session:window.pane
Moving and Swapping Panes
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b { | Prefix S Left/h | Move current pane left |
Ctrl+b } | Prefix S Right/l | Move current pane right |
Or:
# swap pane 1 and pane 2 in current window
tmux swap-pane -s 1 -t 2
Breaking a Pane into Its Own Window
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b ! | Ctrl+Space ! | Break current pane into a new window |
Useful when a pane grows too important for the split view.
Pane Targeting Syntax
When addressing panes from the command line: session:window.pane
# send a command to a specific pane
tmux send-keys -t work:editor.0 "ls -la" Enter
# work → session name
# editor → window name (or index)
# 0 → pane index (0-based)
Common Pane Layouts
Side-by-Side (Editor + Shell)
┌─────────────┬─────────────┐
│ │ │
│ vim │ shell │
│ │ │
└─────────────┴─────────────┘
tmux split-window -h
Editor + Logs Below
┌──────────────────────────┐
│ vim │
├──────────────────────────┤
│ tail -f │
└──────────────────────────┘
tmux split-window -v
Three-Pane Dashboard
┌─────────────┬─────────────┐
│ │ top │
│ vim ├─────────────┤
│ │ logs │
└─────────────┴─────────────┘
tmux split-window -h
tmux split-window -v
tmux select-pane -t 0
Common Pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
Pressing Ctrl+b x accidentally | Wrong pane killed | Learn the shortcut; press n when prompted |
| Too many panes in one window | Cramped view | Use multiple windows instead |
| Losing track of pane boundaries | Confusion about where to type | Use Ctrl+b q to confirm pane numbers |