tmux Quick Reference

DDefault prefix: press Ctrl-b, release it, then press the command key. Example: Ctrl-b, then c. tmux Getting Started

Sessions

tmux new -s work # Start a named session
tmux ls # List sessions
tmux attach -t work # Reattach to a session
tmux kill-session -t work

Ctrl-b d detaches from a session; it keeps running in the background.

Default keys

KeysAction
Ctrl-b cCreate a window
Ctrl-b ,Rename current window
Ctrl-b n / pNext / previous window
Ctrl-b 0–9Select window by number
Ctrl-b wChoose a window
Ctrl-b %Split pane left/right
Ctrl-b "Split pane top/bottom
Ctrl-b + arrowMove to pane in that direction
Ctrl-b oCycle through panes
Ctrl-b zZoom or unzoom current pane
Ctrl-b xClose current pane
Ctrl-b &Close current window
Ctrl-b [Enter copy mode; press q to leave
Ctrl-b dDetach
Ctrl-b ?Show key bindings
Ctrl-b :Open tmux command prompt

Window and pane close commands ask for confirmation. Key bindings can be listed with Ctrl-b ?; the official guide explains the prefix sequence and command prompt. tmux Getting Started

Commands at the tmux prompt

Press Ctrl-b :, type a command, then press Enter.

new-window -n logs
split-window -h # Left/right panes
split-window -v # Top/bottom panes
select-window -t :2
select-pane -L # Or -R, -U, -D
resize-pane -L 5 # Resize by 5 cells

Remember

  • Session: a workspace that can keep running after you detach.
  • Window: like a tab within a session.
  • Pane: a split terminal within a window.
  • Default prefix is Ctrl-b; tmux settings can change it. tmux(1) manual

Leave a comment