[tmux.app]
tmux 3.8

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.

Updated Tested on tmux 3.89 min read

On this page
  1. The 15 main tmux commands you will actually use
  2. Targets: how -t session:window.pane works
  3. Session commands
  4. Window commands (tabs)
  5. Pane commands
  6. Key binding commands
  7. Copy mode and buffer commands
  8. Server, option and info commands
  9. Scripting commands
  10. tmux CLI: command-line flags
  11. All 92 tmux commands
  12. tmux command aliases
  13. Frequently asked questions
  14. Where to go next

Quick answer

How do I list every tmux command?

shell
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-window

tmux 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.

#CommandLong nameWhat it does
1tmux new -s worknew-sessionStart a session named work and attach to it
2tmux lslist-sessionsList running sessions
3tmux attach -t workattach-sessionAttach to work; plain tmux a attaches to the last one
4tmux detachdetach-clientDetach and leave everything running (Ctrl+b d)
5tmux kill-session -t workkill-sessionEnd one session and its programs
6tmux kill-serverkill-serverEnd every session and stop tmux
7tmux new-window -n logsnew-windowOpen a window named logs (Ctrl+b c)
8tmux split-window -hsplit-windowSplit side by side (Ctrl+b %); -v splits top and bottom (Ctrl+b ")
9tmux select-pane -Lselect-paneMove to the pane on the left (Ctrl+b ←); -R -U -D for the others
10tmux resize-pane -R 10resize-paneMove the pane's right edge 10 cells (Ctrl+b Ctrl+→ moves 1)
11tmux rename-window logsrename-windowRename the current window (Ctrl+b ,)
12tmux send-keys -t work:0.1 'npm test' Entersend-keysType a command into another pane
13tmux capture-pane -p -t work:0.1capture-panePrint what a pane is showing
14tmux source-file ~/.tmux.confsource-fileReload your config
15tmux set -g mouse onset-optionChange 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

shell
tmux kill-session -t old
tmux new-window \; split-window -h

Prefix it with tmux. Join several with \; (escaped so your shell passes it to tmux). Works inside or outside tmux.

From the tmux prompt

after prefix :
:kill-session -t old

Press 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.

How a tmux target works: -t session:window.pane The target work:editor.1 has three parts. work is the session, given by name, the start of a name, a $ ID such as $0, or =work for an exact match. editor is the window, given by index, name, an @ ID such as @3, or a token such as {last}. 1 is the pane, given by its index in the window, a % ID such as %7, or a token such as {top-right}. Any part can be left out to mean the current one. tmux select-pane -t work : editor . 1 session name, or the start of a name $0 (session ID) =work (exact name only) window index (0, 1, 2…) or name @3 (window ID) {last} {next} {end} or ! + $ pane index inside the window %7 (pane ID, unique) {top-right} {last} {marked} Leave a part out to mean the current one: :2 = window 2 here, :.1 = pane 1 here, work = its active pane
Every part is optional. tmux fills in the current session, window or pane for whatever you leave out.

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.

TargetMeansExample
workSession by name (or the start of one)tmux attach -t work
=workExact name only, no prefix matchingtmux has-session -t =work
work:2 / work:logsWindow by index or nametmux select-window -t work:2
work:2.1Pane 1 in that windowtmux kill-pane -t work:2.1
:3 / :.1Window 3 / pane 1 in the current session or windowtmux select-pane -t :.1
$0 @3 %7Session, window and pane IDs: unique, never reused while the server runstmux 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 offsettmux select-window -t :+2
{start} {end} or ^ $Lowest or highest numbered windowtmux select-window -t 'work:{end}'
{top-right}, {left}, {bottom}…Pane by position in the windowtmux select-pane -t '.{top-right}'
{marked} or ~The pane you marked with Ctrl+b mtmux 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}':

Real screenshot · tmux 3.8Targets in a real tmux 3.8 server: list-panes -a prints every pane as session:window.pane with its $, @ and % IDs, and the prompt (prefix :) is about to run select-pane -t work:editor.1.
Targets in a real tmux 3.8 server: list-panes -a prints every pane as session:window.pane with its $, @ and % IDs, and the prompt (prefix :) is about to run select-pane -t work:editor.1.
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 : does

Session commands

session 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
CommandAliasKeyUse it to
new-sessionnewCreate a session (-s name, -d detached, -c start directory)
list-sessionslsList sessions, optionally with a -F format
attach-sessionattachAttach to a session (-d detaches other clients)
detach-clientdetachCtrl+b dDetach a client
switch-clientswitchcCtrl+b sMove your client to another session (-l last, -n/-p next/previous)
rename-sessionrenameCtrl+b $Rename a session
has-sessionhasExit 0 if a session exists (for scripts)
kill-sessionEnd a session (-a: all others)
kill-serverEnd 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)

window commands
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
CommandAliasKeyUse it to
new-windownewwCtrl+b cCreate a window (-n name, -c directory)
select-windowselectwCtrl+b 0…9Go to a window
next-window / previous-windownext / prevCtrl+b n Ctrl+b pCycle windows
last-windowlastCtrl+b lGo back to the previous window
rename-windowrenamewCtrl+b ,Rename a window
list-windowslswCtrl+b wList windows (-a: in every session)
move-window / swap-windowmovew / swapwCtrl+b .Reorder or renumber windows
kill-windowkillwCtrl+b &Close a window and its panes
switch-modeCtrl+b TabFuzzy window or session switcher new in 3.8

