tmux Cheat Sheet

Sessions, windows, panes, copy mode, configuration, and the patterns you actually use day-to-day.

Prefix key reminder. By default, every tmux keybinding is prefaced by Ctrl+b (the prefix). So when you see prefix c below, that means: press Ctrl+b, release, then press c. Many people remap the prefix to Ctrl+a for less finger gymnastics. See the Configuration section.
Sessions (the outermost layer)
tmux
Start a new session
tmux new -s name
Start a new named session (recommended)
tmux ls
List sessions
tmux a
Attach to last session
tmux a -t name
Attach to a specific named session
tmux kill-session -t name
Kill a session by name
tmux kill-server
Kill all sessions and the tmux server
prefix d
Detach from session (it keeps running)
prefix s
Interactive session picker
prefix $
Rename current session
Windows (tabs)
prefix c
Create new window
prefix ,
Rename current window
prefix &
Kill current window (with confirmation)
prefix n
Next window
prefix p
Previous window
prefix 0-9
Jump to window by number
prefix l
Last (most recent) window
prefix w
Interactive window picker
prefix f
Find window by content/name
Panes (splits within a window)
prefix %
Split pane vertically (creates left/right split)
prefix "
Split pane horizontally (creates top/bottom split)
prefix arrow
Move between panes
prefix o
Cycle to next pane
prefix q
Show pane numbers (press number to jump)
prefix x
Kill current pane (with confirmation)
prefix z
Toggle full-screen zoom on current pane
prefix Space
Cycle through pane layouts (preset arrangements)
prefix {
Swap with previous pane
prefix }
Swap with next pane
prefix !
Convert pane to its own window
prefix Ctrl+arrow
Resize pane in steps
prefix Alt+arrow
Resize pane in larger steps
Copy Mode
prefix [
Enter copy mode (scrollback navigation, search, copy)
q
Exit copy mode
/ then text
Search forward (vi mode)
? then text
Search backward (vi mode)
n / N
Next / previous search match
Space
Start text selection (vi mode)
Enter
Copy selection to tmux paste buffer
prefix ]
Paste from tmux paste buffer
prefix =
Show all paste buffers and pick one
System clipboard: by default, tmux's paste buffer is internal. To put copied text into your OS clipboard, install xclip (Linux), pbcopy (macOS), or use the tmux-yank plugin which handles all platforms.
Status & Info
prefix t
Show big clock
prefix i
Show window info
prefix ?
List all keybindings
prefix :
Open command prompt
tmux info
Detailed info about tmux server (from outside tmux)
tmux list-keys
All keybindings, dumped (useful for grepping)
Configuration (~/.tmux.conf)

Edit ~/.tmux.conf and reload with prefix :source-file ~/.tmux.conf or kill the tmux server.

Remap prefix to Ctrl+a (less finger strain)
unbind C-b
set -g prefix C-a
bind C-a send-prefix
More intuitive split commands
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
vi-style copy mode
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel
Mouse support (scroll, click panes, drag to resize)
set -g mouse on
Bigger scrollback buffer
set -g history-limit 50000
Start window/pane numbering at 1 (top row of keyboard)
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
Reload config with prefix r
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"
Plugin Manager (TPM)
git clone
Install: git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
prefix I
Install configured plugins (capital I)
prefix U
Update all plugins
prefix Alt+u
Uninstall plugins removed from .tmux.conf
TPM bootstrap in ~/.tmux.conf
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

# Keep this at the very bottom of the config file
run '~/.tmux/plugins/tpm/tpm'
Common Patterns
One project per session. Name sessions after projects (tmux new -s terminalfeed). Use windows inside the session for different concerns (editor, server, logs, git). Detach (prefix d) when switching projects, never close the terminal window.
Reattach after SSH disconnect. If you SSH'd into a server and started something long-running in tmux, it survives the disconnect. Reconnect, run tmux a, and you're back.
Pair-programming. Two people SSH'd into the same machine can attach to the same session and see each other's input. Useful for live debugging or teaching.
Quick split for tail -f. prefix " then run tail -f log. Watch logs in the bottom while you work in the top. prefix z zooms whichever pane needs full attention.