Cheat Sheet
Search and filter tmux commands
All 46 commands
tmux new -s <name>Create a new named session
tmux lsList all sessions
(Or: tmux list-sessions)
tmux attach -t <name>Attach to an existing session
(Or: tmux attach-session -t <name>)
Ctrl+b dDetach from current session
(Session continues running in background)
tmux kill-session -t <name>Kill a specific session
Ctrl+b $Rename current session
(Prompt appears at bottom)
Ctrl+b sShow all sessions (interactive)
(Navigate and press Enter to attach)
Ctrl+b cCreate a new window
(Windows are numbered starting at 0)
Ctrl+b ,Rename current window
Ctrl+b nSwitch to next window
Ctrl+b pSwitch to previous window
Ctrl+b 0-9Switch to window by number
Ctrl+b wList all windows (interactive)
Ctrl+b &Kill current window
(Confirms before killing)
Ctrl+b fFind window by name
(Search prompt appears)
Ctrl+b %Split pane vertically (left/right)
Ctrl+b "Split pane horizontally (top/bottom)
Ctrl+b oCycle to next pane
Ctrl+b arrow keysNavigate to pane in direction
(Up, Down, Left, Right)
Ctrl+b qShow pane numbers (短暂显示)
(Press number to jump to pane)
Ctrl+b zToggle zoom current pane
(Expand to fill window, toggle back)
Ctrl+b {Move pane left (swap)
Ctrl+b }Move pane right (swap)
Ctrl+b xKill current pane
(Confirms before killing)
Ctrl+b Ctrl+arrowResize pane in direction
(Hold Ctrl and press arrow repeatedly)
Ctrl+b [Enter scroll mode (copy mode)
(Use arrows or vi keys to scroll)
Ctrl+b page up/downScroll terminal output
(Without entering copy mode)
q or EscExit copy mode
Ctrl+b :Enter command mode
(Type commands at prompt)
Ctrl+b ?List all key bindings
(Press q to exit list)
Ctrl+b [Enter copy mode
Space (start selection)Begin text selection
(Starts copy mode selection)
Enter (copy selection)Copy selected text
(Also: Ctrl+w or y depending on mode)
Ctrl+b ]Paste copied text
(Paste buffer to current pane)
/ (in copy mode)Search forward
(Search prompt appears)
? (in copy mode)Search backward
n (in copy mode)Repeat search in same direction
N (in copy mode)Repeat search in opposite direction
~/.tmux.confConfiguration file location
(Create if doesn't exist)
set -g prefix C-aChange prefix key to Ctrl+a
(Add to .tmux.conf, then: source ~/.tmux.conf)
set -g mouse onEnable mouse support
(Click to select panes, drag to resize)
set -g status-bg colourSet status bar background color
(Colours: black, red, green, yellow, blue, magenta, cyan, white)
bind r source-file ~/.tmux.conf \; display 'Reloaded!'Reload config with Ctrl+b r
(Add to .tmux.conf for quick reload)
set -g base-index 1Start windows/panes at 1 instead of 0
(Makes keyboard shortcuts more ergonomic)
set -g status-keys viUse vi key bindings in command mode
setw -g mode-keys viUse vi keys in copy mode
(Default is emacs)