is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen.
may be detached from a screen and continue running in the background, then later reattached.
When
is started it creates a new
with a single
and displays it on screen. A status line at the bottom of the screen shows information on the current session and is used to enter interactive commands.
A session is a single collection of
under the management of
Each session has one or more windows linked to it. A window occupies the entire screen and may be split into rectangular panes, each of which is a separate pseudo terminal (the
manual page documents the technical details of pseudo terminals). Any number of
instances may connect to the same session, and any number of windows may be present in the same session. Once all sessions are killed,
exits.
Each session is persistent and will survive accidental disconnection (such as
connection timeout) or intentional detaching (with the
key strokes).
may be reattached using:
In
a session is displayed on screen by a
and all sessions are managed by a single
The server and each client are separate processes which communicate through a socket in
The options are as follows:
Force
to assume the terminal supports 256 colours. This is equivalent to
Start in control mode (see the
section). Given twice
disables echo.
Execute
using the default shell. If necessary, the
server will be started to retrieve the
option. This option is for compatibility with
when
is used as a login shell.
Do not start the
server as a daemon. This also turns the
option off. With
may not be specified.
Specify an alternative configuration file. By default,
loads the system configuration file from
if present, then looks for a user configuration file at
The configuration file is a set of
commands which are executed in sequence when the server is first started.
loads configuration files once when the server process has started. The
command may be used to load a file later.
shows any error messages from commands in configuration files in the first session created, and continues to process the rest of the configuration file.
stores the server socket in a directory under
or
if it is unset. The default socket is named
This option allows a different socket name to be specified, allowing several independent
servers to be run. Unlike
a full path is not necessary: the sockets are all created in a directory
under the directory given by
or in
The
directory is created by
and must not be world readable, writable or executable.
If the socket is accidentally removed, the
signal may be sent to the
server process to recreate it (note that this will fail if any parent directories are missing).
Behave as a login shell. This flag currently has no effect and is for compatibility with other shells when using tmux as a login shell.
Do not start the server even if the command would normally do so (for example
or
Specify a full alternative path to the server socket. If
is specified, the default socket directory is not used and any
flag is ignored.
Write UTF-8 output to the terminal even if the first environment variable of
or
that is set does not contain
or
This is equivalent to
Set terminal features for the client. This is a comma-separated list of features. See the
option.
Request verbose logging. Log messages will be saved into
and
files in the current directory, where
is the PID of the server or client process. If
is specified twice, an additional
file is generated with a copy of everything
writes to the terminal.
The
signal may be sent to the
server process to toggle logging between on (as if
was given) and off.
Report the
version.
This specifies one of a set of commands used to control
as described in the following sections. If no commands are specified, the
command is assumed.
may be controlled from an attached client by using a key combination of a prefix key,
(Ctrl-b) by default, followed by a command key.
The default command key bindings are:
Send the prefix key (C-b) through to the application.
Rotate the panes in the current window forwards.
Suspend the
client.
Break the current pane out of the window.
Split the current pane into two, top and bottom.
List all paste buffers.
Rename the current session.
Split the current pane into two, left and right.
Kill the current window.
Prompt for a window index to select.
Switch the attached client to the previous session.
Switch the attached client to the next session.
Rename the current window.
Delete the most recently copied buffer of text.
Prompt for an index to move the current window.
Select windows 0 to 9.
Enter the
command prompt.
Move to the previously active pane.
Choose which buffer to paste interactively from a list.
List all key bindings.
Choose a client to detach.
Switch the attached client back to the last session.
Enter copy mode to copy text or view the history.
Paste the most recently copied buffer of text.
Create a new window.
Detach the current client.
Prompt to search for text in open windows.
Display some information about the current window.
Move to the previously selected window.
Mark the current pane (see
Clear the marked pane.
Change to the next window.
Select the next pane in the current window.
Change to the previous window.
Briefly display pane indexes.
Force redraw of the attached client.
Select a new session for the attached client interactively.
Show the time.
Choose the current window interactively.
Kill the current pane.
Toggle zoom state of the current pane.
Swap the current pane with the previous pane.
Swap the current pane with the next pane.
Show previous messages from
if any.
Enter copy mode and scroll one page up.
Change to the pane above, below, to the left, or to the right of the current pane.
Arrange panes in one of the five preset layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled.
Arrange the current window in the next preset layout.
Move to the next window with a bell or activity marker.
Rotate the panes in the current window backwards.
Move to the previous window with a bell or activity marker.
Resize the current pane in steps of one cell.
Resize the current pane in steps of five cells.
Key bindings may be changed with the
and
commands.
supports a large number of commands which can be used to control its behaviour. Each command is named and can accept zero or more flags and arguments. They may be bound to a key with the
command or run from the shell prompt, a shell script, a configuration file or the command prompt. For example, the same
command run from the shell prompt, from
and bound to a key may look like:
$ tmux set-option -g status-style bg=cyan
set-option -g status-style bg=cyan
bind-key C set-option -g status-style bg=cyan
Here, the command name is
is a flag and
and
are arguments.
distinguishes between command parsing and execution. In order to execute a command,
needs it to be split up into its name and arguments. This is command parsing. If a command is run from the shell, the shell parses it; from inside
or from a configuration file,
does. Examples of when
parses commands are:
in a configuration file;
typed at the command prompt (see
given to
passed as arguments to
or
To execute commands, each client has a
A global command queue not attached to any client is used on startup for configuration files like
Parsed commands added to the queue are executed in order. Some commands, like
and
parse their argument to create a new command which is inserted immediately after themselves. This means that arguments can be parsed twice or more - once when the parent command (such as
is parsed and again when it parses and executes its command. Commands like
and
stop execution of subsequent commands on the queue until something happens -
and
until a shell command finishes and
until a key is pressed. For example, the following commands:
new-session; new-window if-shell "true" "split-window" kill-session
Will execute
the shell command
and
in that order.
The
section lists the
commands and their arguments.
This section describes the syntax of commands parsed by
for example in a configuration file or at the command prompt. Note that when commands are entered into the shell, they are parsed by the shell - see for example
or
Each command is terminated by a newline or a semicolon (;). Commands separated by semicolons together form a
- if a command in the sequence encounters an error, no subsequent commands are executed.
It is recommended that a semicolon used as a command separator should be written as an individual token, for example from
$ tmux neww \; splitw
Or:
$ tmux neww ';' splitw
Or from the tmux command prompt:
neww ; splitw
However, a trailing semicolon is also interpreted as a command separator, for example in these
commands:
$ tmux neww\\; splitw
Or:
$ tmux 'neww;' splitw
As in these examples, when running tmux from the shell extra care must be taken to properly quote semicolons:
Semicolons that should be interpreted as a command separator should be escaped according to the shell conventions. For
this typically means quoted (such as
or escaped (such as
Individual semicolons or trailing semicolons that should be interpreted as arguments should be escaped twice: once according to the shell conventions and a second time for
for example:
$ tmux neww 'foo\\;' bar $ tmux neww foo\\\\; bar
Semicolons that are not individual tokens or trailing another token should only be escaped once according to shell conventions; for example:
$ tmux neww 'foo-;-bar' $ tmux neww foo-\\;-bar
Comments are marked by the unquoted # character - any remaining text after a comment is ignored until the end of the line.
If the last character of a line is \, the line is joined with the following line (the \ and the newline are completely removed). This is called line continuation and applies both inside and outside quoted strings and in comments, but not inside braces.
Command arguments may be specified as strings surrounded by single (') quotes, double quotes (") or braces ({}). This is required when the argument contains any special character. Single and double quoted strings cannot span multiple lines except with line continuation. Braces can span multiple lines.
Outside of quotes and inside double quotes, these replacements are performed:
Environment variables preceded by $ are replaced with their value from the global environment (see the
section).
A leading ~ or ~user is expanded to the home directory of the current or specified user.
\uXXXX or \uXXXXXXXX is replaced by the Unicode codepoint corresponding to the given four or eight digit hexadecimal number.
When preceded (escaped) by a \, the following characters are replaced: \e by the escape character; \r by a carriage return; \n by a newline; and \t by a tab.
\ooo is replaced by a character of the octal value ooo. Three octal digits are required, for example \001. The largest valid character is \377.
Any other characters preceded by \ are replaced by themselves (that is, the \ is removed) and are not treated as having any special meaning - so for example \; will not mark a command sequence and \$ will not expand an environment variable.
Braces are parsed as a configuration file (so conditions such as
are processed) and then converted into a string. They are designed to avoid the need for additional escaping when passing a group of
commands as an argument (for example to
These two examples produce an identical command - note that no escaping is needed when using {}:
if-shell true { display -p 'brace-dollar-foo: }$foo' }
if-shell true "display -p 'brace-dollar-foo: }\$foo'"
Braces may be enclosed inside braces, for example:
bind x if-shell "true" { if-shell "true" { display "true!" } }
Environment variables may be set by using the syntax
for example
Variables set during parsing are added to the global environment. A hidden variable may be set with
for example:
%hidden MYVAR=42
Hidden variables are not passed to the environment of processes created by tmux. See the
section.
Commands may be parsed conditionally by surrounding them with
and
The argument to
and
is expanded as a format (see
and if it evaluates to false (zero or empty), subsequent text is ignored until the closing
or
For example:
%if "#{==:#{host},myhost}" set -g status-style bg=red %elif "#{==:#{host},myotherhost}" set -g status-style bg=green %else set -g status-style bg=blue %endif
Will change the status line to red if running on
green if running on
or blue if running on another host. Conditionals may be given on one line, for example:
%if #{==:#{host},myhost} set -g status-style bg=red %endif
This section describes the commands supported by
Most commands accept the optional
(and sometimes
argument with one of
or
These specify the client, session, window or pane which a command should affect.
should be the name of the client, typically the
file to which the client is connected, for example either of
or
for the client attached to
If no client is specified,
attempts to work out the client currently in use; if that fails, an error is reported. Clients may be listed with the
command.
is tried as, in order:
A session ID prefixed with a $.
An exact name of a session (as listed by the
command).
The start of a session name, for example
would match a session named
An
pattern which is matched against the session name.
If the session name is prefixed with an
only an exact match is accepted (so
will only match exactly
not
If a single session is found, it is used as the target session; multiple matches produce an error. If a session is omitted, the current session is used if available; if no current session is available, the most recently used is chosen.
(or
or
specifies a window in the form
follows the same rules as for
and
is looked for in order as:
A special token, listed below.
A window index, for example
is window 1 in session
A window ID, such as @1.
An exact window name, such as
The start of a window name, such as
As an
pattern matched against the window name.
Like sessions, a
prefix will do an exact match only. An empty window name specifies the next unused index if appropriate (for example the
and
commands) otherwise the current window in
is chosen.
The following special tokens are available to indicate particular windows. Each has a single-character alternative form.
(or
or
may be a pane ID or takes a similar form to
but with the optional addition of a period followed by a pane index or pane ID, for example:
If the pane index is omitted, the currently active pane in the specified window is used. The following special tokens are available for the pane index:
The tokens
and
may be followed by an offset, for example:
select-window -t:+2
In addition,
or
may consist entirely of the token
(alternative form
to specify the session, window or pane where the most recent mouse event occurred (see the
section) or
(alternative form
to specify the marked pane (see
Sessions, window and panes are each numbered with a unique ID; session IDs are prefixed with a
windows with a
and panes with a
These are unique and are unchanged for the life of the session, window or pane in the
server. The pane ID is passed to the child process of the pane in the
environment variable. IDs may be displayed using the
or
formats (see the
section) and the
or
commands.
arguments are
commands. This may be a single argument passed to the shell, for example:
new-window 'vi ~/.tmux.conf'
Will run:
/bin/sh -c 'vi ~/.tmux.conf'
Additionally, the
and
commands allow
to be given as multiple arguments and executed directly (without
This can avoid issues with shell quoting. For example:
$ tmux new-window vi ~/.tmux.conf
Will run
directly without invoking the shell.
refers to a
command, either passed with the command and arguments separately, for example:
bind-key F1 set-option status off
Or passed as a single string argument in
for example:
bind-key F1 { set-option status off }
Example
commands include:
refresh-client -t/dev/ttyp2
rename-session -tfirst newname
set-option -wt:0 monitor-activity on
new-window ; split-window -d
bind-key R source-file ~/.tmux.conf \; \ display-message "source-file done"
Or from
$ tmux kill-window -t :1
$ tmux new-window \; split-window -d
$ tmux new-session -d 'vi ~/.tmux.conf' \; split-window -d \; attach
The
server manages clients, sessions, windows and panes. Clients are attached to sessions to interact with them, either when they are created with the
command, or later with the
command. Each session has one or more windows
into it. Windows may be linked to multiple sessions and are made up of one or more panes, each of which contains a pseudo terminal. Commands for creating, linking and otherwise manipulating windows are covered in the
section.
The following commands are available to manage clients and sessions:
If run from outside
create a new client in the current terminal and attach it to
If used from inside, switch the current client. If
is specified, any other clients attached to the session are detached. If
is given, send
to the parent process of the client as well as detaching the client, typically causing it to exit.
sets a comma-separated list of client flags. The flags are:
the client has an independent active pane
the client does not affect the size of other clients
the client does not receive pane output in control mode
output is paused once the pane is
behind in control mode
the client is read-only
wait for an empty line input before exiting in control mode
A leading
turns a flag off if the client is already attached.
is an alias for
When a client is read-only, only keys bound to the
or
commands have any effect. A client with the
flag allows the active pane to be selected independently of the window's active pane used by clients without the flag. This only affects the cursor position and commands issued from the client; other features such as hooks and styles continue to use the window's active pane.
If no server is started,
will attempt to start it; this will fail unless sessions are created in the configuration file.
The
rules for
are slightly adjusted: if
needs to select the most recently used session, it will prefer the most recently used
session.
will set the session working directory (used for new windows) to
If
is used, the
option will not be applied.
Detach the current client if bound to a key, the client specified with
or all clients currently attached to the session specified by
The
option kills all but the client given with
If
is given, send
to the parent process of the client, typically causing it to exit. With
run
to replace the client.
Report an error and exit with 1 if the specified session does not exist. If it does exist, exit with 0.
Kill the
server and clients and destroy all sessions.
Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it. If
is given, all sessions but the specified one is killed. The
flag clears alerts (bell, activity, or silence) in all windows linked to the session.
List all clients attached to the server. For the meaning of the
flag, see the
section. If
is specified, list only clients connected to that session.
List the syntax of
or - if omitted - of all commands supported by
List all sessions managed by the server.
specifies the format of each line and
a filter. Only sessions for which the filter is true are shown. See the
section.
Lock
see the
command.
Lock all clients attached to
Create a new session with name
The new session is attached to the current terminal unless
is given.
and
are the name of and shell command to execute in the initial window. With
the initial size comes from the global
option;
and
can be used to specify a different size.
uses the size of the current client if any. If
or
is given, the
option is set for the session.
sets a comma-separated list of client flags (see
If run from a terminal, any
special characters are saved and used for new windows in the new session.
The
flag makes
behave like
if
already exists; in this case,
behaves like
to
and
behaves like
to
If
is given, it specifies a
Sessions in the same group share the same set of windows - new windows are linked to all sessions in the group and any windows closed removed from all sessions. The current and previous window and any session options remain independent and any session in a group may be killed without affecting the others. The
argument may be:
the name of an existing group, in which case the new session is added to that group;
the name of an existing session - the new session is added to the same group as that session, creating a new group if necessary;
the name for a new group containing only the new session.
and
are invalid if
is used.
The
option prints information about the new session after it has been created. By default, it uses the format
but a different format may be specified with
If
is used, the
option will not be applied.
takes the form
and sets an environment variable for the newly created session; it may be specified multiple times.
Refresh the current client if bound to a key, or a single client if one is given with
If
is specified, only update the client's status line.
The
and
flags allow the visible portion of a window which is larger than the client to be changed.
moves the visible part up by
rows and
down,
left by
columns and
right.
returns to tracking the cursor automatically. If
is omitted, 1 is used. Note that the visible position is a property of the client not of the window, changing the current window in the attached session will reset it.
sets the width and height of a control mode client.
allows a control mode client to trigger actions on a pane. The argument is a pane ID (with leading
a colon, then one of
or
If
will not send output from the pane to the client and if all clients have turned the pane off, will stop reading from the pane. If
will return to sending output to the pane if it was paused (manually or with the
flag). If
will pause the pane.
may be given multiple times for different panes.
sets a subscription to a format for a control mode client. The argument is split into three items by colons:
is a name for the subscription;
is a type of item to subscribe to;
is the format. After a subscription is added, changes to the format are reported with the
notification, at most once a second. If only the name is given, the subscription is removed.
may be empty to check the format only for the attached session, or one of: a pane ID such as
for all panes in the attached session; a window ID such as
or
for all windows in the attached session.
sets a comma-separated list of client flags, see
requests the clipboard from the client using the
escape sequence and stores it in a new paste buffer.
and
move the visible portion of the window left, right, up or down by
if the window is larger than the client.
resets so that the position follows the cursor. See the
option.
Rename the session to
Show server messages or information. Messages are stored, up to a maximum of the limit set by the
server option.
and
show debugging information about jobs and terminals.
Execute commands from one or more files specified by
(which may be
patterns). If
is present, then
is expanded as a format. If
is given, no error will be returned if
does not exist. With
the file is parsed but no commands are executed.
shows the parsed commands and line numbers if possible.
Start the
server, if not already running, without creating any sessions.
Note that as by default the
server will exit with no sessions, this is only useful if a session is created in
is turned off, or another command is run as part of the same command sequence. For example:
$ tmux start \; show -g
Suspend a client by sending
(tty stop).
Switch the current session for client
to
As a special case,
may refer to a pane (a target that contains
or
to change session, window and pane. In that case,
keeps the window zoomed if it was zoomed. If
or
is used, the client is moved to the last, next or previous session respectively.
toggles the client
and
flags (see the
command).
If
is used,
option will not be applied.
sets the client's key table; the next key from the client will be interpreted from
This may be used to configure multiple prefix keys, or to bind commands to sequences of keys. For example, to make typing
run the
command:
bind-key -Ttable2 c list-keys bind-key -Ttable1 b switch-client -Ttable2 bind-key -Troot a switch-client -Ttable1
Each window displayed by
may be split into one or more
each pane takes up a certain area of the display and is a separate terminal. A window may be split into panes using the
command. Windows may be split horizontally (with the
flag) or vertically. Panes may be resized with the
command (bound to
and
by default), the current pane may be changed with the
command and the
and
commands may be used to swap panes without changing their position. Panes are numbered beginning from zero in the order they are created.
By default, a
pane permits direct access to the terminal contained in the pane. A pane may also be put into one of several modes:
Copy mode, which permits a section of a window or its history to be copied to a
for later insertion into another window. This mode is entered with the
command, bound to
by default. Copied text can be pasted with the
command, bound to
View mode, which is like copy mode but is entered when a command that produces output, such as
is executed from a key binding.
Choose mode, which allows an item to be chosen from a list. This may be a client, a session or window or pane, or a buffer. This mode is entered with the
and
commands.
In copy mode an indicator is displayed in the top-right corner of the pane with the current position and the number of lines in the history.
Commands are sent to copy mode using the
flag to the
command. When a key is pressed, copy mode automatically uses one of two key tables, depending on the
option:
for emacs, or
for vi. Key tables may be viewed with the
command.
The following commands are supported in copy mode:
The search commands come in several varieties:
and
search for a regular expression; the
variants search for a plain text string rather than a regular expression;
perform an incremental search and expect to be used with the
flag to the
command.
repeats the last search and
does the same but reverses the direction (forward becomes backward and backward becomes forward).
Copy commands may take an optional buffer prefix argument which is used to generate the buffer name (the default is
so buffers are named
and so on). Pipe commands take a command argument which is the command to which the selected text is piped.
variants also copy the selection. The
variants of some commands exit copy mode after they have completed (for copy commands) or when the cursor reaches the bottom (for scrolling commands).
variants do not clear the selection.
The next and previous word keys use space and the
and
characters as word delimiters by default, but this can be adjusted by setting the
session option. Next word moves to the start of the next word, next word end to the end of the next word and previous word to the start of the previous word. The three next and previous space keys work similarly but use a space alone as the word separator.
The jump commands enable quick movement within a line. For instance, typing
followed by
will move the cursor to the next
character on the current line. A
will then jump to the next occurrence.
Commands in copy mode may be prefaced by an optional repeat count. With vi key bindings, a prefix is entered using the number keys; with emacs, the Alt (meta) key and a number begins prefix entry.
The synopsis for the
command is:
Enter copy mode. The
option scrolls one page up.
begins a mouse drag (only valid if bound to a mouse key binding, see
hides the position indicator in the top right.
cancels copy mode and any other modes.
copies from
instead of
specifies that scrolling to the bottom of the history (to the visible screen) should exit copy mode. While in copy mode, pressing a key other than those used for scrolling will disable this behaviour. This is intended to allow fast scrolling through a pane's history, for example with:
bind PageUp copy-mode -eu
A number of preset arrangements of panes are available, these are called layouts. These may be selected with the
command or cycled with
(bound to
by default); once a layout is chosen, panes within it may be moved and resized as normal.
The following layouts are supported:
Panes are spread out evenly from left to right across the window.
Panes are spread evenly from top to bottom.
A large (main) pane is shown at the top of the window and the remaining panes are spread from left to right in the leftover space at the bottom. Use the
window option to specify the height of the top pane.
Similar to
but the large pane is placed on the left and the others spread from top to bottom along the right. See the
window option.
Panes are spread out as evenly as possible over the window in both rows and columns.
In addition,
may be used to apply a previously used layout - the
command displays the layout of each window in a form suitable for use with
For example:
$ tmux list-windows 0: ksh [159x48] layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0} $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
automatically adjusts the size of the layout for the current window size. Note that a layout cannot be applied to a window with more panes than that from which the layout was originally defined.
Commands related to windows and panes are as follows:
Break
off from its containing window to make it the only pane in
With
or
the window is moved to the next index after or before (existing windows are moved if necessary). If
is given, the new window does not become the current window. The
option prints information about the new window after it has been created. By default, it uses the format
but a different format may be specified with
Capture the contents of a pane. If
is given, the output goes to stdout, otherwise to the buffer specified with
or a new buffer if omitted. If
is given, the alternate screen is used, and the history is not accessible. If no alternate screen exists, an error will be returned unless
is given. If
is given, the output includes escape sequences for text and background attributes.
also escapes non-printable characters as octal \xxx.
preserves trailing spaces at each line's end and
preserves trailing spaces and joins any wrapped lines.
captures only any output that the pane has received that is the beginning of an as-yet incomplete escape sequence.
and
specify the starting and ending line numbers, zero is the first line of the visible pane and negative numbers are lines in the history.
to
is the start of the history and to
the end of the visible pane. The default is to capture only the visible contents of the pane.
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.
zooms the pane. The following keys may be used in client mode:
After a client is chosen,
is replaced by the client name in
and the result executed as a command. If
is not given, "detach-client -t '%%'" is used.
specifies the initial sort field: one of
or
reverses the sort order.
specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored.
specifies the format for each item in the list and
a format for each shortcut key; both are evaluated once for each line.
starts without the preview. This command works only if at least one client is attached.
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.
starts with sessions collapsed and
with windows collapsed.
zooms the pane. The following keys may be used in tree mode:
After a session, window or pane is chosen,
is replaced by the target in
and the result executed as a command. If
is not given, "switch-client -t '%%'" is used.
specifies the initial sort field: one of
or
reverses the sort order.
specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored.
specifies the format for each item in the tree and
a format for each shortcut key; both are evaluated once for each line.
starts without the preview.
includes all sessions in any session groups in the tree rather than only the first. This command works only if at least one client is attached.
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.
zooms the pane. The following keys may be used in customize mode:
specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored.
specifies the format for each item in the tree.
starts without the option information. This command works only if at least one client is attached.
Display a visible indicator of each pane shown by
See the
and
session options. The indicator is closed when a key is pressed (unless
is given) or
milliseconds have passed. If
is not given,
is used. A duration of zero means the indicator stays until a key is pressed. While the indicator is on screen, a pane may be chosen with the
to
keys, which will cause
to be executed as a command with
substituted by the pane ID. The default
is "select-pane -t '%%'". With
other commands are not blocked from running until the indicator is closed.
Search for a
pattern or, with
regular expression
in window names, titles, and visible content (but not history). The flags control matching behavior:
matches only visible window contents,
matches only the window name and
matches only the window title.
makes the search ignore case. The default is
zooms the pane.
This command works only if at least one client is attached.
Like
but instead of splitting
and creating a new pane, split it and move
into the space. This can be used to reverse
The
option causes
to be joined to left of or above
If
is omitted and a marked pane is present (see
the marked pane is used rather than the current pane.
Destroy the given pane. If no panes remain in the containing window, it is also destroyed. The
option kills all but the pane given with
Kill the current window or the window at
removing it from any sessions to which it is linked. The
option kills all but the window given with
Select the last (previously selected) pane.
keeps the window zoomed if it was zoomed.
enables or
disables input to the pane.
Select the last (previously selected) window. If no
is specified, select the last window of the current session.
Link the window at
to the specified
If
is specified and no such window exists, the
is linked there. With
or
the window is moved to the next index after or before
(existing windows are moved if necessary). If
is given and
exists, it is killed, otherwise an error is generated. If
is given, the newly linked window is not selected.
If
is given,
is ignored and all panes on the server are listed. If
is given,
is a session (or the current session). If neither is given,
is a window (or the current window).
specifies the format of each line and
a filter. Only panes for which the filter is true are shown. See the
section.
If
is given, list all windows on the server. Otherwise, list windows in the current session or in
specifies the format of each line and
a filter. Only windows for which the filter is true are shown. See the
section.
Does the same as
This is similar to
except the window at
is moved to
With
all windows in the session are renumbered in sequential order, respecting the
option.
Create a new window. With
or
the new window is inserted at the next index after or before the specified
moving windows up if necessary; otherwise
is the new window location.
If
is given, the session does not make the new window the current window.
represents the window to be created; if the target already exists an error is shown, unless the
flag is used, in which case it is destroyed. If
is given and a window named
already exists, it is selected (unless
is also given in which case the command does nothing).
is the command to execute. If
is not specified, the value of the
option is used.
specifies the working directory in which the new window is created.
When the shell command completes, the window closes. See the
option to change this behaviour.
takes the form
and sets an environment variable for the newly created window; it may be specified multiple times.
The
environment variable must be set to
or
for all programs running
New windows will automatically have
added to their environment, but care must be taken not to reset this in shell start-up files or by the
option.
The
option prints information about the new window after it has been created. By default, it uses the format
but a different format may be specified with
Move a window to the next layout and rearrange the panes to fit.
Move to the next window in the session. If
is used, move to the next window with an alert.
Pipe output sent by the program in
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
is executed. The
string may contain the special character sequences supported by the
option. If no
is given, the current pipe (if any) is closed.
and
specify which of the
output streams are connected to the pane: with
stdout is connected (so anything
prints is written to the pane as if it were typed); with
stdin is connected (so any output in the pane is piped to
Both may be used together and if neither are specified,
is used.
The
option only opens a new pipe if no previous pipe exists, allowing a pipe to be toggled with a single key, for example:
bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
Move to the previous layout in the session.
Move to the previous window in the session. With
move to the previous window with an alert.
Rename the current window, or the window at
if specified, to
Resize a pane, up, down, left or right by
with
or
or to an absolute size with
or
The
is given in lines or columns (the default is 1);
and
may be a given as a number of lines or columns or followed by
for a percentage of the window size (for example
With
the active pane is toggled between zoomed (occupying the whole of the window) and unzoomed (its normal position in the layout).
begins mouse resizing (only valid if bound to a mouse key binding, see
trims all lines below the current cursor position and moves lines out of the history to replace them.
Resize a window, up, down, left or right by
with
or
or to an absolute size with
or
The
is given in lines or cells (the default is 1).
sets the size of the largest session containing the window;
the size of the smallest. This command will automatically set
to manual in the window options.
Reactivate a pane in which the command has exited (see the
window option). If
is not given, the command used when the pane was created or last respawned is executed. The pane must be already inactive, unless
is given, in which case any existing command is killed.
specifies a new working directory for the pane. The
option has the same meaning as for the
command.
Reactivate a window in which the command has exited (see the
window option). If
is not given, the command used when the window was created or last respawned is executed. The window must be already inactive, unless
is given, in which case any existing command is killed.
specifies a new working directory for the window. The
option has the same meaning as for the
command.
Rotate the positions of the panes within a window, either upward (numerically lower) with
or downward (numerically higher).
keeps the window zoomed if it was zoomed.
Choose a specific layout for a window. If
is not given, the last preset layout used (if any) is reapplied.
and
are equivalent to the
and
commands.
applies the last set layout if possible (undoes the most recent layout change).
spreads the current pane and any panes next to it out evenly.
Make pane
the active pane in its window. If one of
or
is used, respectively the pane below, to the left, to the right, or above the target pane is used.
keeps the window zoomed if it was zoomed.
is the same as using the
command.
enables or
disables input to the pane.
sets the pane title.
and
are used to set and clear the
There is one marked pane at a time, setting a new marked pane clears the last. The marked pane is the default target for
to
and
Select the window at
and
are equivalent to the
and
commands. If
is given and the selected window is already the current window, the command behaves like
Create a new pane by splitting
does a horizontal split and
a vertical split; if neither is specified,
is assumed. The
option specifies the size of the new pane in lines (for vertical split) or in columns (for horizontal split);
may be followed by
to specify a percentage of the available space. The
option causes the new pane to be created to the left of or above
The
option creates a new pane spanning the full window height (with
or full window width (with
instead of splitting the active pane.
zooms if the window is not zoomed, or keeps it zoomed if already zoomed.
An empty
('') will create a pane with no command running in it. Output can be sent to such a pane with the
command. The
flag (if
is not specified or empty) will create an empty pane and forward any output from stdin to it. For example:
$ make 2>&1|tmux splitw -dI &
All other options have the same meaning as for the
command.
Swap two panes. If
is used and no source pane is specified with
is swapped with the previous pane (before it numerically);
swaps with the next pane (after it numerically).
instructs
not to change the active pane and
keeps the window zoomed if it was zoomed.
If
is omitted and a marked pane is present (see
the marked pane is used rather than the current pane.
This is similar to
except the source and destination windows are swapped. It is an error if no window exists at
If
is given, the new window does not become the current window.
If
is omitted and a marked pane is present (see
the window containing the marked pane is used rather than the current window.
Unlink
Unless
is given, a window may be unlinked only if it is linked to multiple sessions - windows may not be linked to no sessions; if
is specified and the window is linked to only one session, it is unlinked and destroyed.
allows a command to be bound to most keys, with or without a prefix key. When specifying keys, most represent themselves (for example
to
Ctrl keys may be prefixed with
or
Shift keys with
and Alt (meta) with
In addition, the following special key names are accepted:
(Delete),
to
(Insert),
and
Note that to bind the
or
keys, quotation marks are necessary, for example:
bind-key '"' split-window bind-key "'" new-window
A command bound to the
key will execute for all keys which do not have a more specific binding.
Commands related to key bindings are as follows:
Bind key
to
Keys are bound in a key table. By default (without -T), the key is bound in the
key table. This table is used for keys pressed after the prefix key (for example, by default
is bound to
in the
table, so
creates a new window). The
table is used for keys pressed without the prefix key: binding
to
in the
table (not recommended) means a plain
will create a new window.
is an alias for
Keys may also be bound in custom key tables and the
command used to switch to them from a key binding. The
flag indicates this key may repeat, see the
option.
attaches a note to the key (shown with
To view the default bindings and possible commands, see the
command.
List key bindings. There are two forms: the default lists keys as
commands;
lists only keys with attached notes and shows only the key and note for each key.
With the default form, all key tables are listed by default.
lists only keys in
With the
form, only keys in the
and
key tables are listed by default;
also lists only keys in
specifies a prefix to print before each key and
lists only the first matching key.
lists the command for keys that do not have a note rather than skipping them.
Send a key or keys to a window. Each argument
is the name of the key (such as
or
to send; if the string is not recognised as a key, it is sent as a series of characters. All arguments are sent sequentially from first to last.
The
flag disables key name lookup and processes the keys as literal UTF-8 characters. The
flag expects each key to be a hexadecimal number for an ASCII character.
The
flag causes the terminal state to be reset.
passes through a mouse event (only valid if bound to a mouse key binding, see
is used to send a command into copy mode - see the
section.
specifies a repeat count and
expands formats in arguments where appropriate.
Send the prefix key, or with
the secondary prefix key, to a window as if it was pressed.
Unbind the command bound to
and
are the same as for
If
is present, all key bindings are removed. The
option prevents errors being returned.
The appearance and behaviour of
may be modified by changing the value of various options. There are four types of option:
and
The
server has a set of global server options which do not apply to any particular window or session or pane. These are altered with the
command, or displayed with the
command.
In addition, each individual session may have a set of session options, and there is a separate set of global session options. Sessions which do not have a particular option configured inherit the value from the global session options. Session options are set or unset with the
command and may be listed with the
command. The available server and session options are listed under the
command.
Similarly, a set of window options is attached to each window and a set of pane options to each pane. Pane options inherit from window options. This means any pane option may be set as a window option to apply the option to all panes in the window without the option set, for example these commands will set the background colour to red for all panes except pane 0:
set -w window-style bg=red set -pt:.0 window-style bg=blue
There is also a set of global window options from which any unset window or pane options are inherited. Window and pane options are altered with
and
commands and displayed with
and
also supports user options which are prefixed with a
User options may have any name, so long as they are prefixed with
and be set to any string. For example:
$ tmux set -wq @foo "abc123" $ tmux show -wv @foo abc123
Commands which set options are as follows:
Set a pane option with
a window option with
a server option with
otherwise a session option. If the option is not a user option,
or
may be unnecessary -
will infer the type from the option name, assuming
for pane options. If
is given, the global session or window option is set.
expands formats in the option value. The
flag unsets an option, so a session inherits the option from the global options (or with
restores a global option to the default).
unsets an option (like
but if the option is a pane option also unsets the option on any panes in the window.
depends on the option and may be a number, a string, or a flag (on, off, or omitted to toggle).
The
flag prevents setting an option that is already set and the
flag suppresses errors about unknown or ambiguous options.
With
and if the option expects a string or a style,
is appended to the existing setting. For example:
set -g status-left "foo" set -ag status-left "bar"
Will result in
And:
set -g status-style "bg=red" set -ag status-style "fg=blue"
Will result in a red background
blue foreground. Without
the result would be the default background and a blue foreground.
Show the pane options (or a single option if
is provided) with
the window options with
the server options with
otherwise the session options. If the option is not a user option,
or
may be unnecessary -
will infer the type from the option name, assuming
for pane options. Global session or window options are listed if
is used.
shows only the option value, not the name. If
is set, no error will be returned if
is unset.
includes hooks (omitted by default).
includes options inherited from a parent set of options, such options are marked with an asterisk.
Available server options are:
Set the key sent by
for backspace.
Set the number of buffers; as new buffers are added to the top of the stack, old ones are removed from the bottom if necessary to maintain this maximum length.
This is an array of custom aliases for commands. If an unknown command matches
it is replaced with
For example, after:
Using:
Is equivalent to:
Note that aliases are expanded when a command is parsed rather than when it is executed, so binding an alias with
will bind the expanded form.
Set the default terminal for new windows created in this session - the default value of the
environment variable. For
to work correctly, this
be set to
or a derivative of them.
Give the command to pipe to if the
copy mode command is used without arguments.
Set the time in milliseconds for which
waits after an escape is input to determine if it is part of a function or meta key sequences. The default is 500 milliseconds.
Set the command used when
runs an editor.
If enabled (the default), the server will exit when there are no active sessions.
If enabled, the server will exit when there are no attached clients.
When
or
the escape sequence to enable extended keys is sent to the terminal, if
knows that it is supported.
always recognises extended keys itself. If this option is
will only forward extended keys to applications when they request them; if
will always forward the keys.
When enabled, focus events are requested from the terminal if supported and passed through to applications running in
Attached clients should be detached and attached again after changing this option.
If not empty, a file to which
will write command prompt history on exit and load it from on start.
Set the number of error or information messages to save in the message log for each client. The default is 100.
Attempt to set the terminal clipboard content using the
escape sequence, if there is an
entry in the
description (see the
section).
If set to
will both accept the escape sequence to create a buffer and attempt to set the terminal clipboard. If set to
will attempt to set the terminal clipboard but ignore attempts by applications to set
buffers. If
will neither accept the clipboard escape sequence nor attempt to set the clipboard.
Note that this feature needs to be enabled in
by setting the resource:
disallowedWindowOps: 20,21,SetXprop
Or changing this property from the
interactive menu when required.
Set terminal features for terminal types read from
has a set of named terminal features. Each will apply appropriate changes to the
entry in use.
can detect features for a few common terminals; this option can be used to easily tell tmux about features supported by terminals it cannot detect. The
option allows individual
capabilities to be set instead,
is intended for classes of functionality supported in a standard way but not reported by
Care must be taken to configure this only with features the terminal actually supports.
This is an array option where each entry is a colon-separated string made up of a terminal type pattern (matched using
followed by a list of terminal features. The available features are:
Supports 256 colours with the SGR escape sequences.
Allows setting the system clipboard.
Allows setting the cursor colour.
Allows setting the cursor style.
Supports extended keys.
Supports focus reporting.
Supports DECSLRM margins.
Supports
mouse sequences.
Supports the overline SGR attribute.
Supports the DECFRA rectangle fill escape sequence.
Supports RGB colour with the SGR escape sequences.
Supports the strikethrough SGR escape sequence.
Supports synchronized updates.
Supports
title setting.
Allows underscore style and colour to be set.
Allow terminal descriptions read using
to be overridden. Each entry is a colon-separated string made up of a terminal type pattern (matched using
and a set of
entries.
For example, to set the
entry to
for all terminal types matching
The terminal entry value is passed through
before interpretation.
Set list of user-defined key escape sequences. Each item is associated with a key named
and so on.
For example:
set -s user-keys[0] "\e[5;30012~" bind User0 resize-pane -L 3
Available session options are:
Set action on window activity when
is on.
means activity in any window linked to a session causes a bell or message (depending on
in the current window of that session,
means all activity is ignored (equivalent to
being off),
means only activity in windows other than the current window are ignored and
means activity in the current window is ignored but not those in other windows.
If keys are entered faster than one in
they are assumed to have been pasted rather than typed and
key bindings are not processed. The default is one millisecond and zero disables.
Set the base index from which an unused index should be searched when a new window is created. The default is zero.
Set action on a bell in a window when
is on. The values are the same as those for
Set the command used for new windows (if not specified when the window is created) to
which may be any
command. The default is an empty string, which instructs
to create a login shell using the value of the
option.
Specify the default shell. This is used as the login shell for new windows when the
option is set to empty, and must be the full path of the executable. When started
tries to set a default value from the first suitable of the
environment variable, the shell returned by
or
This option should be configured when
is used as a login shell.
Set the default size of new windows when the
option is set to manual or when a session is created with
The value is the width and height separated by an
character. The default is 80x24.
If enabled and the session is no longer attached to any clients, it is destroyed.
If on (the default), the client is detached when the session it is attached to is destroyed. If off, the client is switched to the most recently active of the remaining sessions. If
the client is detached only if there are no detached sessions; if detached sessions exist, the client is switched to the most recently active.
Set the colour used by the
command to show the indicator for the active pane.
Set the colour used by the
command to show the indicators for inactive panes.
Set the time in milliseconds for which the indicators shown by the
command appear.
Set the amount of time for which status line messages and other on-screen indicators are displayed. If set to 0, messages and indicators are displayed until a key is pressed.
is in milliseconds.
Set the maximum number of lines held in window history. This setting applies only to new windows - existing window histories are not resized and retain the limit at the point they were created.
Set the default key table to
instead of
Lock the session (like the
command) after
seconds of inactivity. The default is not to lock (set to 0).
Command to run when locking each client. The default is to run
with
Set status line message command style. This is used for the command prompt with
keys when in command mode. For how to specify
see the
section.
Set status line message style. This is used for messages and for the command prompt. For how to specify
see the
section.
If on,
captures the mouse and allows mouse events to be bound as key bindings. See the
section for details.
Set the key accepted as a prefix key. In addition to the standard keys described under
can be set to the special key
to set no prefix.
Set a secondary key accepted as a prefix key. Like
can be set to
If on, when a window is closed in a session, automatically renumber the other windows in numerical order. This respects the
option if it has been set. If off, do not renumber the windows.
Allow multiple commands to be entered without pressing the prefix-key again in the specified
milliseconds (the default is 500). Whether a key repeats may be set when it is bound using the
flag to
Repeat is enabled for the default keys bound to the
command.
Attempt to set the client terminal title using the
and
entries if they exist.
automatically sets these to the \e]0;...\007 sequence if the terminal appears to be
This option is off by default.
String used to set the client terminal title if
is on. Formats are expanded, see the
section.
Set action on window silence when
is on. The values are the same as those for
Show or hide the status line or specify its size. Using
gives a status line one row in height;
or
more rows.
Specify the format to be used for each line of the status line. The default builds the top status line from the various individual status options below.
Update the status line every
seconds. By default, updates will occur every 15 seconds. A setting of zero disables redrawing at interval.
Set the position of the window list in the status line: left, centre or right. centre puts the window list in the relative centre of the available free space; absolute-centre uses the centre of the entire horizontal space.
Use vi or emacs-style key bindings in the status line, for example at the command prompt. The default is emacs, unless the
or
environment variables are set and contain the string
Display
(by default the session name) to the left of the status line.
will be passed through
Also see the
and
sections.
For details on how the names and titles can be set see the
section.
Examples are:
#(sysctl vm.loadavg) #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
The default is
Set the maximum
of the left component of the status line. The default is 10.
Set the style of the left part of the status line. For how to specify
see the
section.
Set the position of the status line.
Display
to the right of the status line. By default, the current pane title in double quotes, the date and the time are shown. As with
will be passed to
and character pairs are replaced.
Set the maximum
of the right component of the status line. The default is 40.
Set the style of the right part of the status line. For how to specify
see the
section.
Set status line style. For how to specify
see the
section.
Set list of environment variables to be copied into the session environment when a new session is created or an existing session is attached. Any variables that do not exist in the source environment are set to be removed from the session environment (as if
was given to the
command).
If on, display a message instead of sending a bell when activity occurs in a window for which the
window option is enabled. If set to both, a bell and a message are produced.
If on, a message is shown on a bell in a window for which the
window option is enabled instead of it being passed through to the terminal (which normally makes a sound). If set to both, a bell and a message are produced. Also see the
option.
If
is enabled, prints a message after the interval has expired on a given window instead of sending a bell. If set to both, a bell and a message are produced.
Sets the session's conception of what characters are considered word separators, for the purposes of the next and previous word commands in copy mode. The default is
Available window options are:
Aggressively resize the chosen window. This means that
will resize the window to the size of the smallest or largest session (see the
option) for which it is the current window, rather than the session to which it is attached. The window may resize when the current window is changed on another session; this option is good for full-screen programs which support
and poor for interactive programs such as shells.
Control automatic window renaming. When this setting is enabled,
will rename the window automatically using the format specified by
This flag is automatically disabled for an individual window when a name is specified at creation with
or
or later with
or with a terminal escape sequence. It may be switched off globally with:
set-option -wg automatic-rename off
The format (see
used when the
option is enabled.
Set clock colour.
Set clock hour format.
Set the width or height of the main (left or top) pane in the
or
layouts. If suffixed by
this is a percentage of the window size.
Set the style of search matches in copy mode. For how to specify
see the
section.
Set the style of the line containing the mark in copy mode. For how to specify
see the
section.
Set the style of the current search match in copy mode. For how to specify
see the
section.
Use vi or emacs-style key bindings in copy mode. The default is emacs, unless
or
contains
Set window modes style. For how to specify
see the
section.
Monitor for activity in the window. Windows with activity are highlighted in the status line.
Monitor for a bell in the window. Windows with a bell are highlighted in the status line.
Monitor for silence (no activity) in the window within
seconds. Windows that have been silent for the interval are highlighted in the status line. An interval of zero disables the monitoring.
Set the height of the other panes (not the main pane) in the
layout. If this option is set to 0 (the default), it will have no effect. If both the
and
options are set, the main pane will grow taller to make the other panes the specified height, but will never shrink to do so. If suffixed by
this is a percentage of the window size.
Like
but set the width of other panes in the
layout.
Set the pane border style for the currently active pane. For how to specify
see the
section. Attributes are ignored.
Like
but set the starting index for pane numbers.
Set the text shown in pane border status lines.
Set the type of characters used for drawing pane borders.
may be one of:
single lines using ACS or UTF-8 characters
double lines using UTF-8 characters
heavy lines using UTF-8 characters
simple ASCII characters
the pane number
and
will fall back to standard ACS line drawing when UTF-8 is not supported.
Turn pane border status lines off or set their position.
Set the pane border style for panes aside from the active pane. For how to specify
see the
section. Attributes are ignored.
Set status line style for windows with an activity alert. For how to specify
see the
section.
Set status line style for windows with a bell alert. For how to specify
see the
section.
Like
but is the format used when the window is the current window.
Set status line style for the currently active window. For how to specify
see the
section.
Set the format in which the window is displayed in the status line window list. See the
and
sections.
Set status line style for the last active window. For how to specify
see the
section.
Sets the separator drawn between windows in the status line. The default is a single space character.
Set status line style for a single window. For how to specify
see the
section.
Configure how
determines the window size. If set to
the size of the largest attached session is used; if
the size of the smallest. If
the size of a new window is set from the
option and windows are resized automatically. With
uses the size of the client that had the most recent activity. See also the
command and the
option.
If this option is set, searches will wrap around the end of the pane contents. The default is on.
Available pane options are:
Allow programs in the pane to change the window name using a terminal escape sequence (\ek...\e\\).
This option configures whether programs running inside the pane may use the terminal alternate screen feature, which allows the
and
capabilities. The alternate screen feature preserves the contents of the window when an interactive application starts and restores it on exit, so that any output visible before the application starts reappears unchanged after it exits.
A pane with this flag set is not destroyed when the program running in it exits. If set to
then only when the program exit status is not zero. The pane may be reactivated with the
command.
Duplicate input to all other panes in the same window where this option is also on (only for panes that are not in any mode).
Set the pane style when it is the active pane. For how to specify
see the
section.
Set the pane style. For how to specify
see the
section.
allows commands to run on various triggers, called
Most
commands have an
hook and there are a number of hooks not associated with commands.
Hooks are stored as array options, members of the array are executed in order when the hook is triggered. Like options different hooks may be global or belong to a session, window or pane. Hooks may be configured with the
or
commands and displayed with
or
The following two commands are equivalent:
set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red' set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red'
Setting a hook without specifying an array index clears the hook and sets the first member of the array.
A command's after hook is run after it completes, except when the command is run as part of a hook itself. They are named with an
prefix. For example, the following command adds a hook to select the even-vertical layout after every
set-hook -g after-split-window "selectl even-vertical"
All the notifications listed in the
section are hooks (without any arguments), except
The following additional hooks are available:
Run when a window has activity. See
Run when a window has received a bell. See
Run when a window has been silent. See
Run when a client is attached.
Run when a client is detached
Run when a client is resized.
Run when a client's attached session is changed.
Run when the program running in a pane exits, but
is on so the pane has not closed.
Run when the program running in a pane exits.
Run when the focus enters a pane, if the
option is on.
Run when the focus exits a pane, if the
option is on.
Run when the terminal clipboard is set using the
escape sequence.
Run when a new session created.
Run when a session closed.
Run when a session is renamed.
Run when a window is linked into a session.
Run when a window is renamed.
Run when a window is unlinked from a session.
Hooks are managed with these commands:
Without
sets (or with
unsets) hook
to
The flags are the same as for
With
run
immediately.
Shows hooks. The flags are the same as for
If the
option is on (the default is off),
allows mouse events to be bound as keys. The name of each key is made up of a mouse event (such as
and a location suffix, one of the following:
The following mouse events are available:
The
events are fired for the second click of a double click, even if there may be a third click which will fire
instead of
Each should be suffixed with a location, for example
The special token
or
may be used as
or
in commands bound to mouse key bindings. It resolves to the window or pane over which the mouse event took place (for example, the window in the status line over which button 1 was released for a
binding, or the pane over which the wheel was scrolled for a
binding).
The
flag may be used to forward a mouse event to a pane.
The default key bindings allow the mouse to be used to select and resize panes, to copy text and to change window using the status line. These take effect if the
option is turned on.
Certain commands accept the
flag with a
argument. This is a string which controls the output format of the command. Format variables are enclosed in
and
for example
The possible variables are listed in the table below, or the name of a
option may be used for an option's value. Some variables have a shorter alias such as
is replaced by a single
by a
and
by a
Conditionals are available by prefixing with
and separating two alternatives with a comma; if the specified variable exists and is not zero, the first alternative is chosen, otherwise the second is used. For example
will include the string
if the session is attached and the string
if it is unattached, or
will include
if
is enabled, or
if not. Conditionals can be nested arbitrarily. Inside a conditional,
and
must be escaped as
and
unless they are part of a
replacement. For example:
#{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W .
String comparisons may be expressed by prefixing two comma-separated alternatives by
or
and a colon. For example
will be replaced by
if running on
otherwise by
and
evaluate to true if either or both of two comma-separated alternatives are true, for example
An
specifies an
or regular expression comparison. The first argument is the pattern and the second the string to compare. An optional argument specifies flags:
means the pattern is a regular expression instead of the default
pattern, and
means to ignore case. For example:
or
A
performs a search for an
pattern or regular expression in the pane content and evaluates to zero if not found, or a line number if found. Like
an
flag means search for a regular expression and
ignores case. For example:
Numeric operators may be performed by prefixing two comma-separated alternatives with an
and an operator. An optional
flag may be given after the operator to use floating point numbers, otherwise integers are used. This may be followed by a number giving the number of decimal places to use for the result. The available operators are: addition
subtraction
multiplication
division
modulus
or
(note that
must be escaped as
in formats which are also expanded by
and numeric comparison operators
and
For example,
multiplies 5.5 by 3 for a result with four decimal places and
returns the modulus of 7 and 3.
replaces a numeric argument by its ASCII equivalent, so
results in
A limit may be placed on the length of the resultant string by prefixing it by an
a number and a colon. Positive numbers count from the start of the string and negative from the end, so
will include at most the first five characters of the pane title, or
the last five characters. A suffix or prefix may be given as a second argument - if provided then it is appended or prepended to the string if the length has been trimmed, for example
will append
if the pane title is more than five characters. Similarly,
pads the string to a given width, for example
will result in a width of at least 10 characters. A positive width pads on the left, a negative on the right.
expands to the length of the variable and
to its width when displayed, for example
Prefixing a time variable with
will convert it to a string, so if
gives
gives
Adding
will use shorter but less accurate time format for times in the past. A custom format may be given using an
suffix (note that
must be escaped as
if the format is separately being passed through
for example in the
option):
see
The
and
prefixes are
and
of the variable respectively.
will escape
special characters or with a
suffix, escape hash characters (so
becomes
will expand the format twice, for example
is the result of expanding the content of the
option rather than the option itself.
is like
but also expands
specifiers.
or
will loop over each session, window or pane and insert the format once for each. For windows and panes, two comma-separated formats may be given: the second is used for the current window or active pane. For example, to get a list of windows formatted like the status line:
#{W:#{E:window-status-format} ,#{E:window-status-current-format} }
checks if a window (without any suffix or with the
suffix) or a session (with the
suffix) name exists, for example
is replaced with 1 if a window named
exists.
A prefix of the form
will substitute
with
throughout. The first argument may be an extended regular expression and a final argument may be
to ignore case, for example
would change
into
In addition, the last line of a shell command's output may be inserted using
For example,
will insert the system's uptime. When constructing formats,
does not wait for
commands to finish; instead, the previous result from running the same command is used, or a placeholder if the command has not been run before. If the command hasn't exited, the most recent line of output will be used, but the status line will not be updated more than once a second. Commands are executed with the
global environment set (see the
section).
An
specifies that a string should be interpreted literally and not expanded. For example
will be replaced by
The following variables are available, where appropriate:
offers various options to specify the colour and attributes of aspects of the interface, for example
for the status line. In addition, embedded styles may be specified in format options, such as
by enclosing them in
and
A style may be the single term
to specify the default style (which may come from an option, for example
in the status line) or a space or comma separated list of the following:
Set the foreground colour. The colour is one of:
if supported the bright variants
to
from the 256-colour set;
for the default colour;
for the terminal default colour; or a hexadecimal RGB string such as
Set the background colour.
Set no attributes (turn off any active attributes).
(or
Set an attribute. Any of the attributes may be prefixed with
to unset.
is the terminal alternate character set.
(or
Align text to the left, centre or right of the available space if appropriate.
Fill the available space with a background colour if appropriate.
Mark the position of the various window list components in the
option:
marks the start of the list;
is the part of the list that should be kept in focus if the entire list won't fit in the available space (typically the current window);
and
mark the text to be used to mark that text has been trimmed from the left or right of the list if there is not enough space.
Store the current colours and attributes as the default or reset to the previous default. A
affects any subsequent use of the
term until a
Only one default may be pushed (each
replaces the previous saved default).
Mark a range in the
option.
and
are the text used for the
and
mouse keys.
is the range for a window passed to the
mouse key, where
is a window index.
Examples are:
fg=yellow bold underscore blink bg=black,fg=default,noreverse
distinguishes between names and titles. Windows and sessions have names, which may be used to specify them in targets and are displayed in the status line and various lists: the name is the
identifier for a window or session. Only panes have titles. A pane's title is typically set by the program running inside the pane using an escape sequence (like it would set the
window title in
Windows themselves do not have titles - a window's title is the title of its active pane.
itself may set the title of the terminal in which the client is running, see the
option.
A session's name is set with the
and
commands. A window's name is set with one of:
A command argument (such as
for
or
An escape sequence (if the
option is turned on):
$ printf '\033kWINDOW_NAME\033\\'
Automatic renaming, which sets the name to the active command in the window's active pane. See the
option.
When a pane is first created, its title is the hostname. A pane's title can be set via the title setting escape sequence, for example:
$ printf '\033]2;My Title\033\\'
It can also be modified with the
command.
When the server is started,
copies the environment into the
in addition, each session has a
When a window is created, the session and global environments are merged. If a variable exists in both, the value from the session environment is used. The result is the initial environment passed to the new process.
The
session option may be used to update the session environment from the client when a new session is created or an old reattached.
also initialises the
variable with some internal information to allow commands to be executed from inside, and the
variable with the correct terminal setting of
Variables in both session and global environments may be marked as hidden. Hidden variables are not passed into the environment of new processes and instead can only be used by tmux itself (for example in formats, see the
section).
Commands to alter and view the environment are:
Set or unset an environment variable. If
is used, the change is made in the global environment; otherwise, it is applied to the session environment for
If
is present, then
is expanded as a format. The
flag unsets a variable.
indicates the variable is to be removed from the environment before starting a new process.
marks the variable as hidden.
Display the environment for
or the global environment with
If
is omitted, all variables are shown. Variables removed from the environment are prefixed with
If
is used, the output is formatted as a set of Bourne shell commands.
shows hidden variables (omitted by default).
includes an optional status line which is displayed in the bottom line of each terminal.
By default, the status line is enabled and one line in height (it may be disabled or made multiple lines with the
session option) and contains, from left-to-right: the name of the current session in square brackets; the window list; the title of the active pane in double quotes; and the time and date.
Each line of the status line is configured with the
option. The default is made of three parts: configurable left and right sections (which may contain dynamic content such as the time or output from a shell command, see the
and
options below), and a central window list. By default, the window list shows the index, name and (if any) flag of the windows present in the current session in ascending numerical order. It may be customised with the
and
options. The flag is one of the following symbols appended to the window name:
The # symbol relates to the
window option. The window name is printed in inverted colours if an alert (bell, activity or silence) is present.
The colour and attributes of the status line may be configured, the entire status line using the
session option and individual windows using the
window option.
The status line is automatically refreshed at interval if it has changed, the interval may be controlled with the
session option.
Commands related to the status line are as follows:
Open the command prompt in a client. This may be used from inside
to execute commands interactively.
If
is specified, it is used as the command. If present,
is a comma-separated list of the initial text for each prompt. If
is given,
is a comma-separated list of prompts which are displayed in order; otherwise a single prompt is displayed, constructed from
if it is present, or
if not.
Before the command is executed, the first occurrence of the string
and all occurrences of
are replaced by the response to the first prompt, all
are replaced with the response to the second prompt, and so on for further prompts. Up to nine prompt responses may be replaced
to
is like
but any quotation marks are escaped.
makes the prompt only accept one key press, in this case the resulting input is a single character.
is like
but the key press is translated to a key name.
makes the prompt only accept numeric key presses.
executes the command every time the prompt input changes instead of when the user exits the command prompt.
tells
that the prompt is for a target which affects what completions are offered when
is pressed;
is similar but indicates the prompt is for a window.
The following keys have a special meaning in the command prompt, depending on the value of the
option:
Ask for confirmation before executing
If
is given,
is the prompt to display; otherwise a prompt is constructed from
It may contain the special character sequences supported by the
option.
This command works only from inside
Display a menu on
gives the target for any commands run from the menu.
A menu is passed as a series of arguments: first the menu item name, second the key shortcut (or empty for none) and third the command to run when the menu item is chosen. The name and command are formats, see the
and
sections. If the name begins with a hyphen (-), then the item is disabled (shown dim) and may not be chosen. The name may be empty for a separator line, in which case both the key and command should be omitted.
is a format for the menu title (see
and
give the position of the menu. Both may be a row or column number, or one of the following special values:
Or a format, which is expanded including the following additional variables:
Each menu consists of items followed by a key shortcut shown in brackets. If the menu is too large to fit on the terminal, it is not displayed. Pressing the key shortcut chooses the corresponding item. If the mouse is enabled and the menu is opened from a mouse key binding, releasing the mouse button with an item selected chooses that item and releasing the mouse button without an item selected closes the menu.
changes this behaviour so that the menu does not close when the mouse button is released without an item selected the menu is not closed and a mouse button must be clicked to choose an item.
The following keys are also available:
Display a message. If
is given, the output is printed to stdout, otherwise it is displayed in the
status line for up to
milliseconds. If
is not given, the
option is used; a delay of zero waits for a key press.
ignores key presses and closes only after the delay expires. The format of
is described in the
section; information is taken from
if
is given, otherwise the active pane.
prints verbose logging as the format is parsed and
lists the format variables and their values.
forwards any input read from stdin to the empty pane given by
Display a popup running
on
A popup is a rectangular box drawn over the top of any panes. Panes are not updated while a popup is present.
closes the popup automatically when
exits. Two
closes the popup only if
exited with success.
and
give the position of the popup, they have the same meaning as for the
command.
and
give the width and height - both may be a percentage (followed by
If omitted, half of the terminal size is used.
The
flag closes any popup on the client.
maintains a set of named
Each buffer may be either explicitly or automatically named. Explicitly named buffers are named when created with the
or
commands, or by renaming an automatically named buffer with
Automatically named buffers are given a name such as
and so on. When the
option is reached, the oldest automatically named buffer is deleted. Explicitly named buffers are not subject to
and may be deleted with the
command.
Buffers may be added using
or the
and
commands, and pasted into a window using the
command. If a buffer command is used and no buffer is specified, the most recently added automatically named buffer is assumed.
A configurable history buffer is also maintained for each window. By default, up to 2000 lines are kept; this can be altered with the
option (see the
command above).
The buffer commands are as follows:
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.
zooms the pane. The following keys may be used in buffer mode:
After a buffer is chosen,
is replaced by the buffer name in
and the result executed as a command. If
is not given, "paste-buffer -b '%%'" is used.
specifies the initial sort field: one of
or
reverses the sort order.
specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored.
specifies the format for each item in the list and
a format for each shortcut key; both are evaluated once for each line.
starts without the preview. This command works only if at least one client is attached.
Remove and free the history for the specified pane.
Delete the buffer named
or the most recently added automatically named buffer if not specified.
List the global buffers.
specifies the format of each line and
a filter. Only buffers for which the filter is true are shown. See the
section.
Load the contents of the specified paste buffer from
If
is given, the buffer is also sent to the clipboard for
using the
escape sequence, if possible.
Insert the contents of a paste buffer into the specified pane. If not specified, paste into the current one. With
also delete the paste buffer. When output, any linefeed (LF) characters in the paste buffer are replaced with a separator, by default carriage return (CR). A custom separator may be specified using the
flag. The
flag means to do no replacement (equivalent to a separator of LF). If
is specified, paste bracket control codes are inserted around the buffer if the application has requested bracketed paste mode.
Save the contents of the specified paste buffer to
The
option appends to rather than overwriting the file.
Set the contents of the specified buffer to
If
is given, the buffer is also sent to the clipboard for
using the
escape sequence, if possible. The
option appends to rather than overwriting the buffer. The
option renames the buffer to
Display the contents of the specified buffer.
Miscellaneous commands are as follows:
Display a large clock.
Execute the first
if
returns success or the second
otherwise. Before being executed,
is expanded using the rules specified in the
section, including those relevant to
With
is run in the background.
If
is given,
is not executed but considered success if neither empty nor zero (after formats are expanded).
Lock each client individually by running the command specified by the
option.
Execute
or (with
a
command in the background without creating a window. Before being executed,
is expanded using the rules specified in the
section. With
the command is run in the background.
waits for
seconds before starting the command. If
is not given, any output to stdout is displayed in view mode (in the pane specified by
or the current pane if omitted) after the command finishes. If the command fails, the exit status is also displayed.
When used without options, prevents the client from exiting until woken using
with the same channel. When
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
When a
client detaches, it prints a message. This may be one of:
The client was detached normally.
The client was detached and its parent sent the
signal (for example with
The client's
or
was unexpectedly destroyed.
The client was killed with
The client is in control mode and became unable to keep up with the data from
The server exited when it had no sessions.
The server exited when it received
The server crashed or otherwise exited without telling the client the reason.
understands some unofficial extensions to
It is not normally necessary to set these manually, instead the
option should be used.
An existing extension that tells
the terminal supports default colours.
Tell
that the terminal supports the VTE bidirectional text extensions.
Set the cursor colour. The first takes a single string argument and is used to set the colour; the second takes no arguments and restores the default cursor colour. If set, a sequence such as this may be used to change the cursor colour from inside
$ printf '\033]12;red\033\\'
Set, clear, disable or enable DECSLRM margins. These are set automatically if the terminal reports it is
compatible.
Disable and enable bracketed paste. These are set automatically if the
capability is present.
Disable and enable extended keys.
Disable and enable focus reporting. These are set automatically if the
capability is present.
Tell
that the terminal supports rectangle operations.
Enable the overline attribute.
Set a styled underscore. The single parameter is one of: 0 for no underscore, 1 for normal underscore, 2 for double underscore, 3 for curly underscore, 4 for dotted underscore and 5 for dashed underscore.
Set the underscore colour or reset to the default. The argument is (red * 65536) + (green * 256) + blue where each is between 0 and 255.
Set or reset the cursor style. If set, a sequence such as this may be used to change the cursor to an underline:
$ printf '\033[4 q'
If
is not set, Ss with argument 0 will be used to reset the cursor style instead.
Start (parameter is 1) or end (parameter is 2) a synchronized update.
Indicate that the terminal supports the
RGB escape sequence (for example, \e[38;2;255;255;255m).
If supported, this is used for the initialize colour escape sequence (which may be enabled by adding the
and
capabilities to the
entry).
This is equivalent to the
capability.
Store the current buffer in the host terminal's selection (clipboard). See the
option above and the
man page.
This is an existing extension capability that tmux uses to mean that the terminal supports the
title set sequences and to automatically set some of the capabilities above.
offers a textual interface called
This allows applications to communicate with
using a simple text-only protocol.
In control mode, a client sends
commands or command sequences terminated by newlines on standard input. Each command will produce one block of output on standard output. An output block consists of a
line followed by the output (which may be empty). The output block ends with a
or
and matching
or
have three arguments: an integer time (as seconds from epoch), command number and flags (currently not used). For example:
%begin 1363006971 2 1 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active) %end 1363006971 2 1
The
command may be used to set the size of a client in control mode.
In control mode,
outputs notifications. A notification will never occur inside an output block.
The following notifications are defined:
The client has detached.
The client is now attached to the session with ID
which is named
The pane has been continued after being paused (if the
flag is set, see
The
client is exiting immediately, either because it is not attached to any session or an error occurred. If present,
describes why the client exited.
New form of
sent when the
flag is set.
is the time in milliseconds for which tmux had buffered the output before it was sent. Any subsequent arguments up until a single
are for future use and should be ignored.
The layout of a window with ID
changed. The new layout is
The window's visible layout is
and the window flags are
A window pane produced output.
escapes non-printable characters and backslash as octal \xxx.
The pane with ID
has changed mode.
The pane has been paused (if the
flag is set).
The client is now attached to the session with ID
which is named
The current session was renamed to
The session with ID
changed its active window to the window with ID
A session was created or destroyed.
The value of the format associated with subscription
has changed to
See
Any arguments after
up until a single
are for future use and should be ignored.
The window with ID
was created but is not linked to the current session.
The window with ID
was linked to the current session.
The window with ID
closed.
The active pane in the window with ID
changed to the pane with ID
The window with ID
was renamed to
When
is started, it inspects the following environment variables:
If the command specified in this variable contains the string
and
is unset, use vi-style key bindings. Overridden by the
and
options.
The user's login directory. If unset, the
database is consulted.
The character encoding
It is used for two separate purposes. For output to the terminal, UTF-8 is used if the
option is given or if
contains
or
Otherwise, only ASCII characters are written and non-ASCII characters are replaced with underscores
For input,
always runs with a UTF-8 locale. If en_US.UTF-8 is provided by the operating system it is used and
is ignored for input. Otherwise,
tells
what the UTF-8 locale is called on the current system. If the locale specified by
is not available or is not a UTF-8 locale,
exits with an error message.
The date and time format
It is used for locale-dependent
format specifiers.
The current working directory to be set in the global environment. This may be useful if it contains symbolic links. If the value of the variable does not match the current working directory, the variable is ignored and the result of
is used instead.
The absolute path to the default shell for new windows. See the
option for details.
The parent directory of the directory containing the server sockets. See the
option for details.
If the command specified in this variable contains the string
use vi-style key bindings. Overridden by the
and
options.
Default
configuration file.
System-wide configuration file.
To create a new
session running
Most commands have a shorter form, known as an alias. For new-session, this is
Alternatively, the shortest unambiguous form of a command is accepted. If there are several options, they are listed:
$ tmux n ambiguous command: n, could be: new-session, new-window, next-window
Within an active session, a new window may be created by typing
(Ctrl followed by the
key followed by the
key).
Windows may be navigated with:
(to select window 0),
(to select window 1), and so on;
to select the next window; and
to select the previous window.
A session may be detached using
(or by an external event such as
disconnection) and reattached with:
Typing
lists the current key bindings in the current window; up and down may be used to navigate the list or
to exit from it.
Commands to be run when the
server is started may be placed in the
configuration file. Common examples include:
Changing the default prefix key:
set-option -g prefix C-a unbind-key C-b bind-key C-a send-prefix
Turning the status line off, or changing its colour:
set-option -g status off set-option -g status-style bg=blue
Setting other options, such as the default command, or locking after 30 minutes of inactivity:
set-option -g default-command "exec /bin/ksh" set-option -g lock-after-time 1800
Creating new key bindings:
bind-key b set-option status bind-key / command-prompt "split-window 'exec man %%'" bind-key S command-prompt "new-window -n %1 'ssh %1'"