$ man tmux, but useful

tmux cheat sheet

Sessions

A session is a workspace that survives disconnects. Detach, go home, reattach — everything is still running.

C-bthendDetach from sessionC-bthen$Rename session
C-bthensPick a session from a list
C-bthen)Next session
C-bthen(Previous session
C-bthenLJump to last-used session
C-bthenDPick a client to detach
$ tmux new -s nameStart a new named session
$ tmux new -s name -dStart a session without attaching
$ tmux attach -t nameAttach to a session
$ tmux new -As nameAttach if it exists, create if not
$ tmux lsList sessions
$ tmux kill-session -t nameKill a session
$ tmux kill-session -aKill every session except the current one
$ tmux kill-serverKill the tmux server and all sessions
$ tmux detachDetach (from the command prompt)
$ tmux rename-session -t old newRename a session
Windows

Windows are like browser tabs inside a session. The status bar at the bottom lists them.

C-bthencCreate new windowC-bthen,Rename window
C-bthennNext window
C-bthenpPrevious window
C-bthen0–9Jump to window number N
C-bthenlToggle to last-used window
C-bthen&Kill window (asks to confirm)
C-bthenfSearch windows by name/content
C-bthenwPick a window from a list
C-bthen'Prompt for a window index to jump to
C-bthen.Move window to a new indexTip: `move-window -r` from the command prompt renumbers all windows to close gaps.
C-bthenM-nNext window with activity alert
C-bthenM-pPrevious window with activity alert
C-bthen<Open window context menu
$ tmux neww -n nameCreate a named window
$ swap-window -s 2 -t 1Swap two windows by index
$ move-window -rRenumber windows to close gaps
Panes

Panes split one window into multiple terminals, side by side or stacked.

C-bthen%Split pane left / right
C-bthen"Split pane top / bottom
C-bthenMove between panes
C-bthenoCycle to next pane
C-bthen;Toggle to last-used pane
C-bthenzZoom pane to full window (toggle)
C-bthenxKill pane (asks to confirm)
C-bthen!Break pane out into its own windowThe reverse is `join-pane -s <window>` from the command prompt — it has no default key.
C-bthenqShow pane numbers (press one to jump)
C-bthen{Swap pane with the previous one
C-bthen}Swap pane with the next one
C-bthenC-oRotate all panes in the window
C-bthenmMark pane (M clears)
C-bthen>Open pane context menu
$ join-pane -s :2Pull window 2 in as a pane here
$ setw synchronize-panesType into every pane at once (toggle)
$ capture-pane -p -S -1000Dump the last 1000 lines of a pane
$ pipe-pane -o 'cat >> ~/pane.log'Log all pane output to a file (toggle)
$ respawn-pane -kRestart the command in a dead pane
$ display-popup -E 'command'Run a command in a floating popup
Resize & layouts

Resize panes by hand or snap every pane into one of tmux's preset layouts.

C-bthenM-↑M-↓M-←M-→Resize pane by 5 cells
C-bthenC-↑C-↓C-←C-→Resize pane by 1 cell
C-bthenSpaceCycle through preset layouts
C-bthenM-1Layout: even columns
C-bthenM-2Layout: even rows
C-bthenM-3Layout: big pane on top
C-bthenM-4Layout: big pane on the left
C-bthenM-5Layout: tiled grid
C-bthenESpread panes out evenly
Copy mode & scrolling

Copy mode freezes the screen so you can scroll, search, and copy text with the keyboard (vi-style keys shown).

C-bthen[Enter copy mode (scroll & copy)
C-bthenPgUpEnter copy mode one page up
SpaceStart selecting text
EnterCopy selection and exit copy modeWith vi keys enabled, `y` is the binding everyone adds; the default vi table uses Enter.
qExit copy mode
hjklMove the cursor (vi keys / arrows both work)
C-uScroll half a page up
C-dScroll half a page down
C-b/PgUpScroll a full page up
C-f/PgDnScroll a full page down
gJump to the top of scrollback
GJump to the bottom (newest output)
/Search down
?Search up (through older output)
n/NNext / previous search match
VSelect the whole line
vToggle rectangle (block) selectionSurprise: in the default vi table, `v` toggles rectangle select — it does not start a selection like in vim. Space starts selection.
wbeMove by word
0$^Start / end of line
:Go to line number
*/#Search for the word under the cursor
oJump to the other end of the selection
AAppend selection to the last buffer
Paste buffers

Everything you copy in tmux lands in a paste buffer — tmux keeps a history of them.

C-bthen]Paste the most recent buffer
C-bthen#List paste buffers
C-bthen=Pick a buffer to paste from history
C-bthen-Delete the most recent buffer
$ tmux lsbList paste buffers
$ tmux showbPrint the newest buffer to stdout
$ tmux saveb file.txtSave the newest buffer to a file
$ tmux loadb file.txtLoad a file into a buffer
Command prompt & misc

The command prompt, built-in help, and everything that doesn't fit elsewhere.

C-bthen:Open the tmux command promptC-bthen?List all keybindings
C-bthen/Describe what a key does
C-bthenC-bSend a literal Ctrl-b to the program
C-bthentShow a big clockAny key dismisses it. Yes, it's real. Yes, it's someone's favorite feature.
C-btheniShow info about the current window
C-bthen~Show the server message log
C-bthenCBrowse & edit options interactively
C-bthenrRedraw the screen
C-bthenC-zSuspend the tmux clientSends tmux itself to the shell background — bring it back with `fg`. If your tmux ever "disappears", you probably pressed this.
$ tmux source ~/.tmux.confReload your config
$ tmux send-keys -t name 'cmd' EnterType into a session from outside
$ tmux <any command>Every tmux command works from the shell
$ tmux lsk -N | lessBrowse all keybindings with notes
$ tmux customize-modeInteractive options browser
$ tmux wait-for channelSynchronize scripts with tmux events