Pane commands

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
CommandAliasKeyUse it to
split-windowsplitwCtrl+b % Ctrl+b "Split a pane (-h side by side, -v stacked, -l size)
select-paneselectpCtrl+b ↑ …Go to (focus) a pane; -T sets its title, -m marks it
resize-paneresizepCtrl+b Ctrl+↑ …Resize (-L -R -U -D cells, -x -y size, -Z zoom)
swap-pane / rotate-windowswapp / rotatewCtrl+b { Ctrl+b }Swap or rotate panes
break-pane / join-panebreakp / joinpCtrl+b !Move a pane out to a window, or into another window
select-layoutselectlCtrl+b SpaceApply a layout: tiled, even-horizontal, main-vertical…
kill-panekillpCtrl+b xClose a pane (-a: all others)
respawn-panerespawnpRestart a pane's program; -k kills a stuck one first
new-panenewpCtrl+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

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 itself

bind-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

copy mode and buffers
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
CommandAliasKeyUse it to
copy-modeCtrl+b [Scroll back, search and select (-u starts one page up)
paste-bufferpastebCtrl+b ]Paste a buffer into a pane
choose-bufferCtrl+b =Pick a buffer from a list
list-buffers / show-bufferlsb / showbCtrl+b #See what is in the buffers
set-buffer / delete-buffersetb / deletebCtrl+b -Create or delete a buffer
save-buffer / load-buffersaveb / loadbBuffer to or from a file
capture-panecapturepCopy a pane's text (-p print, -S - from the start of history, -J join wrapped lines)
clear-historyclearhistDelete 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

server and options
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 output

set-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

dev.sh
#!/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 dev

Scripts 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]].

FlagWhat it doesExample
-VPrint the tmux version and exittmux -V prints tmux 3.8
-L nameUse a separate server with its own socket name, so its sessions are independent of your normal onestmux -L test new
-S pathUse a socket at a full path (ignores -L); used to share a session with another usertmux -S /tmp/pair new
-f fileLoad this config instead of ~/.tmux.conf; -f /dev/null starts with defaultstmux -f /dev/null new
-C, -CCControl mode: text protocol for programs. -CC disables echo; iTerm2 uses it for native tmux windowstmux -CC attach
-uSend UTF-8 to the terminal even if the locale variables do not say UTF-8tmux -u attach
-2Assume the terminal supports 256 colors (same as -T 256)tmux -2
-T featuresSet terminal features for this client, comma separatedtmux -T RGB,mouse attach
-NDo not start a server if none is runningtmux -N ls
-DRun the server in the foreground, not as a daemon (for service managers); no command allowedtmux -D
-c commandRun a shell command with tmux's default shell, for using tmux as a login shelltmux -c 'echo hi'
-vWrite debug logs (tmux-server-PID.log, tmux-client-PID.log) in the current directorytmux -vv new
-lBehave as a login shell; currently has no effect
-hPrint the usage line and exittmux -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.

tmux 3.8 commands by area92 commands in total

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 has
has-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 lsc
list-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 lscm
list-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 lockc
lock-client [-t target-client]

Lock target-client, see the lock-server command.

lock-session

alias locks
lock-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 refresh
refresh-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 showmsgs
show-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 start
start-server 

Start the tmux server, if not already running, without creating any sessions.

suspend-client

alias suspendc
suspend-client [-t target-client]

Suspend a client by sending SIGTSTP (tty stop).

switch-client

alias switchc
switch-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 breakp
break-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 displayp
display-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 findw
find-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 joinp
join-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 lastp
last-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 last
last-window [-t target-session]

Select the last (previously selected) window. If no target-session is specified, select the last window of the current session.

list-panes

alias lsp
list-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 lsw
list-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 movep
move-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 movew
move-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 nextl
next-layout [-t target-window]

Move a window to the next layout and rearrange the panes to fit.

next-window

alias next
next-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 pipep
pipe-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 prevl
previous-layout [-t target-window]

Move to the previous layout in the session.

previous-window

alias prev
previous-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 resizew
resize-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 respawnp
respawn-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 respawnw
respawn-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 rotatew
rotate-window [-DUZ] [-t target-window]

select-layout

alias selectl
select-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 selectw
select-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 swapw
swap-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.8
switch-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.

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 lsk
list-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 unbind
unbind-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 show
show-options [-AgHpqsvw] [-F format] [-t target-pane] [option]

Status line, prompts & menus commands 6

clear-prompt-history

alias clearphist
clear-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 confirm
confirm-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 menu
display-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 display
display-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 showphist
show-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 clearhist
clear-history [-H] [-t target-pane]

Remove and free the history for the specified pane. -H also removes all hyperlinks.

delete-buffer

alias deleteb
delete-buffer [-b buffer-name]

list-buffers

alias lsb
list-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 loadb
load-buffer [-b buffer-name] [-t target-client] path

paste-buffer

alias pasteb
paste-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 saveb
save-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 setb
set-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 showb
show-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 setenv
set-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 showenv
show-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 if
if-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 lock
lock-server 

Lock each client individually by running the command specified by the lock-command option.

run-shell

alias run
run-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 setw
set-window-option [-aFgoqu] [-t target-window] option [value]

show-window-options

alias showw
show-window-options [-gv] [-F format] [-t target-window] [option]

wait-for

alias wait
wait-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.

Where to go next

Keep learning

Something wrong or out of date on this page? Email hello@tmux.app and we will fix it.