tmux

Default prefix key bindings (with C-b as the prefix) and CLI subcommands — sessions, windows, panes, layouts, copy mode, and more.

Sessions8 commands
C-b dDetach the current client from its session. The session keeps running in the background; reattach later with `tmux attach`.
detach-client
C-b DOpen an interactive picker of all clients attached to the server, then detach the chosen one.
choose-client
C-b sOpen an interactive tree of all sessions (with their windows expanded) to switch to. -Z zooms the picker pane.
choose-tree -Zs
C-b $Prompt for a new name for the current session, pre-filled with the existing name.
command-prompt -I "#S" "rename-session -- '%%'"
C-b (Switch the attached client to the previous session.
switch-client -p
C-b )Switch the attached client to the next session.
switch-client -n
C-b LSwitch the attached client to the last (most recently used) session.
switch-client -l
C-b C-zSuspend the tmux client itself (sends SIGTSTP). Resume with `fg` in the parent shell.
suspend-client
Windows14 commands
C-b cCreate a new window in the current session, with the user's default shell.
new-window
C-b ,Prompt for a new name for the current window, pre-filled with the existing name.
command-prompt -I "#W" "rename-window -- '%%'"
C-b &Kill the current window (and every pane in it) after a y/n confirmation.
confirm-before -p "kill-window #W? (y/n)" kill-window
C-b wOpen an interactive tree of windows across all sessions to switch to.
choose-tree -Zw
C-b fPrompt for a string, then jump to the window whose name, title, or visible content contains it.
command-prompt "find-window -Z -- '%%'"
C-b nMove to the next window in the session.
next-window
C-b pMove to the previous window in the session.
previous-window
C-b lToggle back to the most recently active window.
last-window
C-b 0 … 9Jump directly to window N (by index).
select-window -t :=N
C-b 'Prompt for a window index (useful when you have more than 10 windows).
command-prompt -p index "select-window -t ':%%'"
C-b .Prompt for a new index and move the current window to it.
command-prompt "move-window -t '%%'"
C-b M-nMove to the next window with activity (bell, content, or silence flagged).
next-window -a
C-b M-pMove to the previous window with activity.
previous-window -a
C-b iShow a short info message in the status line — by default, details about the current window.
display-message
Panes16 commands
C-b %Split the current pane horizontally — the new pane opens to the right.
split-window -h
C-b "Split the current pane vertically — the new pane opens below.
split-window
C-b ↑ ↓ ← →Move focus to the pane in the given direction relative to the current one.
select-pane -U/-D/-L/-R
C-b oCycle focus to the next pane in the current window.
select-pane -t :.+
C-b ;Toggle back to the most recently active pane.
last-pane
C-b qBriefly overlay each pane with its number — press the number to jump to that pane.
display-panes
C-b xKill the current pane after a y/n confirmation.
confirm-before -p "kill-pane #P? (y/n)" kill-pane
C-b zToggle zoom: temporarily expand the current pane to fill the entire window. Press again to restore.
resize-pane -Z
C-b !Move the current pane out of its window into a new window of its own.
break-pane
C-b {Swap the current pane with the previous one in the window's pane list.
swap-pane -U
C-b }Swap the current pane with the next one in the window's pane list.
swap-pane -D
C-b C-oRotate every pane in the current window forward through its positions.
rotate-window
C-b M-oRotate every pane in the current window backward.
rotate-window -D
C-b mMark the current pane (sets it as the target for commands like `join-pane`).
select-pane -m
C-b MClear the marked pane.
select-pane -M
C-b tShow a large clock in the current pane until any key is pressed.
clock-mode
Layouts15 commands
C-b SpaceCycle the current window through the five preset layouts (even-horizontal, even-vertical, main-horizontal, main-vertical, tiled).
next-layout
C-b M-1Apply the even-horizontal layout (panes stacked side-by-side).
select-layout even-horizontal
C-b M-2Apply the even-vertical layout (panes stacked top-to-bottom).
select-layout even-vertical
C-b M-3Apply main-horizontal: one large pane on top, smaller panes below.
select-layout main-horizontal
C-b M-4Apply main-vertical: one large pane on the left, smaller panes on the right.
select-layout main-vertical
C-b M-5Apply the tiled layout (panes arranged in a grid).
select-layout tiled
C-b ESpread the current pane and its neighbors evenly within their parent split.
select-layout -E
C-b M-↑Resize the current pane upward by 5 lines.
resize-pane -U 5
C-b M-↓Resize the current pane downward by 5 lines.
resize-pane -D 5
C-b M-←Resize the current pane leftward by 5 columns.
resize-pane -L 5
C-b M-→Resize the current pane rightward by 5 columns.
resize-pane -R 5
C-b C-↑Resize the current pane upward by 1 line. Repeatable while the prefix repeat-timer is active.
resize-pane -U
C-b C-↓Resize the current pane downward by 1 line (repeatable).
resize-pane -D
C-b C-←Resize the current pane leftward by 1 column (repeatable).
resize-pane -L
C-b C-→Resize the current pane rightward by 1 column (repeatable).
resize-pane -R
Copy16 commands
C-b [Enter copy mode — scroll the pane's history and select text to copy.
copy-mode
C-b PgUpEnter copy mode and immediately scroll up one page.
copy-mode -u
C-b ]Paste the contents of the most recent paste buffer.
paste-buffer
C-b #List every paste buffer currently held by the server.
list-buffers
C-b =Open an interactive picker of paste buffers.
choose-buffer -Z
C-b -Delete the most recent paste buffer.
delete-buffer
Space (in copy mode)emacs mode: start a selection at the cursor. vi mode users press `v` instead.
send -X begin-selection
Enter (in copy mode)emacs mode: copy the active selection to the buffer and leave copy mode. vi mode users press `y`.
send -X copy-selection-and-cancel
v (vi copy mode)vi copy mode: start a selection at the cursor.
send -X begin-selection
V (vi copy mode)vi copy mode: extend the selection to whole lines.
send -X select-line
y (vi copy mode)vi copy mode: copy the selection and leave copy mode.
send -X copy-selection-and-cancel
q (in copy mode)Leave copy mode without copying.
send -X cancel
/ (in copy mode)Search forward through the pane history.
send -X search-forward
? (in copy mode)Search backward through the pane history.
send -X search-backward
n (in copy mode)Repeat the previous search in the same direction.
send -X search-again
N (in copy mode)Repeat the previous search in the opposite direction.
send -X search-reverse
Misc5 commands
C-b ?List every key binding tmux knows about, in a scrollable pane.
list-keys
C-b :Open the command prompt at the bottom of the screen for one-off tmux commands.
command-prompt
C-b rForce-refresh the current client (redraw the screen and re-evaluate the status line).
refresh-client
C-b ~Show the most recent status-line messages.
show-messages
C-b C-bSend a literal C-b through to the running program — needed when an app inside tmux uses the same key.
send-prefix
CLI31 commands
tmuxRun tmux. With no command, starts a new server (if needed) and creates a new session.
tmux [-2CDluvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [-T features] [command [flags]]
tmux newCreate a new session. -d starts detached; -A attaches to an existing session of the same name (or creates it); -s names the session.
tmux new-session [-AdDEPX] [-c start-directory] [-F format] [-n window-name] [-s session-name] [-x width] [-y height] [shell-command]
tmux attachAttach to an existing session. -d detaches every other client first; -t selects a specific session by name.
tmux attach-session [-dErx] [-c working-directory] [-f flags] [-t target-session]
tmux lsList every session on the server, one per line.
tmux list-sessions [-F format] [-f filter]
tmux kill-sessionDestroy a session and every window inside it. -a kills all sessions except the target.
tmux kill-session [-aC] [-t target-session]
tmux kill-serverShut down the tmux server entirely — every session, window, and pane is destroyed.
tmux kill-server
tmux has-sessionExit 0 if the session exists, non-zero otherwise. Useful in scripts as a guard before attach/new.
tmux has-session [-t target-session]
tmux switch-clientSwitch the given client to a different session (or session/window/pane).
tmux switch-client [-ElnprZ] [-c target-client] [-t target-session] [-T key-table]
tmux detachDetach a client from its session (the session keeps running).
tmux detach-client [-aP] [-E shell-command] [-s target-session] [-t target-client]
tmux new-windowCreate a new window in the target session. -a inserts after the current window; -d creates without switching.
tmux new-window [-abdkPS] [-c start-directory] [-e env] [-F format] [-n window-name] [-t target-window] [shell-command]
tmux kill-windowKill a window and every pane in it. -a kills all windows except the target.
tmux kill-window [-a] [-t target-window]
tmux rename-windowRename a window.
tmux rename-window [-t target-window] new-name
tmux split-windowSplit a pane into two. -h for horizontal (side-by-side), -v for vertical (top-bottom). -l sets the new pane's size.
tmux split-window [-bdfhIvPZ] [-c start-directory] [-e env] [-l size] [-t target-pane] [shell-command]
tmux select-paneActivate a different pane. -L/-R/-U/-D move by direction; -t targets a specific pane.
tmux select-pane [-DdegLlMmRUZ] [-T title] [-t target-pane]
tmux resize-paneResize a pane. Direction flags (-D/-L/-R/-U) plus an optional adjustment; -Z toggles zoom.
tmux resize-pane [-DLMRTUZ] [-t target-pane] [-x width] [-y height] [adjustment]
tmux kill-paneKill a pane. -a kills every pane in the window except the target.
tmux kill-pane [-a] [-t target-pane]
tmux send-keysSend one or more keys to a pane as if typed. -l sends them literally (no key-name lookup).
tmux send-keys [-FHKlMRX] [-N repeat-count] [-t target-pane] key ...
tmux capture-paneCapture a pane's contents into a buffer. -p prints to stdout; -S/-E pick a history range.
tmux capture-pane [-aepPqCJN] [-b buffer-name] [-E end-line] [-S start-line] [-t target-pane]
tmux pipe-panePipe a pane's output to a shell command for live logging. Calling again with no command stops piping.
tmux pipe-pane [-IOo] [-t target-pane] [shell-command]
tmux display-messageShow a status-line message (or print one with -p). Format placeholders like #{session_name} are expanded.
tmux display-message [-aIlNpv] [-c target-client] [-d delay] [-t target-pane] [message]
tmux list-keysList every key binding, optionally filtered by key-table.
tmux list-keys [-1aN] [-P prefix-string] [-T key-table] [key]
tmux list-commandsList every tmux command (or describe a single one).
tmux list-commands [-F format] [command]
tmux list-windowsList windows in a session (-a for every session).
tmux list-windows [-aF format] [-f filter] [-t target-session]
tmux list-panesList panes in a window, session (-s), or every session (-a).
tmux list-panes [-as] [-F format] [-f filter] [-t target]
tmux set-optionSet a tmux option. -g for server-global, -w for window-level, -p for pane-level. -u unsets.
tmux set-option [-aFgopqsuUw] [-t target-pane] option [value]
tmux show-optionsShow one or all options. Pairs with set-option's -g/-w/-p scopes.
tmux show-options [-AgHpqsvw] [-t target-pane] [option]
tmux bind-keyBind a key to a tmux command. -n binds without the prefix; -r marks the binding as repeatable.
tmux bind-key [-nr] [-N note] [-T key-table] key command [arguments]
tmux unbind-keyRemove a key binding. -a removes every binding in the table.
tmux unbind-key [-anq] [-T key-table] key
tmux source-fileExecute the commands in a file — typically used to reload ~/.tmux.conf after editing.
tmux source-file [-Fnqv] path ...
tmux choose-treeOpen the interactive session/window picker in a pane (the same one that C-b s and C-b w use).
tmux choose-tree [-GNrswZ] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template]
tmux start-serverStart the tmux server without creating any sessions. Useful in scripts that will then attach.
tmux start-server