Browse referenceEssential Commands
Essential Commands
Search the full tmux command reference — every command with examples, options, and keybindings. Default prefix is Ctrl+b. New to tmux? Start with core concepts to understand the fundamentals.
Showing 41 of 41 commands
Session Management
new-session
Short: new
Create a new session and attach the current terminal to it, unless -d is given. With -t, the new session joins a session group and shares its windows, while keeping its own current window.
attach-session
Short: attach, a
Attach to an existing session. If no session is specified, attach to the most recently used session. If no sessions exist, an error is reported.
detach-client
Prefix + dShort: detach
Detach the current client or the client specified by -t from its session. The session continues running in the background.
kill-session
Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it.
list-sessions
Prefix + sShort: ls
List all sessions. Each session is shown with its name, number of windows, size, and whether it is attached.
rename-session
Prefix + $Short: rename
Rename the session specified by -t, or the current session if -t is not given.
switch-client
Prefix +Short: switchc
Switch the current client to a different session.
Window Management
new-window
Prefix + cShort: neww
Create a new window. If -t is given, the new window is created at the specified index. If a shell-command is given, it is executed in the new window.
select-window
Prefix + 0-9Short: selectw
Select a window. The window becomes the current window in its session.
rename-window
Prefix +Short: renamew
Rename the current window, or the window specified by -t.
kill-window
Prefix + &Short: killw
Kill the current window or the window specified by -t, and all panes within it.
list-windows
Prefix + wShort: lsw
List windows in a session. With -a, list all windows in all sessions.
choose-tree
Prefix + sOpen an interactive tree of sessions, windows, and panes to preview and choose one. This is the picker behind the default Prefix + s (sessions) and Prefix + w (windows) bindings.
swap-window
Prefix + < then l or rShort: swapw
Swap two windows so they exchange positions. With -d the active window is not changed to follow the move.
move-window
Prefix + .Short: movew
Move a window to a new index, optionally in another session. With -r, renumber all windows in the session to remove gaps in the indexes.
respawn-window
Prefix + < then RShort: respawnw
Reuse a window to run a command, restarting it in place. Useful for windows whose command exited when remain-on-exit is on.
Pane Management
split-window
Prefix + %Short: splitw
Create a new pane by splitting the current pane. The -h flag splits horizontally (creates panes side by side), and -v splits vertically (creates panes above/below).
new-pane
Prefix + *Short: newp
Create a floating pane — a pane that sits above the tiled layout like a popup, but is not modal and behaves like a regular pane (same escape sequence support, appears in pane lists). Added in tmux 3.7 and bound to Prefix + * by default.
select-pane
Prefix + arrow keysShort: selectp
Select a pane. Various flags allow selecting panes by direction or marking them.
resize-pane
Prefix + Ctrl+arrowShort: resizep
Resize a pane, either by a specified amount or to an absolute size.
kill-pane
Prefix + xShort: killp
Destroy the current pane or the pane specified by -t.
swap-pane
Prefix + { or } to swapShort: swapp
Swap two panes. If -U is given, swap with the previous pane; if -D, swap with the next pane.
respawn-pane
Prefix + > then RShort: respawnp
Reuse a pane to run a command, restarting it in place without changing the layout. Handy for re-running a dead or crashed pane.
Copy Mode
copy-mode
Prefix + [Enter copy mode. In copy mode, you can scroll through history, search, and copy text. The mode-keys option controls whether vi or emacs keybindings are used.
paste-buffer
Prefix + ]Short: pasteb
Insert the contents of a paste buffer into the specified pane.
capture-pane
Short: capturep
Capture the contents of a pane into a paste buffer, or print them to stdout with -p. Useful for scripting, logging, or saving scrollback to a file.
clear-history
Short: clearhist
Remove and free the scrollback history for a pane. Reclaims memory used by long-running panes with large buffers.
Miscellaneous
source-file
Short: source
Execute commands from a file. This is typically used to reload the tmux configuration.
display-message
Prefix + iShort: display
Display a message in the status line. If no message is given, display information about the current pane.
set-option
Short: set
Set a session, window, or server option. Without -g, the option is set for the current session.
send-keys
Short: send
Send keys to a pane. This is useful for scripting tmux to automate commands.
list-keys
Prefix + ?Short: lsk
List all key bindings. Shows the key tables (prefix, root, copy-mode, etc.) and their bindings.
bind-key
Short: bind
Bind a key to a command. The key is bound in the prefix table by default.
display-popup
Short: popup
Open a temporary popup terminal floating above the current client, running a command (a shell by default). Great for quick tools without disturbing your layout.
display-menu
Prefix + <Short: menu
Display an interactive menu at the given position. Each item has a display name, a shortcut key, and a tmux command to run when chosen.
pipe-pane
Short: pipep
Pipe a pane's output to a shell command for live logging. With no command, any existing pipe is stopped.
set-hook
Set (or unset) a hook that runs a tmux command automatically when an event occurs, such as a session being created or a window being linked. Flags mirror set-option.
if-shell
Short: if
Run the first command if shell-command succeeds, otherwise the optional second command. With -F, no shell runs and the condition is a format that is true unless empty or zero.
run-shell
Short: run
Run a shell command (or, with -C, a tmux command) without opening a window. Any output is shown in view mode in the pane once the command finishes. Used heavily by plugins.
Server
server-access
Manage the access-control list for the tmux socket, so other users can attach read-only or read-write. The server's owner and root always have access. File-system permissions on the socket must still be set manually.
kill-server
Kill the tmux server and all clients and sessions. This is a complete shutdown of tmux.
🎨 Customize Prefix Key
The prefix key is the command that tells tmux "hey, listen to the next keypress". By default, it's Ctrl + b. Learn more about customizing this and other settings in the Configuration guide.
# Add to ~/.tmux.conf
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix