A pane is a rectangular section within a tmux window. Each pane contains a separate pseudo terminal and can run its own program independently. Panes allow you to view and interact with multiple programs simultaneously within a single window.
Panes are numbered starting from 0 in the order they are created. Each pane has a unique pane ID (like %0, %1) that persists for its lifetime.
# Run a command in new panetmux split-window htoptmux split-window -h 'tail -f /var/log/syslog'# Start in specific directorytmux split-window -c /var/log# Set environment variabletmux split-window -e EDITOR=vim# Create empty pane (no command)tmux split-window ''# Forward stdin to empty panemake 2>&1 | tmux split-window -dI &
The -d flag creates a pane without switching to it, useful in scripts.
C-b { # Swap with previous paneC-b } # Swap with next pane# Command formtmux swap-pane -U # Swap with previoustmux swap-pane -D # Swap with next# Swap specific panestmux swap-pane -s %1 -t %3# Swap without changing active panetmux swap-pane -d -t %2# Use marked pane as sourcetmux select-pane -m # Mark panetmux swap-pane # Swap with marked
C-b ! # Break pane into new window# Command with optionstmux break-pane# Create window at specific indextmux break-pane -t :3# Give new window a nametmux break-pane -n logs# Insert before (-b) or after (-a)tmux break-pane -a -t :2# Don't switch to new windowtmux break-pane -d
C-b q # Show pane numbers brieflyC-b q 0-9 # Show numbers and switch to pane# Display panes commandtmux display-panestmux display-panes -d 5000 # Show for 5 secondstmux display-panes -d 0 # Show until keypress
# List panes in current windowtmux list-panestmux lsp# List panes in specific windowtmux list-panes -t :2# List all panes in sessiontmux list-panes -s# List all panes on servertmux list-panes -a# Custom formattmux list-panes -F "Pane #{pane_index}: #{pane_title}"# Filter panestmux list-panes -f '#{==:#{pane_active},1}'# Sort panestmux list-panes -O index # By indextmux list-panes -O size # By areatmux list-panes -O creation # By creation time
# #{pane_id} - Unique pane ID (%0, %1, etc.)# #{pane_index} - Pane index in window# #{pane_current_command} - Current command# #{pane_current_path} - Current working directory# #{pane_title} - Pane title# #{pane_pid} - PID of pane process# #{pane_active} - 1 if pane is active# #{pane_width} - Pane width# #{pane_height} - Pane height# #{pane_left} - Left position# #{pane_top} - Top position# #{pane_in_mode} - 1 if pane is in mode# #{pane_synchronized} - 1 if synchronized
C-b m # Mark current paneC-b M # Clear marked pane# Commands that use marked panetmux join-pane # Join marked pane to current windowtmux swap-pane # Swap with marked panetmux swap-window # Swap window containing marked pane# Target marked pane explicitlytmux select-pane -t '{marked}'
Only one pane can be marked at a time. Marking a new pane clears the previous mark.
# Respawn with original commandtmux respawn-pane# Respawn with new commandtmux respawn-pane 'htop'# Kill existing process firsttmux respawn-pane -k# Change directorytmux respawn-pane -c /var/log