Reference · tmux 3.8 · 92 commands
tmux commands: the complete reference
tmux 3.8 has 92 commands. You can run each one three ways: from your shell as tmux command, from inside tmux after Ctrl+b :, or from a key binding. Start with the 15 below; every command with all its flags is in the searchable list further down.
Search all 92 commands ↓ How -t targets work Key bindings cheat sheet
On this page
- The 15 main tmux commands you will actually use
- Targets: how -t session:window.pane works
- Session commands
- Window commands (tabs)
- Pane commands
- Key binding commands
- Copy mode and buffer commands
- Server, option and info commands
- Scripting commands
- tmux CLI: command-line flags
- All 92 tmux commands
- tmux command aliases
- Frequently asked questions
- Where to go next
Quick answer
How do I list every tmux command?
tmux list-commands
attach-session (attach) [-dErx] [-c working-directory] [-f flags] [-t target-session]
bind-key (bind) [-nr] [-T key-table] [-N note] key [command [argument ...]]
…
tmux list-commands split-windowtmux list-commands (short: tmux lscm) prints every command your version supports, with its alias and flags. Give it a name to see one command. For key bindings run tmux list-keys, or press Ctrl+b ? inside tmux. The full manual is man tmux, explained on our man page guide.
The 15 main tmux commands you will actually use
These cover almost all day-to-day work. Each one also has a default key, where shown, so inside tmux you rarely type them; they matter in scripts, in your config and when you are outside tmux.
| # | Command | Long name | What it does |
|---|---|---|---|
| 1 | tmux new -s work | new-session | Start a session named work and attach to it |
| 2 | tmux ls | list-sessions | List running sessions |
| 3 | tmux attach -t work | attach-session | Attach to work; plain tmux a attaches to the last one |
| 4 | tmux detach | detach-client | Detach and leave everything running (Ctrl+b d) |
| 5 | tmux kill-session -t work | kill-session | End one session and its programs |
| 6 | tmux kill-server | kill-server | End every session and stop tmux |
| 7 | tmux new-window -n logs | new-window | Open a window named logs (Ctrl+b c) |
| 8 | tmux split-window -h | split-window | Split side by side (Ctrl+b %); -v splits top and bottom (Ctrl+b ") |
| 9 | tmux select-pane -L | select-pane | Move to the pane on the left (Ctrl+b ←); -R -U -D for the others |
| 10 | tmux resize-pane -R 10 | resize-pane | Move the pane's right edge 10 cells (Ctrl+b Ctrl+→ moves 1) |
| 11 | tmux rename-window logs | rename-window | Rename the current window (Ctrl+b ,) |
| 12 | tmux send-keys -t work:0.1 'npm test' Enter | send-keys | Type a command into another pane |
| 13 | tmux capture-pane -p -t work:0.1 | capture-pane | Print what a pane is showing |
| 14 | tmux source-file ~/.tmux.conf | source-file | Reload your config |
| 15 | tmux set -g mouse on | set-option | Change an option for all sessions (mouse is already on in 3.8) |
Commands can be shortened: new, ls and set are official aliases, and any unique start of a name also works (tmux a, tmux kill-ses). An ambiguous one such as tmux s fails with ambiguous command: s, could be: ….
Three ways to run a command
From your shell
tmux kill-session -t old
tmux new-window \; split-window -hPrefix it with tmux. Join several with \; (escaped so your shell passes it to tmux). Works inside or outside tmux.
From the tmux prompt
:kill-session -t oldPress Ctrl+b :, type the command without tmux and press Enter. Tab completes names.
The third way is a key binding in ~/.tmux.conf, for example bind K kill-session, which is just a command attached to a key; see key binding commands.
Targets: how -t session:window.pane works
Quick answer
How do I point a tmux command at a specific pane?
Add -t session:window.pane. For example tmux send-keys -t work:editor.1 'ls' Enter types into pane 1 of the window named editor in session work. Commands that move things take a source with -s and a destination with -t.
Each part can be written several ways. tmux tries them in a fixed order: for a session it tries the $ ID, then the exact name, then the start of a name, then a glob pattern; for a window, a special token, then the index, the @ ID, the exact name, the start of a name and a pattern. That is why -t wor finds a session called work, while -t =wor fails with can't find session: wor.
| Target | Means | Example |
|---|---|---|
work | Session by name (or the start of one) | tmux attach -t work |
=work | Exact name only, no prefix matching | tmux has-session -t =work |
work:2 / work:logs | Window by index or name | tmux select-window -t work:2 |
work:2.1 | Pane 1 in that window | tmux kill-pane -t work:2.1 |
:3 / :.1 | Window 3 / pane 1 in the current session or window | tmux select-pane -t :.1 |
$0 @3 %7 | Session, window and pane IDs: unique, never reused while the server runs | tmux send-keys -t %7 q |
{last} or ! | The previous window, or the previous pane after a . | tmux select-window -t '{last}' |
{next} {previous} or + - | Next or previous by number, with an optional offset | tmux select-window -t :+2 |
{start} {end} or ^ $ | Lowest or highest numbered window | tmux select-window -t 'work:{end}' |
{top-right}, {left}, {bottom}… | Pane by position in the window | tmux select-pane -t '.{top-right}' |
{marked} or ~ | The pane you marked with Ctrl+b m | tmux join-pane -s '{marked}' |
Quote tokens that contain braces, ! or $ so your shell leaves them alone. To see the IDs, run tmux list-panes -a -F '#{session_name}:#{window_name}.#{pane_index} #{session_id} #{window_id} #{pane_id}':

How this was captured
Captured 2026-10-28 18:06 UTC from a real xterm window running tmux 3.8 on Ubuntu 24.04. Nothing is mocked up. The commands that set up the screen:
# ~/.tmux.conf for this capture: set-hook -g client-attached 'command-prompt -I "select-pane -t work:editor.1"'
tmux new-session -d -s work -n editor -x 110 -y 25
tmux new-window -d -t work -n logs
tmux new-session -d -s api -n server
tmux split-window -h -t work:editor
tmux select-pane -t work:editor.0
tmux send-keys -t work:editor.0 'clear; tmux list-panes -a -F '"'"'#{session_name}:#{window_name}.#{pane_index} #{session_id} #{window_id} #{pane_id}'"'"'' Enter
tmux send-keys -t work:editor.1 'clear; tmux display -p -t "$TMUX_PANE" '"'"'this pane: #{session_name}:#{window_name}.#{pane_index} = #{pane_id}'"'"'' Enter
tmux attach -t work # the hook opens the command prompt, as prefix : doesSession commands
tmux new -s work -d # create in the background
tmux new -A -s work # attach if it exists, else create
tmux ls
work: 1 windows (created Wed Oct 28 09:14:02 2026)
tmux ls -F '#{session_name} #{session_windows}'
work 1
tmux attach -t work -d # attach, detaching anyone else
tmux rename-session -t work dev
tmux has-session -t dev && echo running
running
tmux kill-session -t dev
tmux kill-session -a # all sessions except the current one
tmux kill-server # everything| Command | Alias | Key | Use it to |
|---|---|---|---|
| new-session | new | Create a session (-s name, -d detached, -c start directory) | |
| list-sessions | ls | List sessions, optionally with a -F format | |
| attach-session | attach | Attach to a session (-d detaches other clients) | |
| detach-client | detach | Ctrl+b d | Detach a client |
| switch-client | switchc | Ctrl+b s | Move your client to another session (-l last, -n/-p next/previous) |
| rename-session | rename | Ctrl+b $ | Rename a session |
| has-session | has | Exit 0 if a session exists (for scripts) | |
| kill-session | End a session (-a: all others) | ||
| kill-server | End all sessions and the server |
Step-by-step help, including nested sessions and the no server running and sessions should be nested with care messages, is in the sessions guide.
Window commands (tabs)
tmux new-window -t work -n logs # new window named logs
tmux new-window -t work:5 -n db # at index 5
tmux rename-window -t work:logs tail
tmux select-window -t work:0
tmux swap-window -s work:1 -t work:2
tmux move-window -s work:5 -t work:3 # move to another index (or session)
tmux move-window -r -t work # renumber 0, 1, 2… with no gaps
tmux list-windows -t work -F '#I:#W'
0:editor
1:db
2:tail
tmux kill-window -t work:2| Command | Alias | Key | Use it to |
|---|---|---|---|
| new-window | neww | Ctrl+b c | Create a window (-n name, -c directory) |
| select-window | selectw | Ctrl+b 0…9 | Go to a window |
| next-window / previous-window | next / prev | Ctrl+b n Ctrl+b p | Cycle windows |
| last-window | last | Ctrl+b l | Go back to the previous window |
| rename-window | renamew | Ctrl+b , | Rename a window |
| list-windows | lsw | Ctrl+b w | List windows (-a: in every session) |
| move-window / swap-window | movew / swapw | Ctrl+b . | Reorder or renumber windows |
| kill-window | killw | Ctrl+b & | Close a window and its panes |
| switch-mode | Ctrl+b Tab | Fuzzy window or session switcher new in 3.8 |
Pane commands
tmux split-window -h -c "#{pane_current_path}" # side by side, same directory
tmux split-window -v -l 30% # below, 30% high
tmux select-pane -t :.1 # pane 1 here
tmux resize-pane -R 10 # right edge 10 cells right
tmux resize-pane -Z # zoom (fullscreen) on / off
tmux swap-pane -s :.1 -t :.2
tmux break-pane -d -s work:editor.1 -t work: -n side # pane to its own window
tmux join-pane -h -s work:side -t work:editor # and back again
tmux select-layout tiled
tmux kill-pane -t :.1
tmux list-panes -F '#P #{pane_width}x#{pane_height}'
0 60x40
1 59x40| Command | Alias | Key | Use it to |
|---|---|---|---|
| split-window | splitw | Ctrl+b % Ctrl+b " | Split a pane (-h side by side, -v stacked, -l size) |
| select-pane | selectp | Ctrl+b ↑ … | Go to (focus) a pane; -T sets its title, -m marks it |
| resize-pane | resizep | Ctrl+b Ctrl+↑ … | Resize (-L -R -U -D cells, -x -y size, -Z zoom) |
| swap-pane / rotate-window | swapp / rotatew | Ctrl+b { Ctrl+b } | Swap or rotate panes |
| break-pane / join-pane | breakp / joinp | Ctrl+b ! | Move a pane out to a window, or into another window |
| select-layout | selectl | Ctrl+b Space | Apply a layout: tiled, even-horizontal, main-vertical… |
| kill-pane | killp | Ctrl+b x | Close a pane (-a: all others) |
| respawn-pane | respawnp | Restart a pane's program; -k kills a stuck one first | |
| new-pane | newp | Ctrl+b * | Floating pane new in 3.7 |
tmux's -h means a horizontal layout of panes, side by side, which many people call a vertical split. How to split, resize, zoom, join and synchronize panes is explained step by step in the panes and windows guide; floating panes have their own floating panes guide.
Key binding commands
tmux list-keys -N # every binding with a note
tmux list-keys -T copy-mode-vi # one key table
tmux bind-key -T prefix F5 display-message hi
tmux bind -n M-h select-pane -L # -n: no prefix needed
tmux unbind -n M-h
tmux send-keys -t work:0.1 'make' Enter # type into a pane
tmux send-prefix # send the prefix key itselfbind-key (bind) adds a binding to a key table: prefix by default, root with -n (no prefix), or a copy mode table with -T copy-mode-vi; -r makes it repeatable. unbind-key (unbind) removes one, and list-keys (lsk) shows them. Bindings made on the command line last until the server stops; put them in ~/.tmux.conf to keep them. Every default key is on the cheat sheet, and writing your own is covered in the config guide.
Copy mode and buffer commands
tmux copy-mode -t work:0.0 # enter copy mode (prefix [)
tmux send-keys -t work:0.0 -X cancel # copy mode commands use send-keys -X
tmux set-buffer 'copied text'
tmux list-buffers
buffer0: 11 bytes: "copied text"
tmux save-buffer ~/clip.txt # newest buffer to a file
tmux load-buffer ~/clip.txt
tmux paste-buffer -t work:0.1 # prefix ]
tmux capture-pane -p -J -S - -t work:0.0 > pane.txt # whole history to a file| Command | Alias | Key | Use it to |
|---|---|---|---|
| copy-mode | Ctrl+b [ | Scroll back, search and select (-u starts one page up) | |
| paste-buffer | pasteb | Ctrl+b ] | Paste a buffer into a pane |
| choose-buffer | Ctrl+b = | Pick a buffer from a list | |
| list-buffers / show-buffer | lsb / showb | Ctrl+b # | See what is in the buffers |
| set-buffer / delete-buffer | setb / deleteb | Ctrl+b - | Create or delete a buffer |
| save-buffer / load-buffer | saveb / loadb | Buffer to or from a file | |
| capture-pane | capturep | Copy a pane's text (-p print, -S - from the start of history, -J join wrapped lines) | |
| clear-history | clearhist | Delete a pane's scrollback |
The keys used inside copy mode, mouse selection and the system clipboard are on the scroll and copy mode page.
Server, option and info commands
tmux -V
tmux 3.8
tmux source-file ~/.tmux.conf # reload config (prefix : source ~/.tmux.conf)
tmux set -g history-limit 50000 # session option, all sessions
tmux setw -g mode-keys vi # window option
tmux show -gv history-limit
50000
tmux show -g | grep status # browse options (or prefix C)
tmux display -p '#{session_name}:#{window_index}.#{pane_index}'
work:0.0
tmux list-clients # who is attached
tmux show-messages # message log (prefix ~)
tmux run-shell 'date' # run a shell command, print its outputset-option (set) changes options: -g for the global value, -s for server options, -w (or setw) for window options, -u to reset one to its default. show-options (show) reads them. display-message -p prints any format, which makes it the quickest way to ask tmux a question. All options and their 3.8 defaults are in the config reference.
Scripting commands
#!/bin/sh
# Build a workspace once, then reattach on later runs.
tmux has-session -t dev 2>/dev/null || {
tmux new-session -d -s dev -n editor -c ~/project
tmux send-keys -t dev:editor 'nvim .' Enter
tmux split-window -h -t dev:editor -c ~/project
tmux send-keys -t dev:editor.1 'npm run dev' Enter
tmux new-window -t dev -n logs
}
tmux attach -t devScripts use the same commands with explicit targets. The ones you need most: has-session to test for a session, send-keys to type (-l sends text literally), capture-pane to read output, if-shell and run-shell to branch and run shell code, and wait-for to wait for a signal from another command. Formats, hooks, control mode (tmux -C) and libraries such as libtmux are covered in tmux scripting and automation.
tmux CLI: command-line flags
These flags go before the command (tmux -L work new, not tmux new -L work). The full synopsis on 3.8 is tmux [-2CDhlNuVv] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [-T features] [command [flags]].
| Flag | What it does | Example |
|---|---|---|
-V | Print the tmux version and exit | tmux -V prints tmux 3.8 |
-L name | Use a separate server with its own socket name, so its sessions are independent of your normal ones | tmux -L test new |
-S path | Use a socket at a full path (ignores -L); used to share a session with another user | tmux -S /tmp/pair new |
-f file | Load this config instead of ~/.tmux.conf; -f /dev/null starts with defaults | tmux -f /dev/null new |
-C, -CC | Control mode: text protocol for programs. -CC disables echo; iTerm2 uses it for native tmux windows | tmux -CC attach |
-u | Send UTF-8 to the terminal even if the locale variables do not say UTF-8 | tmux -u attach |
-2 | Assume the terminal supports 256 colors (same as -T 256) | tmux -2 |
-T features | Set terminal features for this client, comma separated | tmux -T RGB,mouse attach |
-N | Do not start a server if none is running | tmux -N ls |
-D | Run the server in the foreground, not as a daemon (for service managers); no command allowed | tmux -D |
-c command | Run a shell command with tmux's default shell, for using tmux as a login shell | tmux -c 'echo hi' |
-v | Write debug logs (tmux-server-PID.log, tmux-client-PID.log) in the current directory | tmux -vv new |
-l | Behave as a login shell; currently has no effect | |
-h | Print the usage line and exit | tmux -h |
With no command at all, tmux runs the default-client-command option, which is new-session. Control mode for iTerm2 is explained on iTerm2 and tmux -CC, and shared sockets on pair programming.
All 92 tmux commands
Every command in tmux 3.8, with its usage line exactly as tmux list-commands prints it and a summary from the manual. Square brackets mark optional flags; new-pane (3.7) and switch-mode (3.8) do not exist on older versions, which have 90 or fewer. Type to filter by name, alias or description; press / to jump to the box.
Source: tmux list-commands on tmux 3.8, grouped by the man page section that documents each command
Show the data
Clients & sessions commands 19
attach-session
alias attachGuide →attach-session [-dErx] [-c working-directory] [-f flags] [-t target-session]
If run from outside tmux, attach to target-session in the current terminal. target-session must already exist - to create a new session, see the new-session command (with -A to create or attach). If used from inside, switch the currently attached session to target-session.
detach-client
alias detachGuide →detach-client [-aP] [-E shell-command] [-s target-session] [-t target-client]
Detach the current client if bound to a key, the client specified with -t, or all clients currently attached to the session specified by -s. The -a option kills all but the client given with -t. If -P is given, send SIGHUP to the parent process of the client, typically causing it to exit.
has-session
alias hashas-session [-t target-session]
Report an error and exit with 1 if the specified session does not exist. If it does exist, exit with 0.
kill-server
kill-server
Kill the tmux server and clients and destroy all sessions.
kill-session
Guide →kill-session [-aCg] [-f filter] [-t target-session]
Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it. If -a is given, all sessions but the specified one is killed. When -a is given, -f specifies a filter.
list-clients
alias lsclist-clients [-F format] [-f filter] [-O order][-t target-session]
List all clients attached to the server. -F specifies the format of each line and -f a filter. Only clients for which the filter is true are shown.
list-commands
alias lscmlist-commands [-F format] [command]
List the syntax of command or - if omitted - of all commands supported by tmux.
list-sessions
alias lsGuide →list-sessions [-r] [-F format] [-f filter] [-O order]
List all sessions managed by the server. -F specifies the format of each line and -f a filter. Only sessions for which the filter is true are shown.
lock-client
alias lockclock-client [-t target-client]
Lock target-client, see the lock-server command.
lock-session
alias lockslock-session [-t target-session]
Lock all clients attached to target-session.
new-session
alias newGuide →new-session [-AdDEPX] [-c start-directory] [-e environment] [-F format] [-f flags] [-n window-name] [-s session-name] [-t target-session] [-x width] [-y height] [shell-command [argument ...]]
window-name] [-s session-name] [-t group-name] [-x width] [-y height] [shell-command [argument .]] Create a new session with name session-name.
refresh-client
alias refreshrefresh-client [-cDlLRSU] [-A pane:state] [-B name:what:format] [-C XxY] [-f flags] [-r pane:report] [-t target-client] [adjustment]
pane:report] [-t target-client] [adjustment] Refresh the current client if bound to a key, or a single client if one is given with -t. If -S is specified, only update the client's status line.
rename-session
alias renameGuide →rename-session [-t target-session] new-name
Rename the session to new-name.
server-access
server-access [-adglrw] [-t target-pane] [user|group]
Change the access or read/write permission of user or group. The user running the tmux server (its owner) and the root user cannot be changed and are always permitted access. -g changes a group rather than a user.
show-messages
alias showmsgsshow-messages [-JT] [-t target-client]
Show server messages or information. Messages are stored, up to a maximum of the limit set by the message-limit server option. -J and -T show debugging information about jobs and terminals.
source-file
alias sourceGuide →source-file [-Fnqv] [-t target-pane] path ...
Execute commands from one or more files specified by path (which may be glob(7) patterns). If -F is present, then path is expanded as a format. If -q is given, no error will be returned if path does not exist.
start-server
alias startstart-server
Start the tmux server, if not already running, without creating any sessions.
suspend-client
alias suspendcsuspend-client [-t target-client]
Suspend a client by sending SIGTSTP (tty stop).
switch-client
alias switchcswitch-client [-ElnprZ] [-c target-client] [-t target-session] [-T key-table] [-O order]
Switch the current session for client target-client to target-session. As a special case, -t may refer to a pane (a target that contains ‘:’, ‘.’ or ‘%’), to change session, window and pane.
Windows & panes commands 39
break-pane
alias breakpbreak-pane [-abdPW] [-F format] [-n window-name] [-s src-pane] [-t dst-window] [-x width] [-y height] [-X x-position] [-Y y-position]
height] [-X x-position] [-Y y-position] Break src-pane off from its containing window to make it the only pane in dst-window. With -a or -b, the window is moved to the next index after or before (existing windows are moved if necessary). If -d is given, the new window does not become the current window.
capture-pane
alias capturepGuide →capture-pane [-aCeFHIJLMNpPqRT] [-b buffer-name] [-E end-line] [-S start-line] [-t target-pane]
Capture the contents of a pane. If -p is given, the output goes to stdout, otherwise to the buffer specified with -b or a new buffer if omitted. If -a is given, the alternate screen is used, and the history is not accessible.
choose-client
choose-client [-hikNrZ] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template]
target-pane] [template] Put a pane into client mode, allowing a client to be selected interactively from a list. Each client is shown on one line. A shortcut key is shown on the left in brackets allowing for immediate choice, or the list may be navigated and an item chosen or otherwise manipulated using the keys below.
choose-tree
choose-tree [-GhkNrswZ] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template]
target-pane] [template] Put a pane into tree mode, where a session, window or pane may be chosen interactively from a tree. Each session, window or pane is shown on one line. A shortcut key is shown on the left in brackets allowing for immediate choice, or the tree may be navigated and an item chosen or otherwise manipulated using the keys below.
copy-mode
Guide →copy-mode [-dekHMqSu] [-s src-pane] [-t target-pane]
customize-mode
customize-mode [-kNZ] [-F format] [-f filter] [-t target-pane]
Put a pane into customize mode, where options and key bindings may be browsed and modified from a list. Option values in the list are shown for the active pane in the current window. -Z zooms the pane.
display-panes
alias displaypdisplay-panes [-kNZ] [-d duration] [-s source-window] [-t target-pane] [template]
Put target-pane into panes mode, which displays a preview of the window and a visible indicator of each pane. If -s is given, the panes in source-window are displayed instead of those in the window containing target-pane. See the display-panes-colour, display-panes-active-colour, display-panes-border-style, display-panes-format and display-panes-time window options.
find-window
alias findwfind-window [-CiNrTZ] [-t target-pane] match-string
Search for a glob(7) pattern or, with -r, regular expression match-string in window names, titles, and visible content (but not history). The flags control matching behavior: -C matches only visible window contents, -N matches only the window name and -T matches only the window title. -i makes the search ignore case.
join-pane
alias joinpjoin-pane [-bdfhv] [-l size] [-s src-pane] [-t dst-pane]
Like split-window, but instead of splitting dst-pane and creating a new pane, split it and move src-pane into the space. This can be used to reverse break-pane. The -b option causes src-pane to be joined to left of or above dst-pane.
kill-pane
alias killpGuide →kill-pane [-a] [-f filter] [-t target-pane]
Destroy the given pane. If no panes remain in the containing window, it is also destroyed. The -a option kills all panes in the window except the pane given with -t.
kill-window
alias killwGuide →kill-window [-a] [-f filter] [-t target-window]
Kill the current window or the window at target-window, removing it from any sessions to which it is linked. The -a option kills all windows in the session except the window given with -t. When -a is given, -f specifies a filter.
last-pane
alias lastplast-pane [-deZ] [-t target-window]
Select the last (previously selected) pane. -Z keeps the window zoomed if it was zoomed. -e enables or -d disables input to the pane.
last-window
alias lastlast-window [-t target-session]
Select the last (previously selected) window. If no target-session is specified, select the last window of the current session.
link-window
alias linkwlink-window [-abdk] [-s src-window] [-t dst-window]
Link the window at src-window to the specified dst-window. If dst-window is specified and no such window exists, the src-window is linked there. With -a or -b the window is moved to the next index after or before dst-window (existing windows are moved if necessary).
list-panes
alias lsplist-panes [-asr] [-F format] [-f filter] [-O order][-t target-window]
If -a is given, target is ignored and all panes on the server are listed. If -s is given, target is a session (or the current session). If neither is given, target is a window (or the current window).
list-windows
alias lswlist-windows [-ar] [-F format] [-f filter] [-O order][-t target-session]
If -a is given, list all windows on the server. Otherwise, list windows in the current session or in target-session. -F specifies the format of each line and -f a filter.
move-pane
alias movepmove-pane [-bdfhMv] [-D lines] [-l size] [-L columns] [-P position] [-R columns] [-s src-pane] [-t dst-pane] [-U lines] [-X x-position] [-Y y-position] [-z z-index]
src-pane] [-t dst-pane] [-U [lines]] [-X x-position] [-Y y-position] [-z z-index] Does the same as join-pane, except if given -D, -L, -P, -R, -U, -X, -Y or -z in which case move the target floating pane. -D, -L, -R and -U move it down, left, right or up by lines or columns (one if omitted). -P moves it to position, which may be one of:
move-window
alias movewmove-window [-abdkr] [-s src-window] [-t dst-window]
This is similar to link-window, except the window at src-window is moved to dst-window. With -r, all windows in the session are renumbered in sequential order, respecting the base-index option.
new-pane
alias newpnew in 3.7Guide →new-pane [-AbCDefhIkKLMOPvWZ] [-B border-lines] [-c start-directory] [-e environment] [-F format] [-l size] [-m message] [-p percentage] [-s style] [-S active-border-style] [-R inactive-border-style] [-T title] [-x width] [-y height] [-X x-position] [-Y y-position] [-t target-pane] [shell-command [argument ...]]
format] [-l size] [-m message] [-p percentage] [-R inactive-border-style] [-s style] [-S active-border-style] [-t target-pane] [-T title] [-x width] [-y height] [-X x-position] [-Y y-position] [shell-command [argument .]] Creates a new floating pane. The -x and -y options set the width and height of the floating pane in columns and lines respectively.
new-window
alias newwGuide →new-window [-abdEkPS] [-c start-directory] [-e environment] [-F format] [-n window-name] [-t target-window] [shell-command [argument ...]]
target-window] [shell-command [argument .]] Create a new window. With -a or -b, the new window is inserted at the next index after or before the specified target-window, moving windows up if necessary; otherwise target-window is the new window location.
next-layout
alias nextlnext-layout [-t target-window]
Move a window to the next layout and rearrange the panes to fit.
next-window
alias nextnext-window [-a] [-t target-session]
Move to the next window in the session. If -a is used, move to the next window with an alert.
pipe-pane
alias pipeppipe-pane [-IOo] [-t target-pane] [shell-command]
Pipe output sent by the program in target-pane to a shell command or vice versa. A pane may only be connected to one command at a time, any existing pipe is closed before shell-command is executed. The shell-command string may contain the special character sequences supported by the status-left option.
previous-layout
alias prevlprevious-layout [-t target-window]
Move to the previous layout in the session.
previous-window
alias prevprevious-window [-a] [-t target-session]
Move to the previous window in the session. With -a, move to the previous window with an alert.
rename-window
alias renamewGuide →rename-window [-t target-window] new-name
Rename the current window, or the window at target-window if specified, to new-name.
resize-pane
alias resizepGuide →resize-pane [-MTZ] [-D lines] [-L columns] [-R columns] [-U lines] [-x width] [-y height] [-t target-pane]
target-pane] Resize a pane, up, down, left or right by a specified adjustment with -U, -D, -L or -R; or to an absolute size with -x or -y. The adjustment is given in lines or columns (the default is 1); -x and -y may be a given as a number of lines or columns or followed by ‘%’ for a percentage of the window size (for example ‘-x 10%’). If target-pane is floating, -U, -D, -L, and -R target their respective borders, and negative values may be given.
resize-window
alias resizewresize-window [-aADLRU] [-x width] [-y height] [-t target-window] [adjustment]
Resize a window, up, down, left or right by adjustment with -U, -D, -L or -R, or to an absolute size with -x or -y. The adjustment is given in lines or cells (the default is 1). -A sets the size of the largest session containing the window; -a the size of the smallest.
respawn-pane
alias respawnprespawn-pane [-Ek] [-c start-directory] [-e environment] [-t target-pane] [shell-command [argument ...]]
[argument .]] Reactivate a pane in which the command has exited (see the remain-on-exit window option). If shell-command is not given, the command used when the pane was created or last respawned is executed.
respawn-window
alias respawnwrespawn-window [-Ek] [-c start-directory] [-e environment] [-t target-window] [shell-command [argument ...]]
[argument .]] Reactivate a window in which the command has exited (see the remain-on-exit window option). If shell-command is not given, the command used when the window was created or last respawned is executed.
rotate-window
alias rotatewrotate-window [-DUZ] [-t target-window]
select-layout
alias selectlselect-layout [-Enop] [-t target-pane] [layout-name]
Choose a specific layout for a window. If layout-name is not given, the last preset layout used (if any) is reapplied. -n and -p are equivalent to the next-layout and previous-layout commands.
select-pane
alias selectpGuide →select-pane [-DdeLlMmRUZ] [-T title] [-t target-pane]
Make pane target-pane the active pane in its window. If one of -D, -L, -R, or -U is used, respectively the pane below, to the left, to the right, or above the target pane is used. -Z keeps the window zoomed if it was zoomed.
select-window
alias selectwselect-window [-lnpT] [-t target-window]
Select the window at target-window. -l, -n and -p are equivalent to the last-window, next-window and previous-window commands. If -T is given and the selected window is already the current window, the command behaves like last-window.
split-window
alias splitwGuide →split-window [-bdefhIklPvWZ] [-B border-lines] [-c start-directory] [-e environment] [-F format] [-l size] [-m message] [-p percentage] [-s style] [-S active-border-style] [-R inactive-border-style] [-T title] [-t target-pane] [shell-command [argument ...]]
swap-pane
alias swappGuide →swap-pane [-dDUZ] [-s src-pane] [-t dst-pane]
Swap two panes. If -U is used and no source pane is specified with -s, dst-pane is swapped with the previous pane (before it numerically); -D swaps with the next pane (after it numerically). -d instructs tmux not to change the active pane and -Z keeps the window zoomed if it was zoomed.
swap-window
alias swapwswap-window [-d] [-s src-window] [-t dst-window]
This is similar to link-window, except the source and destination windows are swapped. It is an error if no window exists at src-window. If -d is given, the new window does not become the current window.
switch-mode
new in 3.8switch-mode [-kswZ] [-F format] [-t target-pane] [command]
Put a pane into switch mode, where a session or window may be chosen interactively from a list. Each session or window is shown on one line and the list is narrowed by typing: the typed text is matched against each item with fuzzy matching and only matching items are shown, sorted by how well they match. -s lists sessions (the default) and -w lists windows.
unlink-window
alias unlinkwunlink-window [-k] [-t target-window]
Unlink target-window. Unless -k is given, a window may be unlinked only if it is linked to multiple sessions - windows may not be linked to no sessions; if -k is specified and the window is linked to only one session, it is unlinked and destroyed.
Key bindings commands 5
bind-key
alias bindGuide →bind-key [-nr] [-T key-table] [-N note] key [command [argument ...]]
Bind key key to command. Keys are bound in a key table. By default (without -T), the key is bound in the prefix key table.
list-keys
alias lsklist-keys [-1aNr] [-F format] [-O order] [-P prefix-string][-T key-table] [key]
List key bindings. -F specifies the format of each line. See the FORMATS section.
send-keys
alias sendGuide →send-keys [-FHKlMRX] [-c target-client] [-N repeat-count] [-t target-pane] [key ...]
Send a key or keys to a window or client. Each argument key is the name of the key (such as ‘C-a’ or ‘NPage’) to send; if the string is not recognised as a key, it is sent as a series of characters. If -K is given, keys are sent to target-client, so they are looked up in the client's key table, rather than to target-pane.
send-prefix
send-prefix [-2] [-t target-pane]
Send the prefix key, or with -2 the secondary prefix key, to a window as if it was pressed.
unbind-key
alias unbindunbind-key [-anq] [-T key-table] key
Unbind the command bound to key. -n and -T are the same as for bind-key. If -a is present, all key bindings are removed.
Options commands 2
set-option
alias setGuide →set-option [-aFgopqsuUw] [-t target-pane] option [value]
show-options
alias showshow-options [-AgHpqsvw] [-F format] [-t target-pane] [option]
Status line, prompts & menus commands 6
clear-prompt-history
alias clearphistclear-prompt-history [-T prompt-type]
Clear status prompt history for prompt type prompt-type. If -T is omitted, then clear history for all types. See command-prompt for possible values for prompt-type.
command-prompt
command-prompt [-1CbeFiklNP] [-I inputs] [-p prompts] [-t target-client] [-T prompt-type] [template]
[template] Open the command prompt in a client. This may be used from inside tmux to execute commands interactively.
confirm-before
alias confirmconfirm-before [-by] [-c confirm-key] [-p prompt] [-t target-client] command
Ask for confirmation before executing command. If -p is given, prompt is the prompt to display; otherwise a prompt is constructed from command. It may contain the special character sequences supported by the status-left option.
display-menu
alias menudisplay-menu [-MO] [-b border-lines] [-c target-client] [-C starting-choice] [-H selected-style] [-s style] [-S border-style] [-t target-pane] [-T title] [-x position] [-y position] name [key] [command] ...
selected-style] [-s style] [-S border-style] [-t target-pane] [-T title] [-x position] [-y position] name key command [name key command .] Display a menu on target-client. target-pane gives the target for any commands run from the menu.
display-message
alias displaydisplay-message [-aCIjlNpv] [-c target-client] [-d delay] [-F format] [-t target-pane] [message]
Display a message. If -p is given, the output is printed to stdout, otherwise it is displayed in the target-client status line for up to delay milliseconds. If delay is not given, the display-time option is used; a delay of zero waits for a key press.
show-prompt-history
alias showphistshow-prompt-history [-T prompt-type]
Display status prompt history for prompt type prompt-type. If -T is omitted, then show history for all types. See command-prompt for possible values for prompt-type.
Buffers commands 9
choose-buffer
choose-buffer [-kNrZ] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template]
[template] Put a pane into buffer mode, where a buffer may be chosen interactively from a list. Each buffer is shown on one line. A shortcut key is shown on the left in brackets allowing for immediate choice, or the list may be navigated and an item chosen or otherwise manipulated using the keys below.
clear-history
alias clearhistclear-history [-H] [-t target-pane]
Remove and free the history for the specified pane. -H also removes all hyperlinks.
delete-buffer
alias deletebdelete-buffer [-b buffer-name]
list-buffers
alias lsblist-buffers [-F format] [-f filter] [-O order]
List the global buffers. -F specifies the format of each line and -f a filter. Only buffers for which the filter is true are shown.
load-buffer
alias loadbload-buffer [-b buffer-name] [-t target-client] path
paste-buffer
alias pastebpaste-buffer [-dprS] [-s separator] [-b buffer-name] [-t target-pane]
Insert the contents of a paste buffer into the specified pane. If not specified, paste into the current one. By default, control characters are sanitized with vis(3); -S disables this.
save-buffer
alias savebsave-buffer [-a] [-b buffer-name] path
Save the contents of the specified paste buffer to path. The -a option appends to rather than overwriting the file. If path is ‘-’, the contents are written to stdout.
set-buffer
alias setbset-buffer [-aw] [-b buffer-name] [-n new-buffer-name] [-t target-client] [data]
Set the contents of the specified buffer to data. If -w is given, the buffer is also sent to the clipboard for target-client using the xterm(1) escape sequence, if possible. The -a option appends to rather than overwriting the buffer.
show-buffer
alias showbshow-buffer [-b buffer-name]
Display the contents of the specified buffer.
Hooks commands 2
set-hook
set-hook [-agpERTuw] [-B name:what:format] [-t target-pane] [hook] [command]
Without -E or -R, sets (or with -u unsets) hook hook-name to command. The flags are the same as for set-option.
show-hooks
show-hooks [-Bgpw] [-F format] [-t target-pane] [hook]
Shows hooks. The flags are the same as for show-options.
Environment commands 2
set-environment
alias setenvset-environment [-Fhgru] [-t target-session] variable [value]
Set or unset an environment variable. If -g is used, the change is made in the global environment; otherwise, it is applied to the session environment for target-session. If -F is present, then value is expanded as a format.
show-environment
alias showenvshow-environment [-hgs] [-t target-session] [variable]
Display the environment for target-session or the global environment with -g. If variable is omitted, all variables are shown. Variables removed from the environment are prefixed with ‘-’.
Miscellaneous commands 8
clock-mode
clock-mode [-t target-pane]
Display a large clock.
display-popup
alias popupGuide →display-popup [-BCEkN] [-b border-lines] [-c target-client] [-d start-directory] [-e environment] [-h height] [-s style] [-S border-style] [-t target-pane] [-T title] [-w width] [-x position] [-y position] [shell-command [argument ...]]
if-shell
alias ifif-shell [-bF] [-t target-pane] shell-command command [command]
Execute the first command if shell-command (run with /bin/sh) returns success or the second command otherwise. Before being executed, shell-command is expanded using the rules specified in the FORMATS section, including those relevant to target-pane. With -b, shell-command is run in the background.
lock-server
alias locklock-server
Lock each client individually by running the command specified by the lock-command option.
run-shell
alias runrun-shell [-bCE] [-c start-directory] [-d delay] [-t target-pane] [shell-command [argument ...]]
]] Execute shell-command using /bin/sh or (with -C) a tmux command in the background without creating a window. Before being executed, shell-command is expanded using the rules specified in the FORMATS section. If argument values are given, they are available as ‘#{1}’, ‘#{2}’ and so on.
set-window-option
alias setwset-window-option [-aFgoqu] [-t target-window] option [value]
show-window-options
alias showwshow-window-options [-gv] [-F format] [-t target-window] [option]
wait-for
alias waitwait-for [-ELSUlv] [-F format] [-w waiter] name
When used without options, prevents the client from exiting until woken using wait-for -S with the same channel. When -L is used, the channel is locked and any clients that try to lock the same channel are made to wait until the channel is unlocked with wait-for -U.
tmux command aliases
Short names that tmux accepts anywhere the full name works, from tmux list-commands on 3.8. Some are not obvious: tmux rename renames a session, renamew a window, and last goes to the last window.
78 of the 92 commands have an alias. These 14 do not: choose-buffer, choose-client, choose-tree, clock-mode, command-prompt, copy-mode, customize-mode, kill-server, kill-session, send-prefix, server-access, set-hook, show-hooks, switch-mode.
Frequently asked questions
How do I list all running tmux sessions from the command line?
Run tmux ls, short for tmux list-sessions. Each line shows the session name, its number of windows, when it was created and (attached) if a client is attached. If no session is running you get no server running on /tmp/tmux-1000/default (the number is your user ID). Inside tmux, Ctrl+b s shows the same list as a tree.
How do I kill an unresponsive tmux session?
Run tmux kill-session -t name. If a single program is stuck, kill just its pane with tmux kill-pane -t name:0.1, or restart it with tmux respawn-pane -k -t name:0.1. If the whole server stops responding, tmux kill-server ends every session; as a last resort, pkill -x tmux ends every tmux process you own. More fixes are on the troubleshooting page.
What is the difference between tmux commands and shortcuts?
Shortcuts (key bindings) are keys that run a command. Ctrl+b %, for example, runs split-window -h. Every shortcut is a command underneath, but most commands have no default key. See the cheat sheet for the keys.
How do I run a tmux command from inside tmux?
Press Ctrl+b then : to open the command prompt, type the command without the word tmux (for example kill-window) and press Enter. You can also type tmux kill-window in any shell running inside tmux.
Where can I find tmux help?
Run tmux list-commands for every command and its flags, tmux list-keys -N for key bindings, and man tmux for the full manual. Inside tmux, Ctrl+b ? lists the keys and Ctrl+b / explains one key.
What does tmux -L do, and what about -l?
-L name (capital L) runs a separate tmux server with its own socket, so tmux -L test ls only shows sessions started with -L test. Lowercase -l tells tmux to act as a login shell and currently does nothing.
Keep learning
Something wrong or out of date on this page? Email hello@tmux.app and we will fix it.
↑↓ moveEnter openType a key like % or a command like kill-session