[BACK]Return to tmux.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Annotation of src/usr.bin/tmux/tmux.1, Revision 1.761

1.761   ! nicm        1: .\" $OpenBSD: tmux.1,v 1.760 2020/05/16 15:25:24 nicm Exp $
1.1       nicm        2: .\"
1.477     nicm        3: .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
1.1       nicm        4: .\"
                      5: .\" Permission to use, copy, modify, and distribute this software for any
                      6: .\" purpose with or without fee is hereby granted, provided that the above
                      7: .\" copyright notice and this permission notice appear in all copies.
                      8: .\"
                      9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
                     14: .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
                     15: .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16: .\"
1.752     nicm       17: .Dd $Mdocdate: May 16 2020 $
1.1       nicm       18: .Dt TMUX 1
                     19: .Os
                     20: .Sh NAME
                     21: .Nm tmux
1.6       jmc        22: .Nd terminal multiplexer
1.1       nicm       23: .Sh SYNOPSIS
                     24: .Nm tmux
                     25: .Bk -words
1.708     nicm       26: .Op Fl 2CluvV
1.91      nicm       27: .Op Fl c Ar shell-command
1.1       nicm       28: .Op Fl f Ar file
                     29: .Op Fl L Ar socket-name
                     30: .Op Fl S Ar socket-path
1.744     nicm       31: .Op Fl T Ar features
1.1       nicm       32: .Op Ar command Op Ar flags
                     33: .Ek
                     34: .Sh DESCRIPTION
                     35: .Nm
1.59      jmc        36: is a terminal multiplexer:
                     37: it enables a number of terminals to be created, accessed, and
                     38: controlled from a single screen.
1.67      jmc        39: .Nm
                     40: may be detached from a screen
                     41: and continue running in the background,
                     42: then later reattached.
1.1       nicm       43: .Pp
1.60      nicm       44: When
                     45: .Nm
                     46: is started it creates a new
                     47: .Em session
                     48: with a single
                     49: .Em window
                     50: and displays it on screen.
                     51: A status line at the bottom of the screen
                     52: shows information on the current session
                     53: and is used to enter interactive commands.
                     54: .Pp
                     55: A session is a single collection of
                     56: .Em pseudo terminals
                     57: under the management of
                     58: .Nm .
                     59: Each session has one or more
                     60: windows linked to it.
                     61: A window occupies the entire screen
                     62: and may be split into rectangular panes,
                     63: each of which is a separate pseudo terminal
                     64: (the
                     65: .Xr pty 4
                     66: manual page documents the technical details of pseudo terminals).
                     67: Any number of
                     68: .Nm
                     69: instances may connect to the same session,
                     70: and any number of windows may be present in the same session.
                     71: Once all sessions are killed,
                     72: .Nm
                     73: exits.
                     74: .Pp
1.64      nicm       75: Each session is persistent and will survive accidental disconnection
1.66      jmc        76: (such as
1.64      nicm       77: .Xr ssh 1
1.67      jmc        78: connection timeout) or intentional detaching (with the
1.64      nicm       79: .Ql C-b d
                     80: key strokes).
                     81: .Nm
                     82: may be reattached using:
                     83: .Pp
                     84: .Dl $ tmux attach
1.60      nicm       85: .Pp
1.64      nicm       86: In
                     87: .Nm ,
                     88: a session is displayed on screen by a
                     89: .Em client
                     90: and all sessions are managed by a single
                     91: .Em server .
                     92: The server and each client are separate processes which communicate through a
                     93: socket in
                     94: .Pa /tmp .
1.65      nicm       95: .Pp
1.1       nicm       96: The options are as follows:
                     97: .Bl -tag -width "XXXXXXXXXXXX"
                     98: .It Fl 2
                     99: Force
                    100: .Nm
                    101: to assume the terminal supports 256 colours.
1.744     nicm      102: This is equivalent to
                    103: .Fl T Ar 256 .
1.345     nicm      104: .It Fl C
1.369     nicm      105: Start in control mode (see the
                    106: .Sx CONTROL MODE
                    107: section).
1.345     nicm      108: Given twice
                    109: .Xo ( Fl CC ) Xc
                    110: disables echo.
1.91      nicm      111: .It Fl c Ar shell-command
                    112: Execute
                    113: .Ar shell-command
                    114: using the default shell.
                    115: If necessary, the
                    116: .Nm
                    117: server will be started to retrieve the
                    118: .Ic default-shell
                    119: option.
1.153     nicm      120: This option is for compatibility with
                    121: .Xr sh 1
                    122: when
                    123: .Nm
                    124: is used as a login shell.
1.1       nicm      125: .It Fl f Ar file
                    126: Specify an alternative configuration file.
                    127: By default,
                    128: .Nm
1.26      nicm      129: loads the system configuration file from
                    130: .Pa /etc/tmux.conf ,
                    131: if present, then looks for a user configuration file at
1.1       nicm      132: .Pa ~/.tmux.conf .
1.306     nicm      133: .Pp
1.1       nicm      134: The configuration file is a set of
                    135: .Nm
                    136: commands which are executed in sequence when the server is first started.
1.306     nicm      137: .Nm
                    138: loads configuration files once when the server process has started.
                    139: The
                    140: .Ic source-file
                    141: command may be used to load a file later.
1.61      nicm      142: .Pp
                    143: .Nm
1.306     nicm      144: shows any error messages from commands in configuration files in the first
                    145: session created, and continues to process the rest of the configuration file.
1.1       nicm      146: .It Fl L Ar socket-name
                    147: .Nm
                    148: stores the server socket in a directory under
1.455     nicm      149: .Ev TMUX_TMPDIR
                    150: or
1.208     nicm      151: .Pa /tmp
1.455     nicm      152: if it is unset.
1.355     nicm      153: The default socket is named
1.1       nicm      154: .Em default .
                    155: This option allows a different socket name to be specified, allowing several
                    156: independent
                    157: .Nm
                    158: servers to be run.
                    159: Unlike
                    160: .Fl S
                    161: a full path is not necessary: the sockets are all created in the same
                    162: directory.
1.2       nicm      163: .Pp
                    164: If the socket is accidentally removed, the
1.6       jmc       165: .Dv SIGUSR1
1.2       nicm      166: signal may be sent to the
                    167: .Nm
1.422     nicm      168: server process to recreate it (note that this will fail if any parent
                    169: directories are missing).
1.166     sobrado   170: .It Fl l
                    171: Behave as a login shell.
                    172: This flag currently has no effect and is for compatibility with other shells
                    173: when using tmux as a login shell.
1.1       nicm      174: .It Fl S Ar socket-path
                    175: Specify a full alternative path to the server socket.
                    176: If
                    177: .Fl S
                    178: is specified, the default socket directory is not used and any
                    179: .Fl L
                    180: flag is ignored.
                    181: .It Fl u
1.644     schwarze  182: Write UTF-8 output to the terminal even if the first environment
                    183: variable of
1.14      nicm      184: .Ev LC_ALL ,
1.644     schwarze  185: .Ev LC_CTYPE ,
                    186: or
1.2       nicm      187: .Ev LANG
1.644     schwarze  188: that is set does not contain
                    189: .Qq UTF-8
                    190: or
                    191: .Qq UTF8 .
1.744     nicm      192: This is equivalent to
                    193: .Fl T Ar UTF-8 .
                    194: .It Fl T Ar features
                    195: Set terminal features for the client.
                    196: This is a comma-separated list of features.
                    197: See the
                    198: .Ic terminal-features
                    199: option.
1.1       nicm      200: .It Fl v
                    201: Request verbose logging.
                    202: Log messages will be saved into
                    203: .Pa tmux-client-PID.log
                    204: and
                    205: .Pa tmux-server-PID.log
                    206: files in the current directory, where
                    207: .Em PID
1.6       jmc       208: is the PID of the server or client process.
1.558     nicm      209: If
                    210: .Fl v
                    211: is specified twice, an additional
                    212: .Pa tmux-out-PID.log
                    213: file is generated with a copy of everything
                    214: .Nm
                    215: writes to the terminal.
                    216: .Pp
                    217: The
                    218: .Dv SIGUSR2
                    219: signal may be sent to the
                    220: .Nm
                    221: server process to toggle logging between on (as if
                    222: .Fl v
                    223: was given) and off.
1.708     nicm      224: .It Fl V
                    225: Report the
                    226: .Nm
                    227: version.
1.1       nicm      228: .It Ar command Op Ar flags
                    229: This specifies one of a set of commands used to control
                    230: .Nm ,
1.6       jmc       231: as described in the following sections.
1.59      jmc       232: If no commands are specified, the
1.1       nicm      233: .Ic new-session
                    234: command is assumed.
1.57      jmc       235: .El
1.627     nicm      236: .Sh DEFAULT KEY BINDINGS
1.64      nicm      237: .Nm
                    238: may be controlled from an attached client by using a key combination of a
                    239: prefix key,
                    240: .Ql C-b
                    241: (Ctrl-b) by default, followed by a command key.
                    242: .Pp
1.172     nicm      243: The default command key bindings are:
1.64      nicm      244: .Pp
1.171     nicm      245: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
                    246: .It C-b
                    247: Send the prefix key (C-b) through to the application.
                    248: .It C-o
                    249: Rotate the panes in the current window forwards.
                    250: .It C-z
                    251: Suspend the
                    252: .Nm
                    253: client.
                    254: .It !
                    255: Break the current pane out of the window.
                    256: .It \&"
1.625     nicm      257: .\" "
1.171     nicm      258: Split the current pane into two, top and bottom.
                    259: .It #
                    260: List all paste buffers.
1.236     nicm      261: .It $
                    262: Rename the current session.
1.171     nicm      263: .It %
                    264: Split the current pane into two, left and right.
                    265: .It &
                    266: Kill the current window.
                    267: .It '
                    268: Prompt for a window index to select.
1.412     nicm      269: .It \&(
                    270: Switch the attached client to the previous session.
                    271: .It \&)
                    272: Switch the attached client to the next session.
1.171     nicm      273: .It ,
                    274: Rename the current window.
                    275: .It -
                    276: Delete the most recently copied buffer of text.
                    277: .It .
                    278: Prompt for an index to move the current window.
                    279: .It 0 to 9
                    280: Select windows 0 to 9.
                    281: .It :
                    282: Enter the
                    283: .Nm
                    284: command prompt.
1.187     nicm      285: .It ;
                    286: Move to the previously active pane.
1.178     nicm      287: .It =
                    288: Choose which buffer to paste interactively from a list.
1.171     nicm      289: .It \&?
                    290: List all key bindings.
                    291: .It D
                    292: Choose a client to detach.
1.412     nicm      293: .It L
                    294: Switch the attached client back to the last session.
1.182     jmc       295: .It \&[
1.171     nicm      296: Enter copy mode to copy text or view the history.
1.182     jmc       297: .It \&]
1.171     nicm      298: Paste the most recently copied buffer of text.
1.64      nicm      299: .It c
1.65      nicm      300: Create a new window.
1.64      nicm      301: .It d
1.65      nicm      302: Detach the current client.
1.171     nicm      303: .It f
                    304: Prompt to search for text in open windows.
                    305: .It i
                    306: Display some information about the current window.
1.64      nicm      307: .It l
1.65      nicm      308: Move to the previously selected window.
1.684     nicm      309: .It m
                    310: Mark the current pane (see
                    311: .Ic select-pane
                    312: .Fl m ) .
                    313: .It M
                    314: Clear the marked pane.
1.64      nicm      315: .It n
1.65      nicm      316: Change to the next window.
1.171     nicm      317: .It o
                    318: Select the next pane in the current window.
1.64      nicm      319: .It p
1.65      nicm      320: Change to the previous window.
1.171     nicm      321: .It q
                    322: Briefly display pane indexes.
                    323: .It r
                    324: Force redraw of the attached client.
                    325: .It s
                    326: Select a new session for the attached client interactively.
                    327: .It t
                    328: Show the time.
                    329: .It w
                    330: Choose the current window interactively.
                    331: .It x
                    332: Kill the current pane.
1.412     nicm      333: .It z
                    334: Toggle zoom state of the current pane.
1.171     nicm      335: .It {
                    336: Swap the current pane with the previous pane.
                    337: .It }
                    338: Swap the current pane with the next pane.
                    339: .It ~
                    340: Show previous messages from
                    341: .Nm ,
                    342: if any.
                    343: .It Page Up
                    344: Enter copy mode and scroll one page up.
                    345: .It Up, Down
                    346: .It Left, Right
                    347: Change to the pane above, below, to the left, or to the right of the current
                    348: pane.
                    349: .It M-1 to M-5
                    350: Arrange panes in one of the five preset layouts: even-horizontal,
                    351: even-vertical, main-horizontal, main-vertical, or tiled.
1.412     nicm      352: .It Space
                    353: Arrange the current window in the next preset layout.
1.171     nicm      354: .It M-n
                    355: Move to the next window with a bell or activity marker.
                    356: .It M-o
                    357: Rotate the panes in the current window backwards.
                    358: .It M-p
                    359: Move to the previous window with a bell or activity marker.
                    360: .It C-Up, C-Down
                    361: .It C-Left, C-Right
                    362: Resize the current pane in steps of one cell.
                    363: .It M-Up, M-Down
                    364: .It M-Left, M-Right
                    365: Resize the current pane in steps of five cells.
1.64      nicm      366: .El
                    367: .Pp
                    368: Key bindings may be changed with the
                    369: .Ic bind-key
                    370: and
                    371: .Ic unbind-key
                    372: commands.
1.651     nicm      373: .Sh COMMAND PARSING AND EXECUTION
                    374: .Nm
                    375: supports a large number of commands which can be used to control its
                    376: behaviour.
                    377: Each command is named and can accept zero or more flags and arguments.
                    378: They may be bound to a key with the
                    379: .Ic bind-key
                    380: command or run from the shell prompt, a shell script, a configuration file or
                    381: the command prompt.
                    382: For example, the same
                    383: .Ic set-option
                    384: command run from the shell prompt, from
                    385: .Pa ~/.tmux.conf
                    386: and bound to a key may look like:
                    387: .Bd -literal -offset indent
                    388: $ tmux set-option -g status-style bg=cyan
                    389:
                    390: set-option -g status-style bg=cyan
                    391:
                    392: bind-key C set-option -g status-style bg=cyan
                    393: .Ed
                    394: .Pp
                    395: Here, the command name is
                    396: .Ql set-option ,
                    397: .Ql Fl g
                    398: is a flag and
                    399: .Ql status-style
                    400: and
                    401: .Ql bg=cyan
                    402: are arguments.
                    403: .Pp
                    404: .Nm
                    405: distinguishes between command parsing and execution.
                    406: In order to execute a command,
                    407: .Nm
                    408: needs it to be split up into its name and arguments.
                    409: This is command parsing.
                    410: If a command is run from the shell, the shell parses it; from inside
                    411: .Nm
                    412: or from a configuration file,
                    413: .Nm
                    414: does.
                    415: Examples of when
                    416: .Nm
                    417: parses commands are:
                    418: .Bl -dash -offset indent
                    419: .It
                    420: in a configuration file;
                    421: .It
                    422: typed at the command prompt (see
                    423: .Ic command-prompt ) ;
                    424: .It
                    425: given to
                    426: .Ic bind-key ;
                    427: .It
                    428: passed as arguments to
                    429: .Ic if-shell
                    430: or
                    431: .Ic confirm-before .
                    432: .El
                    433: .Pp
                    434: To execute commands, each client has a
                    435: .Ql command queue .
                    436: A global command queue not attached to any client is used on startup
                    437: for configuration files like
                    438: .Pa ~/.tmux.conf .
                    439: Parsed commands added to the queue are executed in order.
                    440: Some commands, like
                    441: .Ic if-shell
                    442: and
                    443: .Ic confirm-before ,
                    444: parse their argument to create a new command which is inserted immediately
                    445: after themselves.
                    446: This means that arguments can be parsed twice or more - once when the parent command (such as
                    447: .Ic if-shell )
                    448: is parsed and again when it parses and executes its command.
                    449: Commands like
                    450: .Ic if-shell ,
                    451: .Ic run-shell
                    452: and
                    453: .Ic display-panes
                    454: stop execution of subsequent commands on the queue until something happens -
                    455: .Ic if-shell
                    456: and
                    457: .Ic run-shell
                    458: until a shell command finishes and
                    459: .Ic display-panes
                    460: until a key is pressed.
                    461: For example, the following commands:
                    462: .Bd -literal -offset indent
                    463: new-session; new-window
                    464: if-shell "true" "split-window"
                    465: kill-session
                    466: .Ed
                    467: .Pp
                    468: Will execute
                    469: .Ic new-session ,
                    470: .Ic new-window ,
                    471: .Ic if-shell ,
                    472: the shell command
                    473: .Xr true 1 ,
1.671     nicm      474: .Ic split-window
1.651     nicm      475: and
                    476: .Ic kill-session
                    477: in that order.
                    478: .Pp
                    479: The
                    480: .Sx COMMANDS
                    481: section lists the
                    482: .Nm
                    483: commands and their arguments.
                    484: .Sh PARSING SYNTAX
                    485: This section describes the syntax of commands parsed by
                    486: .Nm ,
                    487: for example in a configuration file or at the command prompt.
1.671     nicm      488: Note that when commands are entered into the shell, they are parsed by the shell
1.651     nicm      489: - see for example
                    490: .Xr ksh 1
                    491: or
                    492: .Xr csh 1 .
                    493: .Pp
                    494: Each command is terminated by a newline or a semicolon (;).
                    495: Commands separated by semicolons together form a
                    496: .Ql command sequence
                    497: - if a command in the sequence encounters an error, no subsequent commands are
                    498: executed.
                    499: .Pp
                    500: Comments are marked by the unquoted # character - any remaining text after a
                    501: comment is ignored until the end of the line.
                    502: .Pp
                    503: If the last character of a line is \e, the line is joined with the following
                    504: line (the \e and the newline are completely removed).
                    505: This is called line continuation and applies both inside and outside quoted
1.656     nicm      506: strings and in comments, but not inside braces.
1.651     nicm      507: .Pp
1.655     nicm      508: Command arguments may be specified as strings surrounded by single (') quotes,
                    509: double quotes (") or braces ({}).
1.651     nicm      510: .\" "
                    511: This is required when the argument contains any special character.
1.655     nicm      512: Single and double quoted strings cannot span multiple lines except with line
                    513: continuation.
                    514: Braces can span multiple lines.
1.651     nicm      515: .Pp
                    516: Outside of quotes and inside double quotes, these replacements are performed:
                    517: .Bl -dash -offset indent
                    518: .It
                    519: Environment variables preceded by $ are replaced with their value from the
                    520: global environment (see the
                    521: .Sx GLOBAL AND SESSION ENVIRONMENT
                    522: section).
                    523: .It
                    524: A leading ~ or ~user is expanded to the home directory of the current or
                    525: specified user.
                    526: .It
                    527: \euXXXX or \euXXXXXXXX is replaced by the Unicode codepoint corresponding to
                    528: the given four or eight digit hexadecimal number.
                    529: .It
                    530: When preceded (escaped) by a \e, the following characters are replaced: \ee by
                    531: the escape character; \er by a carriage return; \en by a newline; and \et by a
                    532: tab.
1.660     nicm      533: .It
                    534: \eooo is replaced by a character of the octal value ooo.
                    535: Three octal digits are required, for example \e001.
                    536: The largest valid character is \e377.
                    537: .It
1.651     nicm      538: Any other characters preceded by \e are replaced by themselves (that is, the \e
                    539: is removed) and are not treated as having any special meaning - so for example
                    540: \e; will not mark a command sequence and \e$ will not expand an environment
                    541: variable.
                    542: .El
                    543: .Pp
1.655     nicm      544: Braces are similar to single quotes in that the text inside is taken literally
1.656     nicm      545: without any replacements but this also includes line continuation.
                    546: Braces can span multiple lines in which case a literal newline is included in the
                    547: string.
1.655     nicm      548: They are designed to avoid the need for additional escaping when passing a group
                    549: of
                    550: .Nm
                    551: or shell commands as an argument (for example to
                    552: .Ic if-shell
                    553: or
                    554: .Ic pipe-pane ) .
                    555: These two examples produce an identical command - note that no escaping is
                    556: needed when using {}:
                    557: .Bd -literal -offset indent
                    558: if-shell true {
                    559:     display -p 'brace-dollar-foo: }$foo'
                    560: }
                    561:
                    562: if-shell true "\en    display -p 'brace-dollar-foo: }\e$foo'\en"
                    563: .Ed
                    564: .Pp
                    565: Braces may be enclosed inside braces, for example:
                    566: .Bd -literal -offset indent
                    567: bind x if-shell "true" {
                    568:     if-shell "true" {
1.706     nicm      569:         display "true!"
1.655     nicm      570:     }
                    571: }
                    572: .Ed
                    573: .Pp
1.651     nicm      574: Environment variables may be set by using the syntax
                    575: .Ql name=value ,
                    576: for example
                    577: .Ql HOME=/home/user .
                    578: Variables set during parsing are added to the global environment.
1.728     nicm      579: A hidden variable may be set with
                    580: .Ql %hidden ,
                    581: for example:
                    582: .Bd -literal -offset indent
                    583: %hidden MYVAR=42
                    584: .Ed
                    585: .Pp
                    586: Hidden variables are not passed to the environment of processes created
                    587: by tmux.
                    588: See the
                    589: .Sx GLOBAL AND SESSION ENVIRONMENT
                    590: section.
1.651     nicm      591: .Pp
                    592: Commands may be parsed conditionally by surrounding them with
                    593: .Ql %if ,
                    594: .Ql %elif ,
                    595: .Ql %else
                    596: and
                    597: .Ql %endif .
                    598: The argument to
                    599: .Ql %if
                    600: and
                    601: .Ql %elif
                    602: is expanded as a format (see
                    603: .Sx FORMATS )
                    604: and if it evaluates to false (zero or empty), subsequent text is ignored until
                    605: the closing
                    606: .Ql %elif ,
                    607: .Ql %else
                    608: or
                    609: .Ql %endif .
                    610: For example:
                    611: .Bd -literal -offset indent
1.666     nicm      612: %if "#{==:#{host},myhost}"
1.651     nicm      613: set -g status-style bg=red
1.666     nicm      614: %elif "#{==:#{host},myotherhost}"
1.651     nicm      615: set -g status-style bg=green
                    616: %else
                    617: set -g status-style bg=blue
                    618: %endif
                    619: .Ed
                    620: .Pp
                    621: Will change the status line to red if running on
                    622: .Ql myhost ,
                    623: green if running on
                    624: .Ql myotherhost ,
                    625: or blue if running on another host.
                    626: Conditionals may be given on one line, for example:
                    627: .Bd -literal -offset indent
                    628: %if #{==:#{host},myhost} set -g status-style bg=red %endif
                    629: .Ed
1.57      jmc       630: .Sh COMMANDS
1.651     nicm      631: This section describes the commands supported by
1.57      jmc       632: .Nm .
                    633: Most commands accept the optional
                    634: .Fl t
1.432     nicm      635: (and sometimes
                    636: .Fl s )
1.57      jmc       637: argument with one of
                    638: .Ar target-client ,
1.678     nicm      639: .Ar target-session ,
1.57      jmc       640: .Ar target-window ,
                    641: or
                    642: .Ar target-pane .
                    643: These specify the client, session, window or pane which a command should affect.
1.423     nicm      644: .Pp
1.57      jmc       645: .Ar target-client
1.540     nicm      646: should be the name of the client,
                    647: typically the
1.57      jmc       648: .Xr pty 4
                    649: file to which the client is connected, for example either of
                    650: .Pa /dev/ttyp1
                    651: or
                    652: .Pa ttyp1
                    653: for the client attached to
                    654: .Pa /dev/ttyp1 .
1.423     nicm      655: If no client is specified,
                    656: .Nm
                    657: attempts to work out the client currently in use; if that fails, an error is
                    658: reported.
1.57      jmc       659: Clients may be listed with the
                    660: .Ic list-clients
                    661: command.
1.1       nicm      662: .Pp
1.57      jmc       663: .Ar target-session
1.423     nicm      664: is tried as, in order:
                    665: .Bl -enum -offset Ds
                    666: .It
                    667: A session ID prefixed with a $.
                    668: .It
                    669: An exact name of a session (as listed by the
1.57      jmc       670: .Ic list-sessions
1.423     nicm      671: command).
                    672: .It
                    673: The start of a session name, for example
                    674: .Ql mysess
                    675: would match a session named
                    676: .Ql mysession .
                    677: .It
                    678: An
1.57      jmc       679: .Xr fnmatch 3
1.423     nicm      680: pattern which is matched against the session name.
                    681: .El
                    682: .Pp
1.441     nicm      683: If the session name is prefixed with an
                    684: .Ql = ,
1.435     nicm      685: only an exact match is accepted (so
                    686: .Ql =mysess
                    687: will only match exactly
                    688: .Ql mysess ,
                    689: not
                    690: .Ql mysession ) .
1.441     nicm      691: .Pp
1.423     nicm      692: If a single session is found, it is used as the target session; multiple matches
1.57      jmc       693: produce an error.
                    694: If a session is omitted, the current session is used if available; if no
1.117     nicm      695: current session is available, the most recently used is chosen.
1.1       nicm      696: .Pp
1.57      jmc       697: .Ar target-window
1.472     nicm      698: (or
                    699: .Ar src-window
                    700: or
                    701: .Ar dst-window )
1.57      jmc       702: specifies a window in the form
                    703: .Em session Ns \&: Ns Em window .
                    704: .Em session
                    705: follows the same rules as for
                    706: .Ar target-session ,
                    707: and
                    708: .Em window
1.423     nicm      709: is looked for in order as:
                    710: .Bl -enum -offset Ds
                    711: .It
                    712: A special token, listed below.
                    713: .It
                    714: A window index, for example
                    715: .Ql mysession:1
                    716: is window 1 in session
                    717: .Ql mysession .
                    718: .It
                    719: A window ID, such as @1.
                    720: .It
                    721: An exact window name, such as
                    722: .Ql mysession:mywindow .
                    723: .It
                    724: The start of a window name, such as
                    725: .Ql mysession:mywin .
                    726: .It
                    727: As an
1.57      jmc       728: .Xr fnmatch 3
1.423     nicm      729: pattern matched against the window name.
                    730: .El
                    731: .Pp
1.435     nicm      732: Like sessions, a
                    733: .Ql =
                    734: prefix will do an exact match only.
1.57      jmc       735: An empty window name specifies the next unused index if appropriate (for
                    736: example the
                    737: .Ic new-window
                    738: and
                    739: .Ic link-window
                    740: commands)
                    741: otherwise the current window in
                    742: .Em session
                    743: is chosen.
1.423     nicm      744: .Pp
1.424     nicm      745: The following special tokens are available to indicate particular windows.
                    746: Each has a single-character alternative form.
1.423     nicm      747: .Bl -column "XXXXXXXXXX" "X"
                    748: .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
                    749: .It Li "{start}" Ta "^" Ta "The lowest-numbered window"
                    750: .It Li "{end}" Ta "$" Ta "The highest-numbered window"
                    751: .It Li "{last}" Ta "!" Ta "The last (previously current) window"
                    752: .It Li "{next}" Ta "+" Ta "The next window by number"
                    753: .It Li "{previous}" Ta "-" Ta "The previous window by number"
                    754: .El
1.1       nicm      755: .Pp
1.57      jmc       756: .Ar target-pane
1.472     nicm      757: (or
                    758: .Ar src-pane
                    759: or
                    760: .Ar dst-pane )
                    761: may be a pane ID or takes a similar form to
1.57      jmc       762: .Ar target-window
1.423     nicm      763: but with the optional addition of a period followed by a pane index or pane ID,
                    764: for example:
                    765: .Ql mysession:mywindow.1 .
1.57      jmc       766: If the pane index is omitted, the currently active pane in the specified
                    767: window is used.
1.423     nicm      768: The following special tokens are available for the pane index:
                    769: .Bl -column "XXXXXXXXXXXXXX" "X"
                    770: .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
                    771: .It Li "{last}" Ta "!" Ta "The last (previously active) pane"
                    772: .It Li "{next}" Ta "+" Ta "The next pane by number"
                    773: .It Li "{previous}" Ta "-" Ta "The previous pane by number"
                    774: .It Li "{top}" Ta "" Ta "The top pane"
                    775: .It Li "{bottom}" Ta "" Ta "The bottom pane"
                    776: .It Li "{left}" Ta "" Ta "The leftmost pane"
                    777: .It Li "{right}" Ta "" Ta "The rightmost pane"
                    778: .It Li "{top-left}" Ta "" Ta "The top-left pane"
                    779: .It Li "{top-right}" Ta "" Ta "The top-right pane"
                    780: .It Li "{bottom-left}" Ta "" Ta "The bottom-left pane"
                    781: .It Li "{bottom-right}" Ta "" Ta "The bottom-right pane"
1.447     nicm      782: .It Li "{up-of}" Ta "" Ta "The pane above the active pane"
                    783: .It Li "{down-of}" Ta "" Ta "The pane below the active pane"
                    784: .It Li "{left-of}" Ta "" Ta "The pane to the left of the active pane"
                    785: .It Li "{right-of}" Ta "" Ta "The pane to the right of the active pane"
1.423     nicm      786: .El
1.177     nicm      787: .Pp
1.423     nicm      788: The tokens
1.177     nicm      789: .Ql +
                    790: and
                    791: .Ql -
                    792: may be followed by an offset, for example:
                    793: .Bd -literal -offset indent
                    794: select-window -t:+2
                    795: .Ed
                    796: .Pp
1.432     nicm      797: In addition,
                    798: .Em target-session ,
                    799: .Em target-window
                    800: or
                    801: .Em target-pane
                    802: may consist entirely of the token
                    803: .Ql {mouse}
                    804: (alternative form
                    805: .Ql = )
1.678     nicm      806: to specify the session, window or pane where the most recent mouse event occurred
1.432     nicm      807: (see the
                    808: .Sx MOUSE SUPPORT
                    809: section)
                    810: or
                    811: .Ql {marked}
                    812: (alternative form
                    813: .Ql ~ )
                    814: to specify the marked pane (see
                    815: .Ic select-pane
                    816: .Fl m ) .
                    817: .Pp
1.423     nicm      818: Sessions, window and panes are each numbered with a unique ID; session IDs are
                    819: prefixed with a
                    820: .Ql $ ,
                    821: windows with a
                    822: .Ql @ ,
                    823: and panes with a
                    824: .Ql % .
                    825: These are unique and are unchanged for the life of the session, window or pane
                    826: in the
1.212     nicm      827: .Nm
1.423     nicm      828: server.
                    829: The pane ID is passed to the child process of the pane in the
1.212     nicm      830: .Ev TMUX_PANE
                    831: environment variable.
1.423     nicm      832: IDs may be displayed using the
                    833: .Ql session_id ,
                    834: .Ql window_id ,
                    835: or
                    836: .Ql pane_id
                    837: formats (see the
                    838: .Sx FORMATS
                    839: section) and the
                    840: .Ic display-message ,
                    841: .Ic list-sessions ,
                    842: .Ic list-windows
                    843: or
                    844: .Ic list-panes
                    845: commands.
1.15      jmc       846: .Pp
1.153     nicm      847: .Ar shell-command
                    848: arguments are
                    849: .Xr sh 1
                    850: commands.
1.394     nicm      851: This may be a single argument passed to the shell, for example:
1.153     nicm      852: .Bd -literal -offset indent
                    853: new-window 'vi /etc/passwd'
                    854: .Ed
1.394     nicm      855: .Pp
                    856: Will run:
                    857: .Bd -literal -offset indent
                    858: /bin/sh -c 'vi /etc/passwd'
                    859: .Ed
                    860: .Pp
                    861: Additionally, the
                    862: .Ic new-window ,
                    863: .Ic new-session ,
                    864: .Ic split-window ,
                    865: .Ic respawn-window
                    866: and
                    867: .Ic respawn-pane
                    868: commands allow
                    869: .Ar shell-command
                    870: to be given as multiple arguments and executed directly (without
                    871: .Ql sh -c ) .
                    872: This can avoid issues with shell quoting.
                    873: For example:
                    874: .Bd -literal -offset indent
                    875: $ tmux new-window vi /etc/passwd
                    876: .Ed
                    877: .Pp
                    878: Will run
                    879: .Xr vi 1
                    880: directly without invoking the shell.
1.153     nicm      881: .Pp
                    882: .Ar command
                    883: .Op Ar arguments
                    884: refers to a
                    885: .Nm
1.655     nicm      886: command, either passed with the command and arguments separately, for example:
1.153     nicm      887: .Bd -literal -offset indent
1.629     nicm      888: bind-key F1 set-option status off
1.153     nicm      889: .Ed
                    890: .Pp
1.655     nicm      891: Or passed as a single string argument in
                    892: .Pa .tmux.conf ,
                    893: for example:
1.153     nicm      894: .Bd -literal -offset indent
1.655     nicm      895: bind-key F1 { set-option status off }
1.153     nicm      896: .Ed
                    897: .Pp
                    898: Example
                    899: .Nm
                    900: commands include:
1.13      nicm      901: .Bd -literal -offset indent
1.57      jmc       902: refresh-client -t/dev/ttyp2
                    903:
                    904: rename-session -tfirst newname
                    905:
1.668     nicm      906: set-option -wt:0 monitor-activity on
1.57      jmc       907:
                    908: new-window ; split-window -d
1.244     nicm      909:
                    910: bind-key R source-file ~/.tmux.conf \e; \e
                    911:        display-message "source-file done"
1.13      nicm      912: .Ed
1.153     nicm      913: .Pp
                    914: Or from
                    915: .Xr sh 1 :
                    916: .Bd -literal -offset indent
                    917: $ tmux kill-window -t :1
                    918:
1.159     jmc       919: $ tmux new-window \e; split-window -d
1.153     nicm      920:
1.159     jmc       921: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153     nicm      922: .Ed
1.57      jmc       923: .Sh CLIENTS AND SESSIONS
1.153     nicm      924: The
                    925: .Nm
                    926: server manages clients, sessions, windows and panes.
                    927: Clients are attached to sessions to interact with them, either
                    928: when they are created with the
                    929: .Ic new-session
                    930: command, or later with the
                    931: .Ic attach-session
                    932: command.
1.188     nicm      933: Each session has one or more windows
1.153     nicm      934: .Em linked
                    935: into it.
                    936: Windows may be linked to multiple sessions and are made up of one or
                    937: more panes,
                    938: each of which contains a pseudo terminal.
                    939: Commands for creating, linking and otherwise manipulating windows
                    940: are covered
                    941: in the
                    942: .Sx WINDOWS AND PANES
                    943: section.
                    944: .Pp
                    945: The following commands are available to manage clients and sessions:
1.57      jmc       946: .Bl -tag -width Ds
                    947: .It Xo Ic attach-session
1.662     nicm      948: .Op Fl dErx
1.372     nicm      949: .Op Fl c Ar working-directory
1.57      jmc       950: .Op Fl t Ar target-session
                    951: .Xc
                    952: .D1 (alias: Ic attach )
                    953: If run from outside
                    954: .Nm ,
                    955: create a new client in the current terminal and attach it to
                    956: .Ar target-session .
                    957: If used from inside, switch the current client.
                    958: If
                    959: .Fl d
                    960: is specified, any other clients attached to the session are detached.
1.662     nicm      961: If
                    962: .Fl x
1.703     nicm      963: is given, send
                    964: .Dv SIGHUP
                    965: to the parent process of the client as well as
1.662     nicm      966: detaching the client, typically causing it to exit.
1.148     nicm      967: .Fl r
                    968: signifies the client is read-only (only keys bound to the
                    969: .Ic detach-client
1.242     nicm      970: or
                    971: .Ic switch-client
                    972: commands have any effect)
1.13      nicm      973: .Pp
1.57      jmc       974: If no server is started,
                    975: .Ic attach-session
                    976: will attempt to start it; this will fail unless sessions are created in the
                    977: configuration file.
1.217     nicm      978: .Pp
                    979: The
                    980: .Ar target-session
                    981: rules for
                    982: .Ic attach-session
                    983: are slightly adjusted: if
                    984: .Nm
                    985: needs to select the most recently used session, it will prefer the most
                    986: recently used
                    987: .Em unattached
                    988: session.
1.372     nicm      989: .Pp
                    990: .Fl c
                    991: will set the session working directory (used for new windows) to
                    992: .Ar working-directory .
1.436     nicm      993: .Pp
                    994: If
                    995: .Fl E
1.480     nicm      996: is used, the
1.436     nicm      997: .Ic update-environment
                    998: option will not be applied.
1.211     nicm      999: .It Xo Ic detach-client
1.463     nicm     1000: .Op Fl aP
1.525     nicm     1001: .Op Fl E Ar shell-command
1.219     nicm     1002: .Op Fl s Ar target-session
1.211     nicm     1003: .Op Fl t Ar target-client
                   1004: .Xc
1.57      jmc      1005: .D1 (alias: Ic detach )
1.218     nicm     1006: Detach the current client if bound to a key, the client specified with
                   1007: .Fl t ,
1.258     jmc      1008: or all clients currently attached to the session specified by
1.218     nicm     1009: .Fl s .
1.296     nicm     1010: The
                   1011: .Fl a
                   1012: option kills all but the client given with
                   1013: .Fl t .
1.211     nicm     1014: If
                   1015: .Fl P
1.703     nicm     1016: is given, send
                   1017: .Dv SIGHUP
                   1018: to the parent process of the client, typically causing it
1.211     nicm     1019: to exit.
1.525     nicm     1020: With
                   1021: .Fl E ,
                   1022: run
                   1023: .Ar shell-command
                   1024: to replace the client.
1.57      jmc      1025: .It Ic has-session Op Fl t Ar target-session
                   1026: .D1 (alias: Ic has )
                   1027: Report an error and exit with 1 if the specified session does not exist.
                   1028: If it does exist, exit with 0.
                   1029: .It Ic kill-server
                   1030: Kill the
1.1       nicm     1031: .Nm
1.57      jmc      1032: server and clients and destroy all sessions.
1.369     nicm     1033: .It Xo Ic kill-session
1.464     nicm     1034: .Op Fl aC
1.297     nicm     1035: .Op Fl t Ar target-session
1.369     nicm     1036: .Xc
1.57      jmc      1037: Destroy the given session, closing any windows linked to it and no other
                   1038: sessions, and detaching all clients attached to it.
1.297     nicm     1039: If
                   1040: .Fl a
                   1041: is given, all sessions but the specified one is killed.
1.464     nicm     1042: The
                   1043: .Fl C
1.467     nicm     1044: flag clears alerts (bell, activity, or silence) in all windows linked to the
1.464     nicm     1045: session.
1.250     nicm     1046: .It Xo Ic list-clients
                   1047: .Op Fl F Ar format
                   1048: .Op Fl t Ar target-session
                   1049: .Xc
1.57      jmc      1050: .D1 (alias: Ic lsc )
1.221     jmc      1051: List all clients attached to the server.
1.250     nicm     1052: For the meaning of the
                   1053: .Fl F
                   1054: flag, see the
1.252     jmc      1055: .Sx FORMATS
                   1056: section.
1.221     jmc      1057: If
1.220     nicm     1058: .Ar target-session
                   1059: is specified, list only clients connected to that session.
1.489     nicm     1060: .It Xo Ic list-commands
                   1061: .Op Fl F Ar format
1.731     nicm     1062: .Op Ar command
1.489     nicm     1063: .Xc
1.57      jmc      1064: .D1 (alias: Ic lscm )
1.731     nicm     1065: List the syntax of
                   1066: .Ar command
                   1067: or - if omitted - of all commands supported by
1.57      jmc      1068: .Nm .
1.738     nicm     1069: .It Xo Ic list-sessions
                   1070: .Op Fl F Ar format
                   1071: .Op Fl f Ar filter
                   1072: .Xc
1.57      jmc      1073: .D1 (alias: Ic ls )
                   1074: List all sessions managed by the server.
1.247     nicm     1075: .Fl F
1.738     nicm     1076: specifies the format of each line and
                   1077: .Fl f
                   1078: a filter.
                   1079: Only sessions for which the filter is true are shown.
                   1080: See the
1.247     nicm     1081: .Sx FORMATS
                   1082: section.
1.175     nicm     1083: .It Ic lock-client Op Fl t Ar target-client
                   1084: .D1 (alias: Ic lockc )
1.92      nicm     1085: Lock
                   1086: .Ar target-client ,
                   1087: see the
                   1088: .Ic lock-server
                   1089: command.
1.175     nicm     1090: .It Ic lock-session Op Fl t Ar target-session
                   1091: .D1 (alias: Ic locks )
1.92      nicm     1092: Lock all clients attached to
                   1093: .Ar target-session .
1.57      jmc      1094: .It Xo Ic new-session
1.662     nicm     1095: .Op Fl AdDEPX
1.371     nicm     1096: .Op Fl c Ar start-directory
1.760     nicm     1097: .Op Fl e Ar environment
1.351     nicm     1098: .Op Fl F Ar format
1.57      jmc      1099: .Op Fl n Ar window-name
                   1100: .Op Fl s Ar session-name
1.536     nicm     1101: .Op Fl t Ar group-name
1.210     nicm     1102: .Op Fl x Ar width
                   1103: .Op Fl y Ar height
1.153     nicm     1104: .Op Ar shell-command
1.57      jmc      1105: .Xc
                   1106: .D1 (alias: Ic new )
                   1107: Create a new session with name
                   1108: .Ar session-name .
1.153     nicm     1109: .Pp
1.57      jmc      1110: The new session is attached to the current terminal unless
                   1111: .Fl d
                   1112: is given.
                   1113: .Ar window-name
1.1       nicm     1114: and
1.153     nicm     1115: .Ar shell-command
                   1116: are the name of and shell command to execute in the initial window.
1.552     nicm     1117: With
                   1118: .Fl d ,
1.642     nicm     1119: the initial size comes from the global
                   1120: .Ic default-size
                   1121: option;
1.210     nicm     1122: .Fl x
                   1123: and
                   1124: .Fl y
1.602     nicm     1125: can be used to specify a different size.
                   1126: .Ql -
                   1127: uses the size of the current client if any.
1.642     nicm     1128: If
                   1129: .Fl x
                   1130: or
                   1131: .Fl y
                   1132: is given, the
                   1133: .Ic default-size
                   1134: option is set for the session.
1.68      nicm     1135: .Pp
                   1136: If run from a terminal, any
                   1137: .Xr termios 4
                   1138: special characters are saved and used for new windows in the new session.
1.338     nicm     1139: .Pp
                   1140: The
                   1141: .Fl A
                   1142: flag makes
                   1143: .Ic new-session
                   1144: behave like
                   1145: .Ic attach-session
                   1146: if
                   1147: .Ar session-name
1.416     nicm     1148: already exists; in this case,
1.338     nicm     1149: .Fl D
                   1150: behaves like
                   1151: .Fl d
1.662     nicm     1152: to
                   1153: .Ic attach-session ,
                   1154: and
                   1155: .Fl X
                   1156: behaves like
                   1157: .Fl x
1.338     nicm     1158: to
                   1159: .Ic attach-session .
1.101     nicm     1160: .Pp
                   1161: If
                   1162: .Fl t
1.536     nicm     1163: is given, it specifies a
                   1164: .Ic session group .
                   1165: Sessions in the same group share the same set of windows - new windows are
1.537     nicm     1166: linked to all sessions in the group and any windows closed removed from all
1.536     nicm     1167: sessions.
1.101     nicm     1168: The current and previous window and any session options remain independent and
1.536     nicm     1169: any session in a group may be killed without affecting the others.
                   1170: The
                   1171: .Ar group-name
                   1172: argument may be:
                   1173: .Bl -enum -width Ds
                   1174: .It
                   1175: the name of an existing group, in which case the new session is added to that
                   1176: group;
                   1177: .It
                   1178: the name of an existing session - the new session is added to the same group
                   1179: as that session, creating a new group if necessary;
                   1180: .It
                   1181: the name for a new group containing only the new session.
                   1182: .El
                   1183: .Pp
1.101     nicm     1184: .Fl n
1.480     nicm     1185: and
1.153     nicm     1186: .Ar shell-command
1.101     nicm     1187: are invalid if
                   1188: .Fl t
                   1189: is used.
1.351     nicm     1190: .Pp
                   1191: The
                   1192: .Fl P
                   1193: option prints information about the new session after it has been created.
                   1194: By default, it uses the format
1.683     nicm     1195: .Ql #{session_name}:\&
1.351     nicm     1196: but a different format may be specified with
                   1197: .Fl F .
1.436     nicm     1198: .Pp
                   1199: If
                   1200: .Fl E
1.480     nicm     1201: is used, the
1.436     nicm     1202: .Ic update-environment
                   1203: option will not be applied.
1.760     nicm     1204: .Fl e
                   1205: takes the form
                   1206: .Ql VARIABLE=value
                   1207: and sets an environment variable for the newly created session; it may be
                   1208: specified multiple times.
1.248     nicm     1209: .It Xo Ic refresh-client
1.613     nicm     1210: .Op Fl cDlLRSU
1.677     nicm     1211: .Op Fl C Ar XxY
                   1212: .Op Fl F Ar flags
1.248     nicm     1213: .Op Fl t Ar target-client
1.613     nicm     1214: .Op Ar adjustment
1.248     nicm     1215: .Xc
1.57      jmc      1216: .D1 (alias: Ic refresh )
                   1217: Refresh the current client if bound to a key, or a single client if one is given
                   1218: with
                   1219: .Fl t .
1.248     nicm     1220: If
                   1221: .Fl S
1.538     nicm     1222: is specified, only update the client's status line.
1.535     nicm     1223: .Pp
1.642     nicm     1224: The
                   1225: .Fl U ,
                   1226: .Fl D ,
                   1227: .Fl L
                   1228: .Fl R ,
                   1229: and
                   1230: .Fl c
                   1231: flags allow the visible portion of a window which is larger than the client
                   1232: to be changed.
                   1233: .Fl U
                   1234: moves the visible part up by
                   1235: .Ar adjustment
                   1236: rows and
                   1237: .Fl D
                   1238: down,
                   1239: .Fl L
                   1240: left by
                   1241: .Ar adjustment
                   1242: columns and
                   1243: .Fl R
                   1244: right.
                   1245: .Fl c
                   1246: returns to tracking the cursor automatically.
                   1247: If
                   1248: .Ar adjustment
                   1249: is omitted, 1 is used.
                   1250: Note that the visible position is a property of the client not of the
                   1251: window, changing the current window in the attached session will reset
                   1252: it.
                   1253: .Pp
1.535     nicm     1254: .Fl C
1.677     nicm     1255: sets the width and height of a control client and
                   1256: .Fl F
                   1257: sets a comma-separated list of flags.
                   1258: Currently the only flag available is
                   1259: .Ql no-output
                   1260: to disable receiving pane output.
                   1261: .Pp
1.612     nicm     1262: .Fl l
                   1263: requests the clipboard from the client using the
                   1264: .Xr xterm 1
                   1265: escape sequence and stores it in a new paste buffer.
1.613     nicm     1266: .Pp
                   1267: .Fl L ,
                   1268: .Fl R ,
                   1269: .Fl U
                   1270: and
                   1271: .Fl D
                   1272: move the visible portion of the window left, right, up or down
                   1273: by
                   1274: .Ar adjustment ,
                   1275: if the window is larger than the client.
                   1276: .Fl c
                   1277: resets so that the position follows the cursor.
                   1278: See the
                   1279: .Ic window-size
                   1280: option.
1.57      jmc      1281: .It Xo Ic rename-session
                   1282: .Op Fl t Ar target-session
                   1283: .Ar new-name
                   1284: .Xc
                   1285: .D1 (alias: Ic rename )
                   1286: Rename the session to
                   1287: .Ar new-name .
1.121     nicm     1288: .It Xo Ic show-messages
1.465     nicm     1289: .Op Fl JT
1.120     nicm     1290: .Op Fl t Ar target-client
                   1291: .Xc
                   1292: .D1 (alias: Ic showmsgs )
1.377     nicm     1293: Show client messages or server information.
1.120     nicm     1294: Any messages displayed on the status line are saved in a per-client message
                   1295: log, up to a maximum of the limit set by the
                   1296: .Ar message-limit
1.384     nicm     1297: server option.
1.377     nicm     1298: With
                   1299: .Fl t ,
                   1300: display the log for
1.120     nicm     1301: .Ar target-client .
1.377     nicm     1302: .Fl J
                   1303: and
                   1304: .Fl T
1.465     nicm     1305: show debugging information about jobs and terminals.
1.488     tim      1306: .It Xo Ic source-file
1.663     nicm     1307: .Op Fl nqv
1.488     tim      1308: .Ar path
1.659     nicm     1309: .Ar ...
1.488     tim      1310: .Xc
1.57      jmc      1311: .D1 (alias: Ic source )
1.659     nicm     1312: Execute commands from one or more files specified by
1.519     nicm     1313: .Ar path
1.659     nicm     1314: (which may be
1.607     kn       1315: .Xr glob 7
1.659     nicm     1316: patterns).
1.488     tim      1317: If
                   1318: .Fl q
                   1319: is given, no error will be returned if
                   1320: .Ar path
                   1321: does not exist.
1.651     nicm     1322: With
                   1323: .Fl n ,
                   1324: the file is parsed but no commands are executed.
1.663     nicm     1325: .Fl v
                   1326: shows the parsed commands and line numbers if possible.
1.57      jmc      1327: .It Ic start-server
                   1328: .D1 (alias: Ic start )
                   1329: Start the
1.1       nicm     1330: .Nm
1.57      jmc      1331: server, if not already running, without creating any sessions.
1.707     nicm     1332: .Pp
                   1333: Note that as by default the
                   1334: .Nm
                   1335: server will exit with no sessions, this is only useful if a session is created in
                   1336: .Pa ~/.tmux.conf ,
                   1337: .Ic exit-empty
                   1338: is turned off, or another command is run as part of the same command sequence.
                   1339: For example:
                   1340: .Bd -literal -offset indent
                   1341: $ tmux start \\; show -g
                   1342: .Ed
1.57      jmc      1343: .It Xo Ic suspend-client
1.202     nicm     1344: .Op Fl t Ar target-client
1.57      jmc      1345: .Xc
                   1346: .D1 (alias: Ic suspendc )
                   1347: Suspend a client by sending
                   1348: .Dv SIGTSTP
                   1349: (tty stop).
                   1350: .It Xo Ic switch-client
1.681     nicm     1351: .Op Fl ElnprZ
1.57      jmc      1352: .Op Fl c Ar target-client
                   1353: .Op Fl t Ar target-session
1.421     nicm     1354: .Op Fl T Ar key-table
1.57      jmc      1355: .Xc
                   1356: .D1 (alias: Ic switchc )
                   1357: Switch the current session for client
                   1358: .Ar target-client
                   1359: to
                   1360: .Ar target-session .
1.635     nicm     1361: As a special case,
                   1362: .Fl t
                   1363: may refer to a pane (a target that contains
1.636     jmc      1364: .Ql \&: ,
                   1365: .Ql \&.
1.635     nicm     1366: or
1.636     jmc      1367: .Ql % ) ,
1.681     nicm     1368: to change session, window and pane.
                   1369: In that case,
                   1370: .Fl Z
                   1371: keeps the window zoomed if it was zoomed.
1.183     nicm     1372: If
1.197     jmc      1373: .Fl l ,
1.183     nicm     1374: .Fl n
                   1375: or
                   1376: .Fl p
1.194     nicm     1377: is used, the client is moved to the last, next or previous session
                   1378: respectively.
1.242     nicm     1379: .Fl r
                   1380: toggles whether a client is read-only (see the
                   1381: .Ic attach-session
                   1382: command).
1.436     nicm     1383: .Pp
                   1384: If
                   1385: .Fl E
                   1386: is used,
                   1387: .Ic update-environment
                   1388: option will not be applied.
1.421     nicm     1389: .Pp
                   1390: .Fl T
1.706     nicm     1391: sets the client's key table; the next key from the client will be interpreted
                   1392: from
1.421     nicm     1393: .Ar key-table .
                   1394: This may be used to configure multiple prefix keys, or to bind commands to
                   1395: sequences of keys.
                   1396: For example, to make typing
                   1397: .Ql abc
                   1398: run the
                   1399: .Ic list-keys
                   1400: command:
                   1401: .Bd -literal -offset indent
                   1402: bind-key -Ttable2 c list-keys
                   1403: bind-key -Ttable1 b switch-client -Ttable2
                   1404: bind-key -Troot   a switch-client -Ttable1
                   1405: .Ed
1.57      jmc      1406: .El
                   1407: .Sh WINDOWS AND PANES
1.679     nicm     1408: Each window displayed by
                   1409: .Nm
                   1410: may be split into one or more
                   1411: .Em panes ;
                   1412: each pane takes up a certain area of the display and is a separate terminal.
                   1413: A window may be split into panes using the
                   1414: .Ic split-window
                   1415: command.
                   1416: Windows may be split horizontally (with the
                   1417: .Fl h
                   1418: flag) or vertically.
                   1419: Panes may be resized with the
                   1420: .Ic resize-pane
                   1421: command (bound to
                   1422: .Ql C-Up ,
                   1423: .Ql C-Down
                   1424: .Ql C-Left
                   1425: and
                   1426: .Ql C-Right
                   1427: by default), the current pane may be changed with the
                   1428: .Ic select-pane
                   1429: command and the
                   1430: .Ic rotate-window
                   1431: and
                   1432: .Ic swap-pane
                   1433: commands may be used to swap panes without changing their position.
                   1434: Panes are numbered beginning from zero in the order they are created.
                   1435: .Pp
                   1436: By default, a
1.1       nicm     1437: .Nm
1.679     nicm     1438: pane permits direct access to the terminal contained in the pane.
                   1439: A pane may also be put into one of several modes:
                   1440: .Bl -dash -offset indent
                   1441: .It
                   1442: Copy mode, which permits a section of a window or its
1.164     nicm     1443: history to be copied to a
1.1       nicm     1444: .Em paste buffer
                   1445: for later insertion into another window.
                   1446: This mode is entered with the
                   1447: .Ic copy-mode
                   1448: command, bound to
1.113     nicm     1449: .Ql \&[
1.1       nicm     1450: by default.
1.734     nicm     1451: Copied text can be pasted with the
                   1452: .Ic paste-buffer
                   1453: command, bound to
                   1454: .Ql \&] .
1.679     nicm     1455: .It
                   1456: View mode, which is like copy mode but is entered when a command that produces
                   1457: output, such as
1.164     nicm     1458: .Ic list-keys ,
                   1459: is executed from a key binding.
1.679     nicm     1460: .It
                   1461: Choose mode, which allows an item to be chosen from a list.
                   1462: This may be a client, a session or window or pane, or a buffer.
                   1463: This mode is entered with the
                   1464: .Ic choose-buffer ,
                   1465: .Ic choose-client
                   1466: and
                   1467: .Ic choose-tree
                   1468: commands.
                   1469: .El
1.1       nicm     1470: .Pp
1.678     nicm     1471: In copy mode an indicator is displayed in the top-right corner of the pane with
                   1472: the current position and the number of lines in the history.
                   1473: .Pp
1.497     nicm     1474: Commands are sent to copy mode using the
                   1475: .Fl X
                   1476: flag to the
                   1477: .Ic send-keys
                   1478: command.
                   1479: When a key is pressed, copy mode automatically uses one of two key tables,
                   1480: depending on the
1.1       nicm     1481: .Ic mode-keys
1.497     nicm     1482: option:
                   1483: .Ic copy-mode
                   1484: for emacs, or
                   1485: .Ic copy-mode-vi
                   1486: for vi.
                   1487: Key tables may be viewed with the
                   1488: .Ic list-keys
                   1489: command.
                   1490: .Pp
                   1491: The following commands are supported in copy mode:
1.648     nicm     1492: .Bl -column "CommandXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.497     nicm     1493: .It Sy "Command" Ta Sy "vi" Ta Sy "emacs"
                   1494: .It Li "append-selection" Ta "" Ta ""
                   1495: .It Li "append-selection-and-cancel" Ta "A" Ta ""
                   1496: .It Li "back-to-indentation" Ta "^" Ta "M-m"
                   1497: .It Li "begin-selection" Ta "Space" Ta "C-Space"
                   1498: .It Li "bottom-line" Ta "L" Ta ""
                   1499: .It Li "cancel" Ta "q" Ta "Escape"
                   1500: .It Li "clear-selection" Ta "Escape" Ta "C-g"
1.633     nicm     1501: .It Li "copy-end-of-line [<prefix>]" Ta "D" Ta "C-k"
                   1502: .It Li "copy-line [<prefix>]" Ta "" Ta ""
1.742     nicm     1503: .It Li "copy-pipe [<command>] [<prefix>]" Ta "" Ta ""
                   1504: .It Li "copy-pipe-no-clear [<command>] [<prefix>]" Ta "" Ta ""
                   1505: .It Li "copy-pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta ""
1.633     nicm     1506: .It Li "copy-selection [<prefix>]" Ta "" Ta ""
1.638     nicm     1507: .It Li "copy-selection-no-clear [<prefix>]" Ta "" Ta ""
1.633     nicm     1508: .It Li "copy-selection-and-cancel [<prefix>]" Ta "Enter" Ta "M-w"
1.497     nicm     1509: .It Li "cursor-down" Ta "j" Ta "Down"
1.685     nicm     1510: .It Li "cursor-down-and-cancel" Ta "" Ta ""
1.497     nicm     1511: .It Li "cursor-left" Ta "h" Ta "Left"
                   1512: .It Li "cursor-right" Ta "l" Ta "Right"
                   1513: .It Li "cursor-up" Ta "k" Ta "Up"
                   1514: .It Li "end-of-line" Ta "$" Ta "C-e"
                   1515: .It Li "goto-line <line>" Ta ":" Ta "g"
                   1516: .It Li "halfpage-down" Ta "C-d" Ta "M-Down"
1.589     nicm     1517: .It Li "halfpage-down-and-cancel" Ta "" Ta ""
1.497     nicm     1518: .It Li "halfpage-up" Ta "C-u" Ta "M-Up"
1.589     nicm     1519: .It Li "history-bottom" Ta "G" Ta "M->"
                   1520: .It Li "history-top" Ta "g" Ta "M-<"
1.497     nicm     1521: .It Li "jump-again" Ta ";" Ta ";"
                   1522: .It Li "jump-backward <to>" Ta "F" Ta "F"
                   1523: .It Li "jump-forward <to>" Ta "f" Ta "f"
                   1524: .It Li "jump-reverse" Ta "," Ta ","
                   1525: .It Li "jump-to-backward <to>" Ta "T" Ta ""
                   1526: .It Li "jump-to-forward <to>" Ta "t" Ta ""
                   1527: .It Li "middle-line" Ta "M" Ta "M-r"
1.678     nicm     1528: .It Li "next-matching-bracket" Ta "%" Ta "M-C-f"
1.497     nicm     1529: .It Li "next-paragraph" Ta "}" Ta "M-}"
                   1530: .It Li "next-space" Ta "W" Ta ""
                   1531: .It Li "next-space-end" Ta "E" Ta ""
                   1532: .It Li "next-word" Ta "w" Ta ""
                   1533: .It Li "next-word-end" Ta "e" Ta "M-f"
                   1534: .It Li "other-end" Ta "o" Ta ""
                   1535: .It Li "page-down" Ta "C-f" Ta "PageDown"
1.589     nicm     1536: .It Li "page-down-and-cancel" Ta "" Ta ""
1.497     nicm     1537: .It Li "page-up" Ta "C-b" Ta "PageUp"
1.678     nicm     1538: .It Li "previous-matching-bracket" Ta "" Ta "M-C-b"
1.497     nicm     1539: .It Li "previous-paragraph" Ta "{" Ta "M-{"
                   1540: .It Li "previous-space" Ta "B" Ta ""
                   1541: .It Li "previous-word" Ta "b" Ta "M-b"
                   1542: .It Li "rectangle-toggle" Ta "v" Ta "R"
1.732     nicm     1543: .It Li "refresh-from-pane" Ta "r" Ta "r"
1.497     nicm     1544: .It Li "scroll-down" Ta "C-e" Ta "C-Down"
1.589     nicm     1545: .It Li "scroll-down-and-cancel" Ta "" Ta ""
1.497     nicm     1546: .It Li "scroll-up" Ta "C-y" Ta "C-Up"
                   1547: .It Li "search-again" Ta "n" Ta "n"
1.517     nicm     1548: .It Li "search-backward <for>" Ta "?" Ta ""
1.726     nicm     1549: .It Li "search-backward-incremental <for>" Ta "" Ta "C-r"
                   1550: .It Li "search-backward-text <for>" Ta "" Ta ""
1.517     nicm     1551: .It Li "search-forward <for>" Ta "/" Ta ""
                   1552: .It Li "search-forward-incremental <for>" Ta "" Ta "C-s"
1.726     nicm     1553: .It Li "search-forward-text <for>" Ta "" Ta ""
1.497     nicm     1554: .It Li "search-reverse" Ta "N" Ta "N"
                   1555: .It Li "select-line" Ta "V" Ta ""
1.634     nicm     1556: .It Li "select-word" Ta "" Ta ""
1.497     nicm     1557: .It Li "start-of-line" Ta "0" Ta "C-a"
1.515     nicm     1558: .It Li "stop-selection" Ta "" Ta ""
1.497     nicm     1559: .It Li "top-line" Ta "H" Ta "M-R"
1.1       nicm     1560: .El
1.726     nicm     1561: .Pp
                   1562: The search commands come in several varieties:
                   1563: .Ql search-forward
                   1564: and
                   1565: .Ql search-backward
                   1566: search for a regular expression;
                   1567: the
                   1568: .Ql -text
                   1569: variants search for a plain text string rather than a regular expression;
                   1570: .Ql -incremental
                   1571: perform an incremental search and expect to be used with the
                   1572: .Fl i
                   1573: flag to the
                   1574: .Ic command-prompt
                   1575: command.
                   1576: .Ql search-again
                   1577: repeats the last search and
                   1578: .Ql search-reverse
                   1579: does the same but reverses the direction (forward becomes backward and backward
                   1580: becomes forward).
1.589     nicm     1581: .Pp
1.633     nicm     1582: Copy commands may take an optional buffer prefix argument which is used
                   1583: to generate the buffer name (the default is
                   1584: .Ql buffer
                   1585: so buffers are named
                   1586: .Ql buffer0 ,
                   1587: .Ql buffer1
                   1588: and so on).
                   1589: Pipe commands take a command argument which is the command to which the
                   1590: copied text is piped.
1.589     nicm     1591: The
                   1592: .Ql -and-cancel
                   1593: variants of some commands exit copy mode after they have completed (for copy
                   1594: commands) or when the cursor reaches the bottom (for scrolling commands).
1.638     nicm     1595: .Ql -no-clear
                   1596: variants do not clear the selection.
1.146     nicm     1597: .Pp
                   1598: The next and previous word keys use space and the
                   1599: .Ql - ,
1.154     nicm     1600: .Ql _
1.146     nicm     1601: and
                   1602: .Ql @
1.154     nicm     1603: characters as word delimiters by default, but this can be adjusted by
                   1604: setting the
                   1605: .Em word-separators
1.255     nicm     1606: session option.
1.146     nicm     1607: Next word moves to the start of the next word, next word end to the end of the
                   1608: next word and previous word to the start of the previous word.
                   1609: The three next and previous space keys work similarly but use a space alone as
                   1610: the word separator.
1.157     nicm     1611: .Pp
                   1612: The jump commands enable quick movement within a line.
                   1613: For instance, typing
                   1614: .Ql f
                   1615: followed by
                   1616: .Ql /
                   1617: will move the cursor to the next
                   1618: .Ql /
                   1619: character on the current line.
                   1620: A
                   1621: .Ql \&;
                   1622: will then jump to the next occurrence.
1.1       nicm     1623: .Pp
1.155     nicm     1624: Commands in copy mode may be prefaced by an optional repeat count.
                   1625: With vi key bindings, a prefix is entered using the number keys; with
                   1626: emacs, the Alt (meta) key and a number begins prefix entry.
                   1627: .Pp
1.164     nicm     1628: The synopsis for the
                   1629: .Ic copy-mode
                   1630: command is:
1.57      jmc      1631: .Bl -tag -width Ds
                   1632: .It Xo Ic copy-mode
1.720     nicm     1633: .Op Fl eHMqu
1.735     nicm     1634: .Op Fl s Ar src-pane
1.72      nicm     1635: .Op Fl t Ar target-pane
1.57      jmc      1636: .Xc
                   1637: Enter copy mode.
                   1638: The
                   1639: .Fl u
                   1640: option scrolls one page up.
1.419     nicm     1641: .Fl M
                   1642: begins a mouse drag (only valid if bound to a mouse key binding, see
1.420     jmc      1643: .Sx MOUSE SUPPORT ) .
1.716     nicm     1644: .Fl H
                   1645: hides the position indicator in the top right.
1.720     nicm     1646: .Fl q
                   1647: cancels copy mode and any other modes.
1.735     nicm     1648: .Fl s
                   1649: copies from
                   1650: .Ar src-pane
                   1651: instead of
1.736     nicm     1652: .Ar target-pane .
1.716     nicm     1653: .Pp
1.450     nicm     1654: .Fl e
                   1655: specifies that scrolling to the bottom of the history (to the visible screen)
                   1656: should exit copy mode.
                   1657: While in copy mode, pressing a key other than those used for scrolling will
                   1658: disable this behaviour.
                   1659: This is intended to allow fast scrolling through a pane's history, for
                   1660: example with:
                   1661: .Bd -literal -offset indent
                   1662: bind PageUp copy-mode -eu
                   1663: .Ed
1.57      jmc      1664: .El
1.18      nicm     1665: .Pp
1.679     nicm     1666: A number of preset arrangements of panes are available, these are called layouts.
1.38      nicm     1667: These may be selected with the
                   1668: .Ic select-layout
                   1669: command or cycled with
                   1670: .Ic next-layout
                   1671: (bound to
1.149     nicm     1672: .Ql Space
1.131     nicm     1673: by default); once a layout is chosen, panes within it may be moved and resized
                   1674: as normal.
1.1       nicm     1675: .Pp
                   1676: The following layouts are supported:
                   1677: .Bl -tag -width Ds
                   1678: .It Ic even-horizontal
                   1679: Panes are spread out evenly from left to right across the window.
                   1680: .It Ic even-vertical
                   1681: Panes are spread evenly from top to bottom.
1.2       nicm     1682: .It Ic main-horizontal
1.131     nicm     1683: A large (main) pane is shown at the top of the window and the remaining panes
                   1684: are spread from left to right in the leftover space at the bottom.
1.2       nicm     1685: Use the
                   1686: .Em main-pane-height
                   1687: window option to specify the height of the top pane.
1.1       nicm     1688: .It Ic main-vertical
1.2       nicm     1689: Similar to
                   1690: .Ic main-horizontal
                   1691: but the large pane is placed on the left and the others spread from top to
                   1692: bottom along the right.
                   1693: See the
                   1694: .Em main-pane-width
                   1695: window option.
1.165     nicm     1696: .It Ic tiled
                   1697: Panes are spread out as evenly as possible over the window in both rows and
                   1698: columns.
1.1       nicm     1699: .El
1.8       nicm     1700: .Pp
1.181     nicm     1701: In addition,
                   1702: .Ic select-layout
                   1703: may be used to apply a previously used layout - the
                   1704: .Ic list-windows
                   1705: command displays the layout of each window in a form suitable for use with
                   1706: .Ic select-layout .
                   1707: For example:
                   1708: .Bd -literal -offset indent
                   1709: $ tmux list-windows
                   1710: 0: ksh [159x48]
                   1711:     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                   1712: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                   1713: .Ed
1.196     nicm     1714: .Pp
1.181     nicm     1715: .Nm
                   1716: automatically adjusts the size of the layout for the current window size.
                   1717: Note that a layout cannot be applied to a window with more panes than that
                   1718: from which the layout was originally defined.
                   1719: .Pp
1.57      jmc      1720: Commands related to windows and panes are as follows:
                   1721: .Bl -tag -width Ds
                   1722: .It Xo Ic break-pane
1.749     nicm     1723: .Op Fl adP
1.280     nicm     1724: .Op Fl F Ar format
1.532     nicm     1725: .Op Fl n Ar window-name
1.440     nicm     1726: .Op Fl s Ar src-pane
1.480     nicm     1727: .Op Fl t Ar dst-window
1.57      jmc      1728: .Xc
                   1729: .D1 (alias: Ic breakp )
                   1730: Break
1.440     nicm     1731: .Ar src-pane
                   1732: off from its containing window to make it the only pane in
                   1733: .Ar dst-window .
1.749     nicm     1734: With
                   1735: .Fl a ,
                   1736: the window is moved to the next index up (following windows
                   1737: are moved if necessary).
1.57      jmc      1738: If
                   1739: .Fl d
                   1740: is given, the new window does not become the current window.
1.280     nicm     1741: The
                   1742: .Fl P
                   1743: option prints information about the new window after it has been created.
                   1744: By default, it uses the format
                   1745: .Ql #{session_name}:#{window_index}
                   1746: but a different format may be specified with
                   1747: .Fl F .
1.128     nicm     1748: .It Xo Ic capture-pane
1.680     nicm     1749: .Op Fl aepPqCJN
1.392     nicm     1750: .Op Fl b Ar buffer-name
1.213     nicm     1751: .Op Fl E Ar end-line
                   1752: .Op Fl S Ar start-line
1.128     nicm     1753: .Op Fl t Ar target-pane
                   1754: .Xc
                   1755: .D1 (alias: Ic capturep )
1.322     nicm     1756: Capture the contents of a pane.
                   1757: If
                   1758: .Fl p
1.325     nicm     1759: is given, the output goes to stdout, otherwise to the buffer specified with
1.322     nicm     1760: .Fl b
                   1761: or a new buffer if omitted.
1.339     nicm     1762: If
                   1763: .Fl a
                   1764: is given, the alternate screen is used, and the history is not accessible.
1.340     nicm     1765: If no alternate screen exists, an error will be returned unless
                   1766: .Fl q
                   1767: is given.
1.326     nicm     1768: If
                   1769: .Fl e
1.328     nicm     1770: is given, the output includes escape sequences for text and background
                   1771: attributes.
                   1772: .Fl C
1.330     nicm     1773: also escapes non-printable characters as octal \exxx.
1.680     nicm     1774: .Fl N
                   1775: preserves trailing spaces at each line's end and
1.328     nicm     1776: .Fl J
1.680     nicm     1777: preserves trailing spaces and joins any wrapped lines.
1.346     nicm     1778: .Fl P
                   1779: captures only any output that the pane has received that is the beginning of an
                   1780: as-yet incomplete escape sequence.
1.213     nicm     1781: .Pp
                   1782: .Fl S
                   1783: and
                   1784: .Fl E
                   1785: specify the starting and ending line numbers, zero is the first line of the
                   1786: visible pane and negative numbers are lines in the history.
1.397     nicm     1787: .Ql -
                   1788: to
                   1789: .Fl S
                   1790: is the start of the history and to
                   1791: .Fl E
                   1792: the end of the visible pane.
1.213     nicm     1793: The default is to capture only the visible contents of the pane.
1.76      nicm     1794: .It Xo
                   1795: .Ic choose-client
1.682     nicm     1796: .Op Fl NrZ
1.572     nicm     1797: .Op Fl F Ar format
1.562     nicm     1798: .Op Fl f Ar filter
1.561     nicm     1799: .Op Fl O Ar sort-order
1.555     nicm     1800: .Op Fl t Ar target-pane
1.76      nicm     1801: .Op Ar template
                   1802: .Xc
1.555     nicm     1803: Put a pane into client mode, allowing a client to be selected interactively from
                   1804: a list.
1.593     nicm     1805: .Fl Z
                   1806: zooms the pane.
1.555     nicm     1807: The following keys may be used in client mode:
                   1808: .Bl -column "Key" "Function" -offset indent
                   1809: .It Sy "Key" Ta Sy "Function"
                   1810: .It Li "Enter" Ta "Choose selected client"
                   1811: .It Li "Up" Ta "Select previous client"
                   1812: .It Li "Down" Ta "Select next client"
1.559     nicm     1813: .It Li "C-s" Ta "Search by name"
                   1814: .It Li "n" Ta "Repeat last search"
1.555     nicm     1815: .It Li "t" Ta "Toggle if client is tagged"
                   1816: .It Li "T" Ta "Tag no clients"
                   1817: .It Li "C-t" Ta "Tag all clients"
                   1818: .It Li "d" Ta "Detach selected client"
                   1819: .It Li "D" Ta "Detach tagged clients"
                   1820: .It Li "x" Ta "Detach and HUP selected client"
                   1821: .It Li "X" Ta "Detach and HUP tagged clients"
                   1822: .It Li "z" Ta "Suspend selected client"
                   1823: .It Li "Z" Ta "Suspend tagged clients"
1.562     nicm     1824: .It Li "f" Ta "Enter a format to filter items"
1.682     nicm     1825: .It Li "O" Ta "Change sort field"
                   1826: .It Li "r" Ta "Reverse sort order"
1.576     nicm     1827: .It Li "v" Ta "Toggle preview"
1.555     nicm     1828: .It Li "q" Ta "Exit mode"
                   1829: .El
                   1830: .Pp
1.76      nicm     1831: After a client is chosen,
                   1832: .Ql %%
1.555     nicm     1833: is replaced by the client name in
1.76      nicm     1834: .Ar template
                   1835: and the result executed as a command.
                   1836: If
                   1837: .Ar template
                   1838: is not given, "detach-client -t '%%'" is used.
1.555     nicm     1839: .Pp
1.561     nicm     1840: .Fl O
1.682     nicm     1841: specifies the initial sort field: one of
1.561     nicm     1842: .Ql name ,
                   1843: .Ql size ,
                   1844: .Ql creation ,
                   1845: or
                   1846: .Ql activity .
1.682     nicm     1847: .Fl r
                   1848: reverses the sort order.
1.562     nicm     1849: .Fl f
1.579     nicm     1850: specifies an initial filter: the filter is a format - if it evaluates to zero,
                   1851: the item in the list is not shown, otherwise it is shown.
                   1852: If a filter would lead to an empty list, it is ignored.
1.572     nicm     1853: .Fl F
                   1854: specifies the format for each item in the list.
1.576     nicm     1855: .Fl N
                   1856: starts without the preview.
1.314     nicm     1857: This command works only if at least one client is attached.
1.76      nicm     1858: .It Xo
1.555     nicm     1859: .Ic choose-tree
1.682     nicm     1860: .Op Fl GNrswZ
1.572     nicm     1861: .Op Fl F Ar format
1.562     nicm     1862: .Op Fl f Ar filter
1.561     nicm     1863: .Op Fl O Ar sort-order
1.555     nicm     1864: .Op Fl t Ar target-pane
1.76      nicm     1865: .Op Ar template
                   1866: .Xc
1.555     nicm     1867: Put a pane into tree mode, where a session, window or pane may be chosen
1.76      nicm     1868: interactively from a list.
1.298     nicm     1869: .Fl s
1.555     nicm     1870: starts with sessions collapsed and
1.298     nicm     1871: .Fl w
1.555     nicm     1872: with windows collapsed.
1.593     nicm     1873: .Fl Z
                   1874: zooms the pane.
1.555     nicm     1875: The following keys may be used in tree mode:
                   1876: .Bl -column "Key" "Function" -offset indent
                   1877: .It Sy "Key" Ta Sy "Function"
                   1878: .It Li "Enter" Ta "Choose selected item"
                   1879: .It Li "Up" Ta "Select previous item"
                   1880: .It Li "Down" Ta "Select next item"
1.594     nicm     1881: .It Li "x" Ta "Kill selected item"
                   1882: .It Li "X" Ta "Kill tagged items"
1.566     nicm     1883: .It Li "<" Ta "Scroll list of previews left"
                   1884: .It Li ">" Ta "Scroll list of previews right"
1.559     nicm     1885: .It Li "C-s" Ta "Search by name"
1.749     nicm     1886: .It Li "m" Ta "Set the marked pane"
                   1887: .It Li "M" Ta "Clear the marked pane"
1.559     nicm     1888: .It Li "n" Ta "Repeat last search"
1.555     nicm     1889: .It Li "t" Ta "Toggle if item is tagged"
                   1890: .It Li "T" Ta "Tag no items"
                   1891: .It Li "C-t" Ta "Tag all items"
1.557     nicm     1892: .It Li "\&:" Ta "Run a command for each tagged item"
1.555     nicm     1893: .It Li "f" Ta "Enter a format to filter items"
1.749     nicm     1894: .It Li "H" Ta "Jump to the starting pane"
1.682     nicm     1895: .It Li "O" Ta "Change sort field"
                   1896: .It Li "r" Ta "Reverse sort order"
1.576     nicm     1897: .It Li "v" Ta "Toggle preview"
1.555     nicm     1898: .It Li "q" Ta "Exit mode"
                   1899: .El
1.320     nicm     1900: .Pp
1.555     nicm     1901: After a session, window or pane is chosen,
1.76      nicm     1902: .Ql %%
1.555     nicm     1903: is replaced by the target in
1.76      nicm     1904: .Ar template
                   1905: and the result executed as a command.
                   1906: If
                   1907: .Ar template
1.555     nicm     1908: is not given, "switch-client -t '%%'" is used.
                   1909: .Pp
1.561     nicm     1910: .Fl O
1.682     nicm     1911: specifies the initial sort field: one of
1.561     nicm     1912: .Ql index ,
                   1913: .Ql name ,
                   1914: or
                   1915: .Ql time .
1.682     nicm     1916: .Fl r
                   1917: reverses the sort order.
1.562     nicm     1918: .Fl f
1.579     nicm     1919: specifies an initial filter: the filter is a format - if it evaluates to zero,
                   1920: the item in the list is not shown, otherwise it is shown.
                   1921: If a filter would lead to an empty list, it is ignored.
1.572     nicm     1922: .Fl F
                   1923: specifies the format for each item in the tree.
1.576     nicm     1924: .Fl N
                   1925: starts without the preview.
1.586     nicm     1926: .Fl G
                   1927: includes all sessions in any session groups in the tree rather than only the
                   1928: first.
1.314     nicm     1929: This command works only if at least one client is attached.
1.491     nicm     1930: .It Xo
                   1931: .Ic display-panes
1.616     nicm     1932: .Op Fl b
1.573     nicm     1933: .Op Fl d Ar duration
1.491     nicm     1934: .Op Fl t Ar target-client
                   1935: .Op Ar template
                   1936: .Xc
1.398     nicm     1937: .D1 (alias: Ic displayp )
1.78      nicm     1938: Display a visible indicator of each pane shown by
                   1939: .Ar target-client .
                   1940: See the
1.573     nicm     1941: .Ic display-panes-colour
1.78      nicm     1942: and
1.145     nicm     1943: .Ic display-panes-active-colour
1.78      nicm     1944: session options.
1.573     nicm     1945: The indicator is closed when a key is pressed or
                   1946: .Ar duration
                   1947: milliseconds have passed.
                   1948: If
                   1949: .Fl d
                   1950: is not given,
                   1951: .Ic display-panes-time
                   1952: is used.
                   1953: A duration of zero means the indicator stays until a key is pressed.
1.491     nicm     1954: While the indicator is on screen, a pane may be chosen with the
1.84      nicm     1955: .Ql 0
                   1956: to
                   1957: .Ql 9
1.491     nicm     1958: keys, which will cause
                   1959: .Ar template
                   1960: to be executed as a command with
                   1961: .Ql %%
                   1962: substituted by the pane ID.
                   1963: The default
                   1964: .Ar template
                   1965: is "select-pane -t '%%'".
1.616     nicm     1966: With
                   1967: .Fl b ,
                   1968: other commands are not blocked from running until the indicator is closed.
1.57      jmc      1969: .It Xo Ic find-window
1.670     nicm     1970: .Op Fl rCNTZ
1.555     nicm     1971: .Op Fl t Ar target-pane
1.57      jmc      1972: .Ar match-string
                   1973: .Xc
                   1974: .D1 (alias: Ic findw )
1.670     nicm     1975: Search for a
1.57      jmc      1976: .Xr fnmatch 3
1.670     nicm     1977: pattern or, with
                   1978: .Fl r ,
                   1979: regular expression
1.57      jmc      1980: .Ar match-string
                   1981: in window names, titles, and visible content (but not history).
1.285     nicm     1982: The flags control matching behavior:
                   1983: .Fl C
                   1984: matches only visible window contents,
                   1985: .Fl N
                   1986: matches only the window name and
                   1987: .Fl T
                   1988: matches only the window title.
                   1989: The default is
                   1990: .Fl CNT .
1.608     nicm     1991: .Fl Z
                   1992: zooms the pane.
1.555     nicm     1993: .Pp
1.314     nicm     1994: This command works only if at least one client is attached.
1.137     nicm     1995: .It Xo Ic join-pane
1.697     nicm     1996: .Op Fl bdfhv
1.690     nicm     1997: .Op Fl l Ar size
1.137     nicm     1998: .Op Fl s Ar src-pane
                   1999: .Op Fl t Ar dst-pane
                   2000: .Xc
                   2001: .D1 (alias: Ic joinp )
                   2002: Like
                   2003: .Ic split-window ,
                   2004: but instead of splitting
                   2005: .Ar dst-pane
                   2006: and creating a new pane, split it and move
                   2007: .Ar src-pane
                   2008: into the space.
                   2009: This can be used to reverse
                   2010: .Ic break-pane .
1.277     nicm     2011: The
                   2012: .Fl b
                   2013: option causes
                   2014: .Ar src-pane
                   2015: to be joined to left of or above
                   2016: .Ar dst-pane .
1.432     nicm     2017: .Pp
                   2018: If
                   2019: .Fl s
                   2020: is omitted and a marked pane is present (see
                   2021: .Ic select-pane
                   2022: .Fl m ) ,
                   2023: the marked pane is used rather than the current pane.
1.112     nicm     2024: .It Xo Ic kill-pane
                   2025: .Op Fl a
                   2026: .Op Fl t Ar target-pane
                   2027: .Xc
1.57      jmc      2028: .D1 (alias: Ic killp )
                   2029: Destroy the given pane.
                   2030: If no panes remain in the containing window, it is also destroyed.
1.112     nicm     2031: The
                   2032: .Fl a
                   2033: option kills all but the pane given with
                   2034: .Fl t .
1.289     nicm     2035: .It Xo Ic kill-window
                   2036: .Op Fl a
                   2037: .Op Fl t Ar target-window
                   2038: .Xc
1.57      jmc      2039: .D1 (alias: Ic killw )
                   2040: Kill the current window or the window at
                   2041: .Ar target-window ,
1.1       nicm     2042: removing it from any sessions to which it is linked.
1.289     nicm     2043: The
                   2044: .Fl a
                   2045: option kills all but the window given with
                   2046: .Fl t .
1.398     nicm     2047: .It Xo Ic last-pane
1.681     nicm     2048: .Op Fl deZ
1.398     nicm     2049: .Op Fl t Ar target-window
                   2050: .Xc
1.187     nicm     2051: .D1 (alias: Ic lastp )
                   2052: Select the last (previously selected) pane.
1.681     nicm     2053: .Fl Z
                   2054: keeps the window zoomed if it was zoomed.
1.398     nicm     2055: .Fl e
                   2056: enables or
                   2057: .Fl d
                   2058: disables input to the pane.
1.56      jmc      2059: .It Ic last-window Op Fl t Ar target-session
1.1       nicm     2060: .D1 (alias: Ic last )
                   2061: Select the last (previously selected) window.
                   2062: If no
                   2063: .Ar target-session
                   2064: is specified, select the last window of the current session.
                   2065: .It Xo Ic link-window
1.439     nicm     2066: .Op Fl adk
1.1       nicm     2067: .Op Fl s Ar src-window
                   2068: .Op Fl t Ar dst-window
                   2069: .Xc
                   2070: .D1 (alias: Ic linkw )
                   2071: Link the window at
                   2072: .Ar src-window
                   2073: to the specified
                   2074: .Ar dst-window .
                   2075: If
                   2076: .Ar dst-window
                   2077: is specified and no such window exists, the
                   2078: .Ar src-window
                   2079: is linked there.
1.439     nicm     2080: With
                   2081: .Fl a ,
                   2082: the window is moved to the next index up (following windows
                   2083: are moved if necessary).
1.1       nicm     2084: If
                   2085: .Fl k
                   2086: is given and
                   2087: .Ar dst-window
                   2088: exists, it is killed, otherwise an error is generated.
                   2089: If
                   2090: .Fl d
                   2091: is given, the newly linked window is not selected.
1.214     nicm     2092: .It Xo Ic list-panes
                   2093: .Op Fl as
1.245     nicm     2094: .Op Fl F Ar format
1.738     nicm     2095: .Op Fl f Ar filter
1.214     nicm     2096: .Op Fl t Ar target
                   2097: .Xc
1.104     nicm     2098: .D1 (alias: Ic lsp )
1.214     nicm     2099: If
                   2100: .Fl a
                   2101: is given,
                   2102: .Ar target
                   2103: is ignored and all panes on the server are listed.
                   2104: If
                   2105: .Fl s
                   2106: is given,
                   2107: .Ar target
                   2108: is a session (or the current session).
                   2109: If neither is given,
                   2110: .Ar target
                   2111: is a window (or the current window).
1.247     nicm     2112: .Fl F
1.738     nicm     2113: specifies the format of each line and
                   2114: .Fl f
                   2115: a filter.
                   2116: Only panes for which the filter is true are shown.
                   2117: See the
1.247     nicm     2118: .Sx FORMATS
                   2119: section.
1.214     nicm     2120: .It Xo Ic list-windows
                   2121: .Op Fl a
1.245     nicm     2122: .Op Fl F Ar format
1.738     nicm     2123: .Op Fl f Ar filter
1.214     nicm     2124: .Op Fl t Ar target-session
                   2125: .Xc
1.1       nicm     2126: .D1 (alias: Ic lsw )
1.214     nicm     2127: If
                   2128: .Fl a
                   2129: is given, list all windows on the server.
                   2130: Otherwise, list windows in the current session or in
1.1       nicm     2131: .Ar target-session .
1.245     nicm     2132: .Fl F
1.738     nicm     2133: specifies the format of each line and
                   2134: .Fl f
                   2135: a filter.
                   2136: Only windows for which the filter is true are shown.
                   2137: See the
1.245     nicm     2138: .Sx FORMATS
                   2139: section.
1.277     nicm     2140: .It Xo Ic move-pane
1.749     nicm     2141: .Op Fl bdfhv
1.690     nicm     2142: .Op Fl l Ar size
1.277     nicm     2143: .Op Fl s Ar src-pane
                   2144: .Op Fl t Ar dst-pane
                   2145: .Xc
                   2146: .D1 (alias: Ic movep )
1.749     nicm     2147: Does the same as
                   2148: .Ic join-pane .
1.1       nicm     2149: .It Xo Ic move-window
1.439     nicm     2150: .Op Fl ardk
1.1       nicm     2151: .Op Fl s Ar src-window
                   2152: .Op Fl t Ar dst-window
                   2153: .Xc
                   2154: .D1 (alias: Ic movew )
                   2155: This is similar to
                   2156: .Ic link-window ,
                   2157: except the window at
                   2158: .Ar src-window
                   2159: is moved to
                   2160: .Ar dst-window .
1.291     nicm     2161: With
                   2162: .Fl r ,
                   2163: all windows in the session are renumbered in sequential order, respecting
                   2164: the
                   2165: .Ic base-index
                   2166: option.
1.1       nicm     2167: .It Xo Ic new-window
1.201     nicm     2168: .Op Fl adkP
1.272     nicm     2169: .Op Fl c Ar start-directory
1.641     nicm     2170: .Op Fl e Ar environment
1.351     nicm     2171: .Op Fl F Ar format
1.1       nicm     2172: .Op Fl n Ar window-name
                   2173: .Op Fl t Ar target-window
1.153     nicm     2174: .Op Ar shell-command
1.1       nicm     2175: .Xc
                   2176: .D1 (alias: Ic neww )
                   2177: Create a new window.
1.160     nicm     2178: With
                   2179: .Fl a ,
                   2180: the new window is inserted at the next index up from the specified
                   2181: .Ar target-window ,
                   2182: moving windows up if necessary,
                   2183: otherwise
                   2184: .Ar target-window
                   2185: is the new window location.
                   2186: .Pp
1.1       nicm     2187: If
                   2188: .Fl d
                   2189: is given, the session does not make the new window the current window.
                   2190: .Ar target-window
1.28      nicm     2191: represents the window to be created; if the target already exists an error is
                   2192: shown, unless the
                   2193: .Fl k
                   2194: flag is used, in which case it is destroyed.
1.153     nicm     2195: .Ar shell-command
1.1       nicm     2196: is the command to execute.
                   2197: If
1.153     nicm     2198: .Ar shell-command
                   2199: is not specified, the value of the
                   2200: .Ic default-command
                   2201: option is used.
1.272     nicm     2202: .Fl c
                   2203: specifies the working directory in which the new window is created.
1.153     nicm     2204: .Pp
                   2205: When the shell command completes, the window closes.
                   2206: See the
                   2207: .Ic remain-on-exit
                   2208: option to change this behaviour.
1.1       nicm     2209: .Pp
1.641     nicm     2210: .Fl e
                   2211: takes the form
                   2212: .Ql VARIABLE=value
                   2213: and sets an environment variable for the newly created window; it may be
                   2214: specified multiple times.
                   2215: .Pp
1.1       nicm     2216: The
                   2217: .Ev TERM
                   2218: environment variable must be set to
1.523     nicm     2219: .Ql screen
                   2220: or
                   2221: .Ql tmux
1.1       nicm     2222: for all programs running
                   2223: .Em inside
                   2224: .Nm .
                   2225: New windows will automatically have
1.523     nicm     2226: .Ql TERM=screen
1.1       nicm     2227: added to their environment, but care must be taken not to reset this in shell
1.641     nicm     2228: start-up files or by the
                   2229: .Fl e
                   2230: option.
1.201     nicm     2231: .Pp
                   2232: The
                   2233: .Fl P
1.279     nicm     2234: option prints information about the new window after it has been created.
                   2235: By default, it uses the format
                   2236: .Ql #{session_name}:#{window_index}
                   2237: but a different format may be specified with
                   2238: .Fl F .
1.56      jmc      2239: .It Ic next-layout Op Fl t Ar target-window
1.1       nicm     2240: .D1 (alias: Ic nextl )
                   2241: Move a window to the next layout and rearrange the panes to fit.
                   2242: .It Xo Ic next-window
1.9       nicm     2243: .Op Fl a
1.1       nicm     2244: .Op Fl t Ar target-session
                   2245: .Xc
                   2246: .D1 (alias: Ic next )
                   2247: Move to the next window in the session.
1.9       nicm     2248: If
1.12      jmc      2249: .Fl a
1.295     nicm     2250: is used, move to the next window with an alert.
1.107     nicm     2251: .It Xo Ic pipe-pane
1.591     nicm     2252: .Op Fl IOo
1.107     nicm     2253: .Op Fl t Ar target-pane
1.153     nicm     2254: .Op Ar shell-command
1.107     nicm     2255: .Xc
                   2256: .D1 (alias: Ic pipep )
1.591     nicm     2257: Pipe output sent by the program in
1.107     nicm     2258: .Ar target-pane
1.591     nicm     2259: to a shell command or vice versa.
                   2260: A pane may only be connected to one command at a time, any existing pipe is
1.107     nicm     2261: closed before
1.153     nicm     2262: .Ar shell-command
1.107     nicm     2263: is executed.
1.174     nicm     2264: The
                   2265: .Ar shell-command
                   2266: string may contain the special character sequences supported by the
                   2267: .Ic status-left
1.231     nicm     2268: option.
1.107     nicm     2269: If no
1.153     nicm     2270: .Ar shell-command
1.107     nicm     2271: is given, the current pipe (if any) is closed.
1.591     nicm     2272: .Pp
                   2273: .Fl I
                   2274: and
                   2275: .Fl O
                   2276: specify which of the
                   2277: .Ar shell-command
                   2278: output streams are connected to the pane:
                   2279: with
                   2280: .Fl I
                   2281: stdout is connected (so anything
                   2282: .Ar shell-command
                   2283: prints is written to the pane as if it were typed);
                   2284: with
                   2285: .Fl O
                   2286: stdin is connected (so any output in the pane is piped to
                   2287: .Ar shell-command ) .
                   2288: Both may be used together and if neither are specified,
                   2289: .Fl O
                   2290: is used.
1.107     nicm     2291: .Pp
                   2292: The
                   2293: .Fl o
                   2294: option only opens a new pipe if no previous pipe exists, allowing a pipe to
                   2295: be toggled with a single key, for example:
                   2296: .Bd -literal -offset indent
1.174     nicm     2297: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107     nicm     2298: .Ed
1.176     nicm     2299: .It Xo Ic previous-layout
                   2300: .Op Fl t Ar target-window
                   2301: .Xc
                   2302: .D1 (alias: Ic prevl )
                   2303: Move to the previous layout in the session.
1.1       nicm     2304: .It Xo Ic previous-window
1.9       nicm     2305: .Op Fl a
1.1       nicm     2306: .Op Fl t Ar target-session
                   2307: .Xc
                   2308: .D1 (alias: Ic prev )
                   2309: Move to the previous window in the session.
1.9       nicm     2310: With
                   2311: .Fl a ,
1.295     nicm     2312: move to the previous window with an alert.
1.1       nicm     2313: .It Xo Ic rename-window
                   2314: .Op Fl t Ar target-window
                   2315: .Ar new-name
                   2316: .Xc
                   2317: .D1 (alias: Ic renamew )
                   2318: Rename the current window, or the window at
                   2319: .Ar target-window
                   2320: if specified, to
                   2321: .Ar new-name .
                   2322: .It Xo Ic resize-pane
1.727     nicm     2323: .Op Fl DLMRTUZ
1.52      nicm     2324: .Op Fl t Ar target-pane
1.324     nicm     2325: .Op Fl x Ar width
                   2326: .Op Fl y Ar height
1.1       nicm     2327: .Op Ar adjustment
                   2328: .Xc
                   2329: .D1 (alias: Ic resizep )
1.324     nicm     2330: Resize a pane, up, down, left or right by
                   2331: .Ar adjustment
                   2332: with
                   2333: .Fl U ,
1.57      jmc      2334: .Fl D ,
                   2335: .Fl L
1.324     nicm     2336: or
                   2337: .Fl R ,
                   2338: or
                   2339: to an absolute size
                   2340: with
                   2341: .Fl x
                   2342: or
                   2343: .Fl y .
1.57      jmc      2344: The
                   2345: .Ar adjustment
1.690     nicm     2346: is given in lines or columns (the default is 1);
                   2347: .Fl x
                   2348: and
                   2349: .Fl y
                   2350: may be a given as a number of lines or columns or followed by
                   2351: .Ql %
                   2352: for a percentage of the window size (for example
                   2353: .Ql -x 10% ) .
1.337     nicm     2354: With
                   2355: .Fl Z ,
1.349     nicm     2356: the active pane is toggled between zoomed (occupying the whole of the window)
                   2357: and unzoomed (its normal position in the layout).
1.419     nicm     2358: .Pp
                   2359: .Fl M
                   2360: begins mouse resizing (only valid if bound to a mouse key binding, see
1.420     jmc      2361: .Sx MOUSE SUPPORT ) .
1.729     nicm     2362: .Pp
                   2363: .Fl T
1.727     nicm     2364: trims all lines below the current cursor position and moves lines out of the
                   2365: history to replace them.
1.629     nicm     2366: .It Xo Ic resize-window
                   2367: .Op Fl aADLRU
                   2368: .Op Fl t Ar target-window
                   2369: .Op Fl x Ar width
                   2370: .Op Fl y Ar height
                   2371: .Op Ar adjustment
                   2372: .Xc
                   2373: .D1 (alias: Ic resizew )
                   2374: Resize a window, up, down, left or right by
                   2375: .Ar adjustment
                   2376: with
                   2377: .Fl U ,
                   2378: .Fl D ,
                   2379: .Fl L
                   2380: or
                   2381: .Fl R ,
                   2382: or
                   2383: to an absolute size
                   2384: with
                   2385: .Fl x
                   2386: or
                   2387: .Fl y .
                   2388: The
                   2389: .Ar adjustment
                   2390: is given in lines or cells (the default is 1).
                   2391: .Fl A
                   2392: sets the size of the largest session containing the window;
                   2393: .Fl a
                   2394: the size of the smallest.
                   2395: This command will automatically set
                   2396: .Ic window-size
                   2397: to manual in the window options.
1.234     nicm     2398: .It Xo Ic respawn-pane
1.641     nicm     2399: .Op Fl k
1.568     nicm     2400: .Op Fl c Ar start-directory
1.641     nicm     2401: .Op Fl e Ar environment
1.234     nicm     2402: .Op Fl t Ar target-pane
                   2403: .Op Ar shell-command
                   2404: .Xc
                   2405: .D1 (alias: Ic respawnp )
                   2406: Reactivate a pane in which the command has exited (see the
                   2407: .Ic remain-on-exit
                   2408: window option).
                   2409: If
                   2410: .Ar shell-command
                   2411: is not given, the command used when the pane was created is executed.
                   2412: The pane must be already inactive, unless
                   2413: .Fl k
                   2414: is given, in which case any existing command is killed.
1.568     nicm     2415: .Fl c
                   2416: specifies a new working directory for the pane.
1.641     nicm     2417: The
                   2418: .Fl e
                   2419: option has the same meaning as for the
                   2420: .Ic new-window
                   2421: command.
1.57      jmc      2422: .It Xo Ic respawn-window
1.641     nicm     2423: .Op Fl k
1.568     nicm     2424: .Op Fl c Ar start-directory
1.641     nicm     2425: .Op Fl e Ar environment
1.57      jmc      2426: .Op Fl t Ar target-window
1.153     nicm     2427: .Op Ar shell-command
1.57      jmc      2428: .Xc
                   2429: .D1 (alias: Ic respawnw )
1.153     nicm     2430: Reactivate a window in which the command has exited (see the
1.57      jmc      2431: .Ic remain-on-exit
                   2432: window option).
                   2433: If
1.153     nicm     2434: .Ar shell-command
1.57      jmc      2435: is not given, the command used when the window was created is executed.
                   2436: The window must be already inactive, unless
                   2437: .Fl k
                   2438: is given, in which case any existing command is killed.
1.568     nicm     2439: .Fl c
                   2440: specifies a new working directory for the window.
1.641     nicm     2441: The
                   2442: .Fl e
                   2443: option has the same meaning as for the
                   2444: .Ic new-window
                   2445: command.
1.57      jmc      2446: .It Xo Ic rotate-window
1.681     nicm     2447: .Op Fl DUZ
1.57      jmc      2448: .Op Fl t Ar target-window
                   2449: .Xc
                   2450: .D1 (alias: Ic rotatew )
                   2451: Rotate the positions of the panes within a window, either upward (numerically
                   2452: lower) with
                   2453: .Fl U
                   2454: or downward (numerically higher).
1.681     nicm     2455: .Fl Z
                   2456: keeps the window zoomed if it was zoomed.
1.57      jmc      2457: .It Xo Ic select-layout
1.588     nicm     2458: .Op Fl Enop
                   2459: .Op Fl t Ar target-pane
1.57      jmc      2460: .Op Ar layout-name
                   2461: .Xc
1.176     nicm     2462: .D1 (alias: Ic selectl )
1.57      jmc      2463: Choose a specific layout for a window.
                   2464: If
                   2465: .Ar layout-name
1.181     nicm     2466: is not given, the last preset layout used (if any) is reapplied.
1.204     nicm     2467: .Fl n
                   2468: and
                   2469: .Fl p
                   2470: are equivalent to the
                   2471: .Ic next-layout
                   2472: and
                   2473: .Ic previous-layout
                   2474: commands.
1.424     nicm     2475: .Fl o
                   2476: applies the last set layout if possible (undoes the most recent layout change).
1.588     nicm     2477: .Fl E
                   2478: spreads the current pane and any panes next to it out evenly.
1.156     nicm     2479: .It Xo Ic select-pane
1.681     nicm     2480: .Op Fl DdeLlMmRUZ
1.577     nicm     2481: .Op Fl T Ar title
1.156     nicm     2482: .Op Fl t Ar target-pane
                   2483: .Xc
1.57      jmc      2484: .D1 (alias: Ic selectp )
                   2485: Make pane
                   2486: .Ar target-pane
                   2487: the active pane in window
1.673     jmc      2488: .Ar target-window .
1.156     nicm     2489: If one of
                   2490: .Fl D ,
                   2491: .Fl L ,
                   2492: .Fl R ,
                   2493: or
                   2494: .Fl U
                   2495: is used, respectively the pane below, to the left, to the right, or above the
                   2496: target pane is used.
1.681     nicm     2497: .Fl Z
                   2498: keeps the window zoomed if it was zoomed.
1.204     nicm     2499: .Fl l
                   2500: is the same as using the
                   2501: .Ic last-pane
                   2502: command.
1.398     nicm     2503: .Fl e
                   2504: enables or
                   2505: .Fl d
                   2506: disables input to the pane.
1.668     nicm     2507: .Fl T
                   2508: sets the pane title.
1.418     nicm     2509: .Pp
1.432     nicm     2510: .Fl m
                   2511: and
                   2512: .Fl M
                   2513: are used to set and clear the
                   2514: .Em marked pane .
                   2515: There is one marked pane at a time, setting a new marked pane clears the last.
                   2516: The marked pane is the default target for
                   2517: .Fl s
                   2518: to
                   2519: .Ic join-pane ,
                   2520: .Ic swap-pane
                   2521: and
                   2522: .Ic swap-window .
1.204     nicm     2523: .It Xo Ic select-window
1.310     nicm     2524: .Op Fl lnpT
1.204     nicm     2525: .Op Fl t Ar target-window
                   2526: .Xc
1.57      jmc      2527: .D1 (alias: Ic selectw )
                   2528: Select the window at
                   2529: .Ar target-window .
1.204     nicm     2530: .Fl l ,
                   2531: .Fl n
                   2532: and
                   2533: .Fl p
                   2534: are equivalent to the
                   2535: .Ic last-window ,
                   2536: .Ic next-window
                   2537: and
                   2538: .Ic previous-window
                   2539: commands.
1.310     nicm     2540: If
                   2541: .Fl T
                   2542: is given and the selected window is already the current window,
                   2543: the command behaves like
                   2544: .Ic last-window .
1.57      jmc      2545: .It Xo Ic split-window
1.643     nicm     2546: .Op Fl bdfhIvP
1.272     nicm     2547: .Op Fl c Ar start-directory
1.641     nicm     2548: .Op Fl e Ar environment
1.690     nicm     2549: .Op Fl l Ar size
1.136     nicm     2550: .Op Fl t Ar target-pane
1.153     nicm     2551: .Op Ar shell-command
1.279     nicm     2552: .Op Fl F Ar format
1.57      jmc      2553: .Xc
1.176     nicm     2554: .D1 (alias: Ic splitw )
1.136     nicm     2555: Create a new pane by splitting
                   2556: .Ar target-pane :
1.57      jmc      2557: .Fl h
                   2558: does a horizontal split and
                   2559: .Fl v
                   2560: a vertical split; if neither is specified,
                   2561: .Fl v
                   2562: is assumed.
                   2563: The
                   2564: .Fl l
1.690     nicm     2565: option specifies the size of the new pane in lines (for vertical split) or in
                   2566: columns (for horizontal split);
                   2567: .Ar size
                   2568: may be followed by
                   2569: .Ql %
                   2570: to specify a percentage of the available space.
1.408     nicm     2571: The
                   2572: .Fl b
                   2573: option causes the new pane to be created to the left of or above
                   2574: .Ar target-pane .
1.494     nicm     2575: The
                   2576: .Fl f
                   2577: option creates a new pane spanning the full window height (with
                   2578: .Fl h )
                   2579: or full window width (with
                   2580: .Fl v ) ,
                   2581: instead of splitting the active pane.
1.643     nicm     2582: .Pp
                   2583: An empty
                   2584: .Ar shell-command
                   2585: ('') will create a pane with no command running in it.
                   2586: Output can be sent to such a pane with the
                   2587: .Ic display-message
                   2588: command.
                   2589: The
                   2590: .Fl I
                   2591: flag (if
                   2592: .Ar shell-command
                   2593: is not specified or empty)
                   2594: will create an empty pane and forward any output from stdin to it.
                   2595: For example:
                   2596: .Bd -literal -offset indent
                   2597: $ make 2>&1|tmux splitw -dI &
                   2598: .Ed
                   2599: .Pp
1.136     nicm     2600: All other options have the same meaning as for the
1.57      jmc      2601: .Ic new-window
                   2602: command.
                   2603: .It Xo Ic swap-pane
1.681     nicm     2604: .Op Fl dDUZ
1.57      jmc      2605: .Op Fl s Ar src-pane
                   2606: .Op Fl t Ar dst-pane
                   2607: .Xc
                   2608: .D1 (alias: Ic swapp )
                   2609: Swap two panes.
                   2610: If
                   2611: .Fl U
                   2612: is used and no source pane is specified with
                   2613: .Fl s ,
                   2614: .Ar dst-pane
                   2615: is swapped with the previous pane (before it numerically);
                   2616: .Fl D
                   2617: swaps with the next pane (after it numerically).
1.138     nicm     2618: .Fl d
                   2619: instructs
                   2620: .Nm
1.681     nicm     2621: not to change the active pane and
                   2622: .Fl Z
                   2623: keeps the window zoomed if it was zoomed.
1.432     nicm     2624: .Pp
                   2625: If
                   2626: .Fl s
                   2627: is omitted and a marked pane is present (see
                   2628: .Ic select-pane
                   2629: .Fl m ) ,
                   2630: the marked pane is used rather than the current pane.
1.57      jmc      2631: .It Xo Ic swap-window
                   2632: .Op Fl d
                   2633: .Op Fl s Ar src-window
                   2634: .Op Fl t Ar dst-window
                   2635: .Xc
                   2636: .D1 (alias: Ic swapw )
                   2637: This is similar to
                   2638: .Ic link-window ,
                   2639: except the source and destination windows are swapped.
                   2640: It is an error if no window exists at
                   2641: .Ar src-window .
1.705     nicm     2642: If
                   2643: .Fl d
                   2644: is given, the new window does not become the current window.
1.432     nicm     2645: .Pp
1.705     nicm     2646: If
1.432     nicm     2647: .Fl s
                   2648: is omitted and a marked pane is present (see
                   2649: .Ic select-pane
                   2650: .Fl m ) ,
                   2651: the window containing the marked pane is used rather than the current window.
1.57      jmc      2652: .It Xo Ic unlink-window
1.1       nicm     2653: .Op Fl k
                   2654: .Op Fl t Ar target-window
                   2655: .Xc
1.57      jmc      2656: .D1 (alias: Ic unlinkw )
                   2657: Unlink
                   2658: .Ar target-window .
                   2659: Unless
                   2660: .Fl k
                   2661: is given, a window may be unlinked only if it is linked to multiple sessions -
                   2662: windows may not be linked to no sessions;
                   2663: if
1.1       nicm     2664: .Fl k
1.57      jmc      2665: is specified and the window is linked to only one session, it is unlinked and
                   2666: destroyed.
                   2667: .El
                   2668: .Sh KEY BINDINGS
1.93      nicm     2669: .Nm
                   2670: allows a command to be bound to most keys, with or without a prefix key.
                   2671: When specifying keys, most represent themselves (for example
                   2672: .Ql A
                   2673: to
1.95      jmc      2674: .Ql Z ) .
1.93      nicm     2675: Ctrl keys may be prefixed with
                   2676: .Ql C-
                   2677: or
1.95      jmc      2678: .Ql ^ ,
                   2679: and Alt (meta) with
1.93      nicm     2680: .Ql M- .
                   2681: In addition, the following special key names are accepted:
1.126     nicm     2682: .Em Up ,
                   2683: .Em Down ,
                   2684: .Em Left ,
                   2685: .Em Right ,
1.93      nicm     2686: .Em BSpace ,
                   2687: .Em BTab ,
                   2688: .Em DC
                   2689: (Delete),
                   2690: .Em End ,
                   2691: .Em Enter ,
                   2692: .Em Escape ,
                   2693: .Em F1
                   2694: to
1.402     nicm     2695: .Em F12 ,
1.93      nicm     2696: .Em Home ,
                   2697: .Em IC
                   2698: (Insert),
1.254     nicm     2699: .Em NPage/PageDown/PgDn ,
                   2700: .Em PPage/PageUp/PgUp ,
1.93      nicm     2701: .Em Space ,
                   2702: and
                   2703: .Em Tab .
                   2704: Note that to bind the
                   2705: .Ql \&"
                   2706: or
                   2707: .Ql '
                   2708: keys, quotation marks are necessary, for example:
                   2709: .Bd -literal -offset indent
                   2710: bind-key '"' split-window
1.167     nicm     2711: bind-key "'" new-window
1.93      nicm     2712: .Ed
1.693     nicm     2713: .Pp
                   2714: A command bound to the
                   2715: .Em Any
                   2716: key will execute for all keys which do not have a more specific binding.
1.93      nicm     2717: .Pp
1.57      jmc      2718: Commands related to key bindings are as follows:
                   2719: .Bl -tag -width Ds
                   2720: .It Xo Ic bind-key
1.501     nicm     2721: .Op Fl nr
1.706     nicm     2722: .Op Fl N Ar note
1.421     nicm     2723: .Op Fl T Ar key-table
1.750     jmc      2724: .Ar key command Op Ar arguments
1.1       nicm     2725: .Xc
1.57      jmc      2726: .D1 (alias: Ic bind )
                   2727: Bind key
                   2728: .Ar key
                   2729: to
                   2730: .Ar command .
1.421     nicm     2731: Keys are bound in a key table.
                   2732: By default (without -T), the key is bound in
                   2733: the
                   2734: .Em prefix
                   2735: key table.
                   2736: This table is used for keys pressed after the prefix key (for example,
                   2737: by default
                   2738: .Ql c
                   2739: is bound to
                   2740: .Ic new-window
                   2741: in the
                   2742: .Em prefix
                   2743: table, so
                   2744: .Ql C-b c
                   2745: creates a new window).
                   2746: The
                   2747: .Em root
                   2748: table is used for keys pressed without the prefix key: binding
                   2749: .Ql c
                   2750: to
                   2751: .Ic new-window
                   2752: in the
                   2753: .Em root
                   2754: table (not recommended) means a plain
                   2755: .Ql c
                   2756: will create a new window.
1.57      jmc      2757: .Fl n
1.421     nicm     2758: is an alias
                   2759: for
                   2760: .Fl T Ar root .
                   2761: Keys may also be bound in custom key tables and the
                   2762: .Ic switch-client
                   2763: .Fl T
                   2764: command used to switch to them from a key binding.
1.1       nicm     2765: The
1.57      jmc      2766: .Fl r
                   2767: flag indicates this key may repeat, see the
                   2768: .Ic repeat-time
                   2769: option.
1.706     nicm     2770: .Fl N
                   2771: attaches a note to the key (shown with
                   2772: .Ic list-keys
                   2773: .Fl N ) .
1.57      jmc      2774: .Pp
                   2775: To view the default bindings and possible commands, see the
                   2776: .Ic list-keys
                   2777: command.
1.421     nicm     2778: .It Xo Ic list-keys
1.712     nicm     2779: .Op Fl 1aN
1.706     nicm     2780: .Op Fl P Ar prefix-string Fl T Ar key-table
1.731     nicm     2781: .Op Ar key
1.421     nicm     2782: .Xc
1.57      jmc      2783: .D1 (alias: Ic lsk )
1.710     nicm     2784: List key bindings.
                   2785: There are two forms: the default lists keys as
1.706     nicm     2786: .Ic bind-key
1.710     nicm     2787: commands;
                   2788: .Fl N
                   2789: lists only keys with attached notes and shows only the key and note for each
                   2790: key.
                   2791: .Pp
                   2792: With the default form, all key tables are listed by default.
                   2793: .Fl T
                   2794: lists only keys in
                   2795: .Ar key-table .
                   2796: .Pp
                   2797: With the
1.706     nicm     2798: .Fl N
1.710     nicm     2799: form, only keys in the
1.706     nicm     2800: .Em root
                   2801: and
                   2802: .Em prefix
1.710     nicm     2803: key tables are listed by default;
                   2804: .Fl T
                   2805: also lists only keys in
                   2806: .Ar key-table .
1.706     nicm     2807: .Fl P
1.710     nicm     2808: specifies a prefix to print before each key and
1.706     nicm     2809: .Fl 1
1.710     nicm     2810: lists only the first matching key.
1.712     nicm     2811: .Fl a
                   2812: lists the command for keys that do have a note rather than skipping them.
1.57      jmc      2813: .It Xo Ic send-keys
1.694     nicm     2814: .Op Fl FHlMRX
1.497     nicm     2815: .Op Fl N Ar repeat-count
1.72      nicm     2816: .Op Fl t Ar target-pane
1.57      jmc      2817: .Ar key Ar ...
1.1       nicm     2818: .Xc
1.57      jmc      2819: .D1 (alias: Ic send )
                   2820: Send a key or keys to a window.
                   2821: Each argument
                   2822: .Ar key
                   2823: is the name of the key (such as
                   2824: .Ql C-a
                   2825: or
1.523     nicm     2826: .Ql NPage )
                   2827: to send; if the string is not recognised as a key, it is sent as a series of
1.57      jmc      2828: characters.
1.676     nicm     2829: All arguments are sent sequentially from first to last.
                   2830: .Pp
1.273     nicm     2831: The
                   2832: .Fl l
1.676     nicm     2833: flag disables key name lookup and processes the keys as literal UTF-8
                   2834: characters.
                   2835: The
                   2836: .Fl H
                   2837: flag expects each key to be a hexadecimal number for an ASCII character.
                   2838: .Pp
1.265     nicm     2839: The
                   2840: .Fl R
                   2841: flag causes the terminal state to be reset.
1.419     nicm     2842: .Pp
                   2843: .Fl M
                   2844: passes through a mouse event (only valid if bound to a mouse key binding, see
1.420     jmc      2845: .Sx MOUSE SUPPORT ) .
1.497     nicm     2846: .Pp
                   2847: .Fl X
                   2848: is used to send a command into copy mode - see
                   2849: the
                   2850: .Sx WINDOWS AND PANES
                   2851: section.
                   2852: .Fl N
1.694     nicm     2853: specifies a repeat count and
                   2854: .Fl F
                   2855: expands formats in arguments where appropriate.
1.267     nicm     2856: .It Xo Ic send-prefix
                   2857: .Op Fl 2
                   2858: .Op Fl t Ar target-pane
                   2859: .Xc
                   2860: Send the prefix key, or with
                   2861: .Fl 2
                   2862: the secondary prefix key, to a window as if it was pressed.
1.57      jmc      2863: .It Xo Ic unbind-key
1.501     nicm     2864: .Op Fl an
1.421     nicm     2865: .Op Fl T Ar key-table
1.57      jmc      2866: .Ar key
1.2       nicm     2867: .Xc
1.57      jmc      2868: .D1 (alias: Ic unbind )
                   2869: Unbind the command bound to
                   2870: .Ar key .
1.530     nicm     2871: .Fl n
                   2872: and
1.421     nicm     2873: .Fl T
                   2874: are the same as for
                   2875: .Ic bind-key .
1.189     nicm     2876: If
                   2877: .Fl a
                   2878: is present, all key bindings are removed.
1.57      jmc      2879: .El
                   2880: .Sh OPTIONS
                   2881: The appearance and behaviour of
                   2882: .Nm
                   2883: may be modified by changing the value of various options.
1.668     nicm     2884: There are four types of option:
1.133     nicm     2885: .Em server options ,
1.57      jmc      2886: .Em session options
1.668     nicm     2887: .Em window options
1.57      jmc      2888: and
1.668     nicm     2889: .Em pane options .
1.57      jmc      2890: .Pp
1.133     nicm     2891: The
                   2892: .Nm
1.686     nicm     2893: server has a set of global server options which do not apply to any particular
1.668     nicm     2894: window or session or pane.
1.133     nicm     2895: These are altered with the
                   2896: .Ic set-option
                   2897: .Fl s
                   2898: command, or displayed with the
                   2899: .Ic show-options
                   2900: .Fl s
                   2901: command.
                   2902: .Pp
                   2903: In addition, each individual session may have a set of session options, and
                   2904: there is a separate set of global session options.
1.57      jmc      2905: Sessions which do not have a particular option configured inherit the value
                   2906: from the global session options.
                   2907: Session options are set or unset with the
                   2908: .Ic set-option
                   2909: command and may be listed with the
                   2910: .Ic show-options
                   2911: command.
1.133     nicm     2912: The available server and session options are listed under the
1.57      jmc      2913: .Ic set-option
                   2914: command.
                   2915: .Pp
1.668     nicm     2916: Similarly, a set of window options is attached to each window and a set of pane
                   2917: options to each pane.
                   2918: Pane options inherit from window options.
                   2919: This means any pane option may be set as a window option to apply the option to
                   2920: all panes in the window without the option set, for example these commands will
                   2921: set the background colour to red for all panes except pane 0:
                   2922: .Bd -literal -offset indent
                   2923: set -w window-style bg=red
                   2924: set -pt:.0 window-style bg=blue
                   2925: .Ed
                   2926: .Pp
                   2927: There is also a set of global window options from which any unset window or
                   2928: pane options are inherited.
                   2929: Window and pane options are altered with
                   2930: .Ic set-option
                   2931: .Fl w
                   2932: and
                   2933: .Fl p
                   2934: commands and displayed with
                   2935: .Ic show-option
                   2936: .Fl w
                   2937: and
                   2938: .Fl p .
1.318     nicm     2939: .Pp
                   2940: .Nm
                   2941: also supports user options which are prefixed with a
                   2942: .Ql \&@ .
1.321     jmc      2943: User options may have any name, so long as they are prefixed with
                   2944: .Ql \&@ ,
1.318     nicm     2945: and be set to any string.
1.418     nicm     2946: For example:
1.318     nicm     2947: .Bd -literal -offset indent
                   2948: $ tmux setw -q @foo "abc123"
                   2949: $ tmux showw -v @foo
                   2950: abc123
                   2951: .Ed
1.57      jmc      2952: .Pp
                   2953: Commands which set options are as follows:
                   2954: .Bl -tag -width Ds
1.1       nicm     2955: .It Xo Ic set-option
1.668     nicm     2956: .Op Fl aFgopqsuw
                   2957: .Op Fl t Ar target-pane
1.1       nicm     2958: .Ar option Ar value
                   2959: .Xc
                   2960: .D1 (alias: Ic set )
1.668     nicm     2961: Set a pane option with
                   2962: .Fl p ,
                   2963: a window option with
                   2964: .Fl w ,
1.133     nicm     2965: a server option with
                   2966: .Fl s ,
                   2967: otherwise a session option.
1.637     nicm     2968: If the option is not a user option,
                   2969: .Fl w
1.668     nicm     2970: or
1.637     nicm     2971: .Fl s
1.668     nicm     2972: may be unnecessary -
1.637     nicm     2973: .Nm
1.668     nicm     2974: will infer the type from the option name, assuming
                   2975: .Fl w
                   2976: for pane options.
1.133     nicm     2977: If
                   2978: .Fl g
1.433     nicm     2979: is given, the global session or window option is set.
1.637     nicm     2980: .Pp
1.550     nicm     2981: .Fl F
                   2982: expands formats in the option value.
1.1       nicm     2983: The
                   2984: .Fl u
                   2985: flag unsets an option, so a session inherits the option from the global
1.433     nicm     2986: options (or with
                   2987: .Fl g ,
                   2988: restores a global option to the default).
1.336     nicm     2989: .Pp
                   2990: The
                   2991: .Fl o
1.446     nicm     2992: flag prevents setting an option that is already set and the
1.281     nicm     2993: .Fl q
1.446     nicm     2994: flag suppresses errors about unknown or ambiguous options.
1.281     nicm     2995: .Pp
1.378     nicm     2996: With
                   2997: .Fl a ,
                   2998: and if the option expects a string or a style,
                   2999: .Ar value
                   3000: is appended to the existing setting.
                   3001: For example:
                   3002: .Bd -literal -offset indent
                   3003: set -g status-left "foo"
                   3004: set -ag status-left "bar"
                   3005: .Ed
                   3006: .Pp
                   3007: Will result in
                   3008: .Ql foobar .
                   3009: And:
                   3010: .Bd -literal -offset indent
                   3011: set -g status-style "bg=red"
                   3012: set -ag status-style "fg=blue"
                   3013: .Ed
                   3014: .Pp
                   3015: Will result in a red background
                   3016: .Em and
                   3017: blue foreground.
                   3018: Without
                   3019: .Fl a ,
                   3020: the result would be the default background and a blue foreground.
1.668     nicm     3021: .It Xo Ic show-options
                   3022: .Op Fl AgHpqsvw
                   3023: .Op Fl t Ar target-pane
                   3024: .Op Ar option
                   3025: .Xc
                   3026: .D1 (alias: Ic show )
                   3027: Show the pane options (or a single option if
                   3028: .Ar option
                   3029: is provided) with
                   3030: .Fl p ,
                   3031: the window options with
                   3032: .Fl w ,
                   3033: the server options with
                   3034: .Fl s ,
                   3035: otherwise the session options.
                   3036: If the option is not a user option,
                   3037: .Fl w
                   3038: or
                   3039: .Fl s
                   3040: may be unnecessary -
                   3041: .Nm
                   3042: will infer the type from the option name, assuming
                   3043: .Fl w
                   3044: for pane options.
                   3045: Global session or window options are listed if
                   3046: .Fl g
                   3047: is used.
                   3048: .Fl v
                   3049: shows only the option value, not the name.
                   3050: If
                   3051: .Fl q
                   3052: is set, no error will be returned if
                   3053: .Ar option
                   3054: is unset.
                   3055: .Fl H
                   3056: includes hooks (omitted by default).
                   3057: .Fl A
                   3058: includes options inherited from a parent set of options, such options are
                   3059: marked with an asterisk.
1.274     nicm     3060: .Ar value
                   3061: depends on the option and may be a number, a string, or a flag (on, off, or
                   3062: omitted to toggle).
1.668     nicm     3063: .El
1.133     nicm     3064: .Pp
                   3065: Available server options are:
                   3066: .Bl -tag -width Ds
1.695     nicm     3067: .It Ic backspace Ar key
                   3068: Set the key sent by
                   3069: .Nm
                   3070: for backspace.
1.198     nicm     3071: .It Ic buffer-limit Ar number
                   3072: Set the number of buffers; as new buffers are added to the top of the stack,
                   3073: old ones are removed from the bottom if necessary to maintain this maximum
                   3074: length.
1.526     nicm     3075: .It Xo Ic command-alias[]
                   3076: .Ar name=value
                   3077: .Xc
                   3078: This is an array of custom aliases for commands.
                   3079: If an unknown command matches
                   3080: .Ar name ,
                   3081: it is replaced with
                   3082: .Ar value .
                   3083: For example, after:
                   3084: .Pp
1.565     nicm     3085: .Dl set -s command-alias[100] zoom='resize-pane -Z'
1.526     nicm     3086: .Pp
                   3087: Using:
                   3088: .Pp
                   3089: .Dl zoom -t:.1
                   3090: .Pp
                   3091: Is equivalent to:
                   3092: .Pp
                   3093: .Dl resize-pane -Z -t:.1
                   3094: .Pp
                   3095: Note that aliases are expanded when a command is parsed rather than when it is
                   3096: executed, so binding an alias with
                   3097: .Ic bind-key
                   3098: will bind the expanded form.
1.425     nicm     3099: .It Ic default-terminal Ar terminal
                   3100: Set the default terminal for new windows created in this session - the
                   3101: default value of the
                   3102: .Ev TERM
                   3103: environment variable.
                   3104: For
                   3105: .Nm
                   3106: to work correctly, this
                   3107: .Em must
                   3108: be set to
                   3109: .Ql screen ,
                   3110: .Ql tmux
                   3111: or a derivative of them.
1.742     nicm     3112: .It Ic copy-command Ar shell-command
                   3113: Give the command to pipe to if the
                   3114: .Ic copy-pipe
                   3115: copy mode command is used without arguments.
1.239     nicm     3116: .It Ic escape-time Ar time
                   3117: Set the time in milliseconds for which
                   3118: .Nm
                   3119: waits after an escape is input to determine if it is part of a function or meta
                   3120: key sequences.
                   3121: The default is 500 milliseconds.
1.759     nicm     3122: .It Ic editor Ar shell-command
                   3123: Set the command used when
                   3124: .Nm
                   3125: runs an editor.
1.592     nicm     3126: .It Xo Ic exit-empty
                   3127: .Op Ic on | off
                   3128: .Xc
                   3129: If enabled (the default), the server will exit when there are no active
                   3130: sessions.
1.239     nicm     3131: .It Xo Ic exit-unattached
                   3132: .Op Ic on | off
                   3133: .Xc
                   3134: If enabled, the server will exit when there are no attached clients.
1.362     nicm     3135: .It Xo Ic focus-events
                   3136: .Op Ic on | off
                   3137: .Xc
                   3138: When enabled, focus events are requested from the terminal if supported and
                   3139: passed through to applications running in
                   3140: .Nm .
                   3141: Attached clients should be detached and attached again after changing this
                   3142: option.
1.445     nicm     3143: .It Ic history-file Ar path
                   3144: If not empty, a file to which
                   3145: .Nm
                   3146: will write command prompt history on exit and load it from on start.
1.384     nicm     3147: .It Ic message-limit Ar number
                   3148: Set the number of error or information messages to save in the message log for
                   3149: each client.
                   3150: The default is 100.
1.228     nicm     3151: .It Xo Ic set-clipboard
1.556     nicm     3152: .Op Ic on | external | off
1.228     nicm     3153: .Xc
                   3154: Attempt to set the terminal clipboard content using the
                   3155: .Xr xterm 1
1.560     nicm     3156: escape sequence, if there is an
1.228     nicm     3157: .Em \&Ms
                   3158: entry in the
                   3159: .Xr terminfo 5
1.560     nicm     3160: description (see the
                   3161: .Sx TERMINFO EXTENSIONS
                   3162: section).
                   3163: .Pp
1.556     nicm     3164: If set to
                   3165: .Ic on ,
                   3166: .Nm
                   3167: will both accept the escape sequence to create a buffer and attempt to set
                   3168: the terminal clipboard.
                   3169: If set to
                   3170: .Ic external ,
                   3171: .Nm
                   3172: will attempt to set the terminal clipboard but ignore attempts
                   3173: by applications to set
                   3174: .Nm
                   3175: buffers.
                   3176: If
                   3177: .Ic off ,
                   3178: .Nm
                   3179: will neither accept the clipboard escape sequence nor attempt to set the
                   3180: clipboard.
                   3181: .Pp
1.228     nicm     3182: Note that this feature needs to be enabled in
                   3183: .Xr xterm 1
                   3184: by setting the resource:
                   3185: .Bd -literal -offset indent
                   3186: disallowedWindowOps: 20,21,SetXprop
                   3187: .Ed
                   3188: .Pp
                   3189: Or changing this property from the
                   3190: .Xr xterm 1
                   3191: interactive menu when required.
1.744     nicm     3192: .It Ic terminal-features[] Ar string
                   3193: Set terminal features for terminal types read from
                   3194: .Xr terminfo 5 .
                   3195: .Nm
                   3196: has a set of named terminal features.
                   3197: Each will apply appropriate changes to the
                   3198: .Xr terminfo 5
                   3199: entry in use.
                   3200: .Pp
                   3201: .Nm
                   3202: can detect features for a few common terminals; this option can be used to
                   3203: easily tell tmux about features supported by terminals it cannot detect.
                   3204: The
                   3205: .Ic terminal-overrides
                   3206: option allows individual
                   3207: .Xr terminfo 5
                   3208: capabilities to be set instead,
                   3209: .Ic terminal-features
                   3210: is intended for classes of functionality supported in a standard way but not
                   3211: reported by
                   3212: .Xr terminfo 5 .
                   3213: Care must be taken only to configure this with features the terminal actually
                   3214: support.
                   3215: .Pp
                   3216: This is an array option where each entry is a colon-separated string made up
                   3217: of a terminal type pattern (matched using
                   3218: .Xr fnmatch 3 )
                   3219: followed by a list of terminal features.
                   3220: The available features are:
                   3221: .Bl -tag -width Ds
                   3222: .It 256
                   3223: Supports 256 colours with the SGR escape sequences.
                   3224: .It clipboard
                   3225: Allows setting the system clipboard.
                   3226: .It ccolour
                   3227: Allows setting the cursor colour.
                   3228: .It cstyle
                   3229: Allows setting the cursor style.
                   3230: .It margins
                   3231: Supports DECSLRM margins.
                   3232: .It overline
                   3233: Supports the overline SGR attribute.
                   3234: .It rectfill
                   3235: Supports the DECFRA rectangle fill escape sequence.
                   3236: .It RGB
                   3237: Supports RGB colour with the SGR escape sequences.
                   3238: .It sync
                   3239: Supports synchronized updates.
                   3240: .It title
                   3241: Supports
                   3242: .Xr xterm 1
                   3243: title setting.
                   3244: .It usstyle
                   3245: Allows underscore style and colour to be set.
                   3246: .It UTF-8
                   3247: Is able to handle UTF-8 output.
                   3248: .El
1.528     nicm     3249: .It Ic terminal-overrides[] Ar string
                   3250: Allow terminal descriptions read using
                   3251: .Xr terminfo 5
1.531     nicm     3252: to be overridden.
1.528     nicm     3253: Each entry is a colon-separated string made up of a terminal type pattern
                   3254: (matched using
1.381     nicm     3255: .Xr fnmatch 3 )
                   3256: and a set of
                   3257: .Em name=value
                   3258: entries.
                   3259: .Pp
                   3260: For example, to set the
                   3261: .Ql clear
                   3262: .Xr terminfo 5
                   3263: entry to
                   3264: .Ql \ee[H\ee[2J
1.528     nicm     3265: for all terminal types matching
                   3266: .Ql rxvt* :
                   3267: .Pp
                   3268: .Dl "rxvt*:clear=\ee[H\ee[2J"
1.381     nicm     3269: .Pp
                   3270: The terminal entry value is passed through
                   3271: .Xr strunvis 3
                   3272: before interpretation.
1.678     nicm     3273: .It Ic user-keys[] Ar key
                   3274: Set list of user-defined key escape sequences.
                   3275: Each item is associated with a key named
                   3276: .Ql User0 ,
                   3277: .Ql User1 ,
                   3278: and so on.
                   3279: .Pp
                   3280: For example:
                   3281: .Bd -literal -offset indent
                   3282: set -s user-keys[0] "\ee[5;30012~"
                   3283: bind User0 resize-pane -L 3
                   3284: .Ed
1.133     nicm     3285: .El
1.129     nicm     3286: .Pp
1.18      nicm     3287: Available session options are:
1.1       nicm     3288: .Bl -tag -width Ds
1.569     nicm     3289: .It Xo Ic activity-action
                   3290: .Op Ic any | none | current | other
                   3291: .Xc
                   3292: Set action on window activity when
                   3293: .Ic monitor-activity
                   3294: is on.
                   3295: .Ic any
                   3296: means activity in any window linked to a session causes a bell or message
                   3297: (depending on
                   3298: .Ic visual-activity )
                   3299: in the current window of that session,
                   3300: .Ic none
                   3301: means all activity is ignored (equivalent to
                   3302: .Ic monitor-activity
                   3303: being off),
                   3304: .Ic current
                   3305: means only activity in windows other than the current window are ignored and
                   3306: .Ic other
                   3307: means activity in the current window is ignored but not those in other windows.
1.312     nicm     3308: .It Ic assume-paste-time Ar milliseconds
                   3309: If keys are entered faster than one in
                   3310: .Ar milliseconds ,
                   3311: they are assumed to have been pasted rather than typed and
                   3312: .Nm
                   3313: key bindings are not processed.
                   3314: The default is one millisecond and zero disables.
1.69      nicm     3315: .It Ic base-index Ar index
                   3316: Set the base index from which an unused index should be searched when a new
                   3317: window is created.
                   3318: The default is zero.
1.1       nicm     3319: .It Xo Ic bell-action
1.429     nicm     3320: .Op Ic any | none | current | other
1.1       nicm     3321: .Xc
1.574     nicm     3322: Set action on a bell in a window when
                   3323: .Ic monitor-bell
                   3324: is on.
1.569     nicm     3325: The values are the same as those for
                   3326: .Ic activity-action .
1.153     nicm     3327: .It Ic default-command Ar shell-command
1.1       nicm     3328: Set the command used for new windows (if not specified when the window is
                   3329: created) to
1.153     nicm     3330: .Ar shell-command ,
1.79      nicm     3331: which may be any
                   3332: .Xr sh 1
                   3333: command.
1.19      nicm     3334: The default is an empty string, which instructs
                   3335: .Nm
1.79      nicm     3336: to create a login shell using the value of the
                   3337: .Ic default-shell
                   3338: option.
                   3339: .It Ic default-shell Ar path
                   3340: Specify the default shell.
                   3341: This is used as the login shell for new windows when the
                   3342: .Ic default-command
                   3343: option is set to empty, and must be the full path of the executable.
                   3344: When started
                   3345: .Nm
                   3346: tries to set a default value from the first suitable of the
1.19      nicm     3347: .Ev SHELL
1.79      nicm     3348: environment variable, the shell returned by
                   3349: .Xr getpwuid 3 ,
                   3350: or
                   3351: .Pa /bin/sh .
                   3352: This option should be configured when
                   3353: .Nm
                   3354: is used as a login shell.
1.629     nicm     3355: .It Ic default-size Ar XxY
1.642     nicm     3356: Set the default size of new windows when the
1.643     nicm     3357: .Ic window-size
1.642     nicm     3358: option is set to manual or when a session is created with
                   3359: .Ic new-session
                   3360: .Fl d .
                   3361: The value is the width and height separated by an
                   3362: .Ql x
                   3363: character.
                   3364: The default is 80x24.
1.206     nicm     3365: .It Xo Ic destroy-unattached
                   3366: .Op Ic on | off
                   3367: .Xc
1.185     nicm     3368: If enabled and the session is no longer attached to any clients, it is
                   3369: destroyed.
1.206     nicm     3370: .It Xo Ic detach-on-destroy
                   3371: .Op Ic on | off
                   3372: .Xc
1.184     nicm     3373: If on (the default), the client is detached when the session it is attached to
                   3374: is destroyed.
                   3375: If off, the client is switched to the most recently active of the remaining
                   3376: sessions.
1.145     nicm     3377: .It Ic display-panes-active-colour Ar colour
                   3378: Set the colour used by the
                   3379: .Ic display-panes
                   3380: command to show the indicator for the active pane.
1.78      nicm     3381: .It Ic display-panes-colour Ar colour
1.145     nicm     3382: Set the colour used by the
1.78      nicm     3383: .Ic display-panes
1.145     nicm     3384: command to show the indicators for inactive panes.
1.78      nicm     3385: .It Ic display-panes-time Ar time
                   3386: Set the time in milliseconds for which the indicators shown by the
                   3387: .Ic display-panes
                   3388: command appear.
1.21      nicm     3389: .It Ic display-time Ar time
1.78      nicm     3390: Set the amount of time for which status line messages and other on-screen
                   3391: indicators are displayed.
1.462     tim      3392: If set to 0, messages and indicators are displayed until a key is pressed.
1.21      nicm     3393: .Ar time
                   3394: is in milliseconds.
1.1       nicm     3395: .It Ic history-limit Ar lines
                   3396: Set the maximum number of lines held in window history.
                   3397: This setting applies only to new windows - existing window histories are not
                   3398: resized and retain the limit at the point they were created.
1.474     nicm     3399: .It Ic key-table Ar key-table
                   3400: Set the default key table to
                   3401: .Ar key-table
                   3402: instead of
                   3403: .Em root .
1.1       nicm     3404: .It Ic lock-after-time Ar number
1.100     nicm     3405: Lock the session (like the
                   3406: .Ic lock-session
1.90      nicm     3407: command) after
1.1       nicm     3408: .Ar number
1.448     nicm     3409: seconds of inactivity.
1.100     nicm     3410: The default is not to lock (set to 0).
1.153     nicm     3411: .It Ic lock-command Ar shell-command
1.90      nicm     3412: Command to run when locking each client.
                   3413: The default is to run
                   3414: .Xr lock 1
                   3415: with
                   3416: .Fl np .
1.378     nicm     3417: .It Ic message-command-style Ar style
1.623     nicm     3418: Set status line message command style.
1.737     nicm     3419: This is used for the command prompt with
                   3420: .Xr vi 1
                   3421: keys when in command mode.
1.623     nicm     3422: For how to specify
                   3423: .Ar style ,
                   3424: see the
                   3425: .Sx STYLES
                   3426: section.
1.378     nicm     3427: .It Ic message-style Ar style
                   3428: Set status line message style.
1.737     nicm     3429: This is used for messages and for the command prompt.
1.378     nicm     3430: For how to specify
                   3431: .Ar style ,
                   3432: see the
1.623     nicm     3433: .Sx STYLES
                   3434: section.
1.419     nicm     3435: .It Xo Ic mouse
1.226     nicm     3436: .Op Ic on | off
                   3437: .Xc
                   3438: If on,
                   3439: .Nm
1.419     nicm     3440: captures the mouse and allows mouse events to be bound as key bindings.
                   3441: See the
                   3442: .Sx MOUSE SUPPORT
                   3443: section for details.
1.267     nicm     3444: .It Ic prefix Ar key
                   3445: Set the key accepted as a prefix key.
1.473     nicm     3446: In addition to the standard keys described under
                   3447: .Sx KEY BINDINGS ,
                   3448: .Ic prefix
                   3449: can be set to the special key
                   3450: .Ql None
                   3451: to set no prefix.
1.267     nicm     3452: .It Ic prefix2 Ar key
                   3453: Set a secondary key accepted as a prefix key.
1.473     nicm     3454: Like
                   3455: .Ic prefix ,
                   3456: .Ic prefix2
                   3457: can be set to
                   3458: .Ql None .
1.291     nicm     3459: .It Xo Ic renumber-windows
                   3460: .Op Ic on | off
                   3461: .Xc
                   3462: If on, when a window is closed in a session, automatically renumber the other
                   3463: windows in numerical order.
                   3464: This respects the
                   3465: .Ic base-index
                   3466: option if it has been set.
                   3467: If off, do not renumber the windows.
1.21      nicm     3468: .It Ic repeat-time Ar time
1.1       nicm     3469: Allow multiple commands to be entered without pressing the prefix-key again
                   3470: in the specified
1.21      nicm     3471: .Ar time
1.1       nicm     3472: milliseconds (the default is 500).
                   3473: Whether a key repeats may be set when it is bound using the
                   3474: .Fl r
                   3475: flag to
                   3476: .Ic bind-key .
1.52      nicm     3477: Repeat is enabled for the default keys bound to the
                   3478: .Ic resize-pane
                   3479: command.
1.1       nicm     3480: .It Xo Ic set-titles
1.56      jmc      3481: .Op Ic on | off
1.1       nicm     3482: .Xc
1.261     nicm     3483: Attempt to set the client terminal title using the
                   3484: .Em tsl
                   3485: and
                   3486: .Em fsl
                   3487: .Xr terminfo 5
                   3488: entries if they exist.
                   3489: .Nm
1.444     nicm     3490: automatically sets these to the \ee]0;...\e007 sequence if
                   3491: the terminal appears to be
                   3492: .Xr xterm 1 .
1.11      nicm     3493: This option is off by default.
1.86      nicm     3494: .It Ic set-titles-string Ar string
1.678     nicm     3495: String used to set the client terminal title if
1.86      nicm     3496: .Ic set-titles
                   3497: is on.
1.414     nicm     3498: Formats are expanded, see the
                   3499: .Sx FORMATS
                   3500: section.
1.569     nicm     3501: .It Xo Ic silence-action
                   3502: .Op Ic any | none | current | other
                   3503: .Xc
                   3504: Set action on window silence when
                   3505: .Ic monitor-silence
                   3506: is on.
                   3507: The values are the same as those for
                   3508: .Ic activity-action .
1.1       nicm     3509: .It Xo Ic status
1.625     nicm     3510: .Op Ic off | on | 2 | 3 | 4 | 5
1.1       nicm     3511: .Xc
1.625     nicm     3512: Show or hide the status line or specify its size.
                   3513: Using
                   3514: .Ic on
                   3515: gives a status line one row in height;
                   3516: .Ic 2 ,
                   3517: .Ic 3 ,
                   3518: .Ic 4
                   3519: or
                   3520: .Ic 5
                   3521: more rows.
                   3522: .It Ic status-format[] Ar format
                   3523: Specify the format to be used for each line of the status line.
                   3524: The default builds the top status line from the various individual status
                   3525: options below.
1.1       nicm     3526: .It Ic status-interval Ar interval
1.538     nicm     3527: Update the status line every
1.1       nicm     3528: .Ar interval
                   3529: seconds.
                   3530: By default, updates will occur every 15 seconds.
                   3531: A setting of zero disables redrawing at interval.
1.41      nicm     3532: .It Xo Ic status-justify
1.56      jmc      3533: .Op Ic left | centre | right
1.41      nicm     3534: .Xc
                   3535: Set the position of the window list component of the status line: left, centre
                   3536: or right justified.
1.1       nicm     3537: .It Xo Ic status-keys
1.56      jmc      3538: .Op Ic vi | emacs
1.1       nicm     3539: .Xc
1.6       jmc      3540: Use vi or emacs-style
1.1       nicm     3541: key bindings in the status line, for example at the command prompt.
1.191     nicm     3542: The default is emacs, unless the
                   3543: .Ev VISUAL
                   3544: or
                   3545: .Ev EDITOR
                   3546: environment variables are set and contain the string
                   3547: .Ql vi .
1.1       nicm     3548: .It Ic status-left Ar string
                   3549: Display
                   3550: .Ar string
1.538     nicm     3551: (by default the session name) to the left of the status line.
1.1       nicm     3552: .Ar string
                   3553: will be passed through
1.623     nicm     3554: .Xr strftime 3 .
                   3555: Also see the
                   3556: .Sx FORMATS
                   3557: and
                   3558: .Sx STYLES
                   3559: sections.
1.83      nicm     3560: .Pp
1.263     nicm     3561: For details on how the names and titles can be set see the
1.261     nicm     3562: .Sx "NAMES AND TITLES"
                   3563: section.
1.109     nicm     3564: .Pp
1.83      nicm     3565: Examples are:
                   3566: .Bd -literal -offset indent
                   3567: #(sysctl vm.loadavg)
                   3568: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
                   3569: .Ed
1.10      nicm     3570: .Pp
1.405     nicm     3571: The default is
                   3572: .Ql "[#S] " .
1.1       nicm     3573: .It Ic status-left-length Ar length
                   3574: Set the maximum
                   3575: .Ar length
1.538     nicm     3576: of the left component of the status line.
1.1       nicm     3577: The default is 10.
1.378     nicm     3578: .It Ic status-left-style Ar style
                   3579: Set the style of the left part of the status line.
                   3580: For how to specify
                   3581: .Ar style ,
                   3582: see the
1.623     nicm     3583: .Sx STYLES
                   3584: section.
1.269     nicm     3585: .It Xo Ic status-position
                   3586: .Op Ic top | bottom
                   3587: .Xc
                   3588: Set the position of the status line.
1.1       nicm     3589: .It Ic status-right Ar string
                   3590: Display
                   3591: .Ar string
1.538     nicm     3592: to the right of the status line.
1.577     nicm     3593: By default, the current pane title in double quotes, the date and the time
1.151     nicm     3594: are shown.
1.1       nicm     3595: As with
                   3596: .Ic status-left ,
                   3597: .Ar string
                   3598: will be passed to
1.459     jmc      3599: .Xr strftime 3
                   3600: and character pairs are replaced.
1.1       nicm     3601: .It Ic status-right-length Ar length
                   3602: Set the maximum
                   3603: .Ar length
1.538     nicm     3604: of the right component of the status line.
1.1       nicm     3605: The default is 40.
1.378     nicm     3606: .It Ic status-right-style Ar style
                   3607: Set the style of the right part of the status line.
                   3608: For how to specify
                   3609: .Ar style ,
                   3610: see the
1.623     nicm     3611: .Sx STYLES
                   3612: section.
1.378     nicm     3613: .It Ic status-style Ar style
                   3614: Set status line style.
                   3615: For how to specify
                   3616: .Ar style ,
                   3617: see the
1.623     nicm     3618: .Sx STYLES
                   3619: section.
1.529     nicm     3620: .It Ic update-environment[] Ar variable
                   3621: Set list of environment variables to be copied into the session environment
                   3622: when a new session is created or an existing session is attached.
1.63      nicm     3623: Any variables that do not exist in the source environment are set to be
                   3624: removed from the session environment (as if
                   3625: .Fl r
                   3626: was given to the
                   3627: .Ic set-environment
                   3628: command).
1.37      nicm     3629: .It Xo Ic visual-activity
1.569     nicm     3630: .Op Ic on | off | both
1.37      nicm     3631: .Xc
1.569     nicm     3632: If on, display a message instead of sending a bell when activity occurs in a
                   3633: window for which the
1.37      nicm     3634: .Ic monitor-activity
                   3635: window option is enabled.
1.569     nicm     3636: If set to both, a bell and a message are produced.
1.37      nicm     3637: .It Xo Ic visual-bell
1.569     nicm     3638: .Op Ic on | off | both
1.37      nicm     3639: .Xc
1.574     nicm     3640: If on, a message is shown on a bell in a window for which the
                   3641: .Ic monitor-bell
                   3642: window option is enabled instead of it being passed through to the
1.569     nicm     3643: terminal (which normally makes a sound).
                   3644: If set to both, a bell and a message are produced.
1.37      nicm     3645: Also see the
                   3646: .Ic bell-action
                   3647: option.
1.192     nicm     3648: .It Xo Ic visual-silence
1.569     nicm     3649: .Op Ic on | off | both
1.192     nicm     3650: .Xc
                   3651: If
                   3652: .Ic monitor-silence
1.569     nicm     3653: is enabled, prints a message after the interval has expired on a given window
                   3654: instead of sending a bell.
                   3655: If set to both, a bell and a message are produced.
1.255     nicm     3656: .It Ic word-separators Ar string
                   3657: Sets the session's conception of what characters are considered word
                   3658: separators, for the purposes of the next and previous word commands in
                   3659: copy mode.
                   3660: The default is
                   3661: .Ql \ -_@ .
1.1       nicm     3662: .El
                   3663: .Pp
1.668     nicm     3664: Available window options are:
1.56      jmc      3665: .Pp
                   3666: .Bl -tag -width Ds -compact
1.1       nicm     3667: .It Xo Ic aggressive-resize
1.56      jmc      3668: .Op Ic on | off
1.1       nicm     3669: .Xc
                   3670: Aggressively resize the chosen window.
                   3671: This means that
                   3672: .Nm
1.642     nicm     3673: will resize the window to the size of the smallest or largest session
                   3674: (see the
                   3675: .Ic window-size
                   3676: option) for which it is the current window, rather than the session to
                   3677: which it is attached.
                   3678: The window may resize when the current window is changed on another
                   3679: session; this option is good for full-screen programs which support
1.6       jmc      3680: .Dv SIGWINCH
                   3681: and poor for interactive programs such as shells.
1.262     nicm     3682: .Pp
1.1       nicm     3683: .It Xo Ic automatic-rename
1.56      jmc      3684: .Op Ic on | off
1.1       nicm     3685: .Xc
                   3686: Control automatic window renaming.
                   3687: When this setting is enabled,
                   3688: .Nm
1.368     nicm     3689: will rename the window automatically using the format specified by
                   3690: .Ic automatic-rename-format .
1.1       nicm     3691: This flag is automatically disabled for an individual window when a name
                   3692: is specified at creation with
1.186     nicm     3693: .Ic new-window
                   3694: or
1.1       nicm     3695: .Ic new-session ,
                   3696: or later with
1.261     nicm     3697: .Ic rename-window ,
                   3698: or with a terminal escape sequence.
1.1       nicm     3699: It may be switched off globally with:
                   3700: .Bd -literal -offset indent
1.668     nicm     3701: set-option -wg automatic-rename off
1.1       nicm     3702: .Ed
1.368     nicm     3703: .Pp
                   3704: .It Ic automatic-rename-format Ar format
                   3705: The format (see
                   3706: .Sx FORMATS )
                   3707: used when the
                   3708: .Ic automatic-rename
                   3709: option is enabled.
1.56      jmc      3710: .Pp
1.1       nicm     3711: .It Ic clock-mode-colour Ar colour
                   3712: Set clock colour.
1.56      jmc      3713: .Pp
1.1       nicm     3714: .It Xo Ic clock-mode-style
1.56      jmc      3715: .Op Ic 12 | 24
1.1       nicm     3716: .Xc
                   3717: Set clock hour format.
1.56      jmc      3718: .Pp
1.196     nicm     3719: .It Ic main-pane-height Ar height
1.2       nicm     3720: .It Ic main-pane-width Ar width
                   3721: Set the width or height of the main (left or top) pane in the
                   3722: .Ic main-horizontal
                   3723: or
                   3724: .Ic main-vertical
                   3725: layouts.
1.747     nicm     3726: If suffixed by
                   3727: .Ql % ,
                   3728: this is a percentage of the window size.
1.757     nicm     3729: .Pp
                   3730: .It Ic copy-mode-match-style Ar style
                   3731: Set the style of search matches in copy mode.
                   3732: For how to specify
                   3733: .Ar style ,
                   3734: see the
                   3735: .Sx STYLES
                   3736: section.
                   3737: .Pp
                   3738: .It Ic copy-mode-current-match-style Ar style
                   3739: Set the style of the current search match in copy mode.
                   3740: For how to specify
                   3741: .Ar style ,
                   3742: see the
                   3743: .Sx STYLES
                   3744: section.
1.56      jmc      3745: .Pp
1.1       nicm     3746: .It Xo Ic mode-keys
1.56      jmc      3747: .Op Ic vi | emacs
1.1       nicm     3748: .Xc
1.500     nicm     3749: Use vi or emacs-style key bindings in copy mode.
                   3750: The default is emacs, unless
1.191     nicm     3751: .Ev VISUAL
                   3752: or
                   3753: .Ev EDITOR
                   3754: contains
                   3755: .Ql vi .
1.56      jmc      3756: .Pp
1.378     nicm     3757: .It Ic mode-style Ar style
                   3758: Set window modes style.
                   3759: For how to specify
                   3760: .Ar style ,
                   3761: see the
1.623     nicm     3762: .Sx STYLES
                   3763: section.
1.378     nicm     3764: .Pp
1.1       nicm     3765: .It Xo Ic monitor-activity
1.56      jmc      3766: .Op Ic on | off
1.1       nicm     3767: .Xc
                   3768: Monitor for activity in the window.
                   3769: Windows with activity are highlighted in the status line.
1.56      jmc      3770: .Pp
1.574     nicm     3771: .It Xo Ic monitor-bell
                   3772: .Op Ic on | off
                   3773: .Xc
                   3774: Monitor for a bell in the window.
                   3775: Windows with a bell are highlighted in the status line.
                   3776: .Pp
1.192     nicm     3777: .It Xo Ic monitor-silence
                   3778: .Op Ic interval
                   3779: .Xc
                   3780: Monitor for silence (no activity) in the window within
                   3781: .Ic interval
                   3782: seconds.
                   3783: Windows that have been silent for the interval are highlighted in the
                   3784: status line.
                   3785: An interval of zero disables the monitoring.
1.195     nicm     3786: .Pp
                   3787: .It Ic other-pane-height Ar height
                   3788: Set the height of the other panes (not the main pane) in the
                   3789: .Ic main-horizontal
                   3790: layout.
                   3791: If this option is set to 0 (the default), it will have no effect.
                   3792: If both the
                   3793: .Ic main-pane-height
                   3794: and
                   3795: .Ic other-pane-height
                   3796: options are set, the main pane will grow taller to make the other panes the
                   3797: specified height, but will never shrink to do so.
1.747     nicm     3798: If suffixed by
                   3799: .Ql % ,
                   3800: this is a percentage of the window size.
1.195     nicm     3801: .Pp
                   3802: .It Ic other-pane-width Ar width
                   3803: Like
                   3804: .Ic other-pane-height ,
                   3805: but set the width of other panes in the
                   3806: .Ic main-vertical
                   3807: layout.
1.243     nicm     3808: .Pp
1.413     nicm     3809: .It Ic pane-active-border-style Ar style
                   3810: Set the pane border style for the currently active pane.
                   3811: For how to specify
                   3812: .Ar style ,
                   3813: see the
1.623     nicm     3814: .Sx STYLES
                   3815: section.
1.413     nicm     3816: Attributes are ignored.
                   3817: .Pp
1.243     nicm     3818: .It Ic pane-base-index Ar index
                   3819: Like
                   3820: .Ic base-index ,
                   3821: but set the starting index for pane numbers.
1.484     nicm     3822: .Pp
                   3823: .It Ic pane-border-format Ar format
                   3824: Set the text shown in pane border status lines.
                   3825: .Pp
                   3826: .It Xo Ic pane-border-status
                   3827: .Op Ic off | top | bottom
                   3828: .Xc
                   3829: Turn pane border status lines off or set their position.
1.413     nicm     3830: .Pp
                   3831: .It Ic pane-border-style Ar style
                   3832: Set the pane border style for panes aside from the active pane.
                   3833: For how to specify
                   3834: .Ar style ,
                   3835: see the
1.623     nicm     3836: .Sx STYLES
                   3837: section.
1.413     nicm     3838: Attributes are ignored.
1.192     nicm     3839: .Pp
1.99      nicm     3840: .It Xo Ic synchronize-panes
                   3841: .Op Ic on | off
                   3842: .Xc
1.164     nicm     3843: Duplicate input to any pane to all other panes in the same window (only
                   3844: for panes that are not in any special mode).
1.56      jmc      3845: .Pp
1.378     nicm     3846: .It Ic window-status-activity-style Ar style
                   3847: Set status line style for windows with an activity alert.
                   3848: For how to specify
                   3849: .Ar style ,
                   3850: see the
1.623     nicm     3851: .Sx STYLES
                   3852: section.
1.169     nicm     3853: .Pp
1.378     nicm     3854: .It Ic window-status-bell-style Ar style
                   3855: Set status line style for windows with a bell alert.
                   3856: For how to specify
                   3857: .Ar style ,
                   3858: see the
1.623     nicm     3859: .Sx STYLES
                   3860: section.
1.169     nicm     3861: .Pp
1.125     nicm     3862: .It Ic window-status-current-format Ar string
                   3863: Like
                   3864: .Ar window-status-format ,
                   3865: but is the format used when the window is the current window.
1.307     nicm     3866: .Pp
1.378     nicm     3867: .It Ic window-status-current-style Ar style
                   3868: Set status line style for the currently active window.
                   3869: For how to specify
                   3870: .Ar style ,
                   3871: see the
1.623     nicm     3872: .Sx STYLES
                   3873: section.
1.239     nicm     3874: .Pp
                   3875: .It Ic window-status-format Ar string
                   3876: Set the format in which the window is displayed in the status line window list.
                   3877: See the
1.623     nicm     3878: .Sx FORMATS
                   3879: and
                   3880: .Sx STYLES
                   3881: sections.
1.290     nicm     3882: .Pp
1.378     nicm     3883: .It Ic window-status-last-style Ar style
                   3884: Set status line style for the last active window.
                   3885: For how to specify
                   3886: .Ar style ,
                   3887: see the
1.623     nicm     3888: .Sx STYLES
                   3889: section.
1.378     nicm     3890: .Pp
1.290     nicm     3891: .It Ic window-status-separator Ar string
                   3892: Sets the separator drawn between windows in the status line.
                   3893: The default is a single space character.
1.125     nicm     3894: .Pp
1.378     nicm     3895: .It Ic window-status-style Ar style
                   3896: Set status line style for a single window.
1.418     nicm     3897: For how to specify
                   3898: .Ar style ,
                   3899: see the
1.623     nicm     3900: .Sx STYLES
                   3901: section.
1.418     nicm     3902: .Pp
1.642     nicm     3903: .It Xo Ic window-size
1.689     nicm     3904: .Ar largest | Ar smallest | Ar manual | Ar latest
1.642     nicm     3905: .Xc
                   3906: Configure how
                   3907: .Nm
                   3908: determines the window size.
                   3909: If set to
                   3910: .Ar largest ,
                   3911: the size of the largest attached session is used; if
                   3912: .Ar smallest ,
                   3913: the size of the smallest.
                   3914: If
                   3915: .Ar manual ,
                   3916: the size of a new window is set from the
                   3917: .Ic default-size
                   3918: option and windows are resized automatically.
1.689     nicm     3919: With
                   3920: .Ar latest ,
                   3921: .Nm
                   3922: uses the size of the client that had the most recent activity.
1.642     nicm     3923: See also the
                   3924: .Ic resize-window
                   3925: command and the
                   3926: .Ic aggressive-resize
                   3927: option.
                   3928: .Pp
1.512     nicm     3929: .It Xo Ic wrap-search
                   3930: .Op Ic on | off
                   3931: .Xc
                   3932: If this option is set, searches will wrap around the end of the pane contents.
                   3933: The default is on.
1.513     nicm     3934: .Pp
1.1       nicm     3935: .It Xo Ic xterm-keys
1.56      jmc      3936: .Op Ic on | off
1.1       nicm     3937: .Xc
                   3938: If this option is set,
                   3939: .Nm
                   3940: will generate
1.57      jmc      3941: .Xr xterm 1 -style
                   3942: function key sequences; these have a number included to indicate modifiers such
                   3943: as Shift, Alt or Ctrl.
                   3944: .El
1.668     nicm     3945: .Pp
                   3946: Available pane options are:
                   3947: .Pp
                   3948: .Bl -tag -width Ds -compact
1.669     nicm     3949: .It Xo Ic allow-rename
                   3950: .Op Ic on | off
                   3951: .Xc
                   3952: Allow programs in the pane to change the window name using a terminal escape
                   3953: sequence (\eek...\ee\e\e).
                   3954: .Pp
                   3955: .It Xo Ic alternate-screen
                   3956: .Op Ic on | off
                   3957: .Xc
                   3958: This option configures whether programs running inside the pane may use the
                   3959: terminal alternate screen feature, which allows the
                   3960: .Em smcup
                   3961: and
                   3962: .Em rmcup
                   3963: .Xr terminfo 5
                   3964: capabilities.
                   3965: The alternate screen feature preserves the contents of the window when an
                   3966: interactive application starts and restores it on exit, so that any output
                   3967: visible before the application starts reappears unchanged after it exits.
                   3968: .Pp
1.668     nicm     3969: .It Xo Ic remain-on-exit
                   3970: .Op Ic on | off
1.57      jmc      3971: .Xc
1.668     nicm     3972: A pane with this flag set is not destroyed when the program running in it
                   3973: exits.
                   3974: The pane may be reactivated with the
                   3975: .Ic respawn-pane
                   3976: command.
                   3977: .Pp
                   3978: .It Ic window-active-style Ar style
                   3979: Set the pane style when it is the active pane.
                   3980: For how to specify
                   3981: .Ar style ,
                   3982: see the
                   3983: .Sx STYLES
                   3984: section.
                   3985: .Pp
                   3986: .It Ic window-style Ar style
                   3987: Set the pane style.
                   3988: For how to specify
                   3989: .Ar style ,
                   3990: see the
                   3991: .Sx STYLES
                   3992: section.
1.63      nicm     3993: .El
1.469     nicm     3994: .Sh HOOKS
                   3995: .Nm
                   3996: allows commands to run on various triggers, called
                   3997: .Em hooks .
1.505     nicm     3998: Most
1.483     nicm     3999: .Nm
1.505     nicm     4000: commands have an
1.483     nicm     4001: .Em after
                   4002: hook and there are a number of hooks not associated with commands.
                   4003: .Pp
1.640     nicm     4004: Hooks are stored as array options, members of the array are executed in
                   4005: order when the hook is triggered.
1.740     nicm     4006: Like options different hooks may be global or belong to a session, window or pane.
1.640     nicm     4007: Hooks may be configured with the
                   4008: .Ic set-hook
                   4009: or
                   4010: .Ic set-option
                   4011: commands and displayed with
                   4012: .Ic show-hooks
                   4013: or
                   4014: .Ic show-options
                   4015: .Fl H .
                   4016: The following two commands are equivalent:
                   4017: .Bd -literal -offset indent.
                   4018: set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red'
                   4019: set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red'
                   4020: .Ed
                   4021: .Pp
                   4022: Setting a hook without specifying an array index clears the hook and sets the
                   4023: first member of the array.
                   4024: .Pp
1.505     nicm     4025: A command's after
                   4026: hook is run after it completes, except when the command is run as part of a hook
1.483     nicm     4027: itself.
1.505     nicm     4028: They are named with an
1.483     nicm     4029: .Ql after-
                   4030: prefix.
                   4031: For example, the following command adds a hook to select the even-vertical
                   4032: layout after every
                   4033: .Ic split-window :
                   4034: .Bd -literal -offset indent
1.640     nicm     4035: set-hook -g after-split-window "selectl even-vertical"
1.483     nicm     4036: .Ed
                   4037: .Pp
1.584     nicm     4038: All the notifications listed in the
                   4039: .Sx CONTROL MODE
                   4040: section are hooks (without any arguments), except
                   4041: .Ic %exit .
                   4042: The following additional hooks are available:
1.560     nicm     4043: .Bl -tag -width "XXXXXXXXXXXXXXXXXXXXXX"
1.476     nicm     4044: .It alert-activity
                   4045: Run when a window has activity.
                   4046: See
                   4047: .Ic monitor-activity .
                   4048: .It alert-bell
                   4049: Run when a window has received a bell.
1.574     nicm     4050: See
                   4051: .Ic monitor-bell .
1.476     nicm     4052: .It alert-silence
                   4053: Run when a window has been silent.
                   4054: See
                   4055: .Ic monitor-silence .
1.469     nicm     4056: .It client-attached
                   4057: Run when a client is attached.
                   4058: .It client-detached
                   4059: Run when a client is detached
                   4060: .It client-resized
                   4061: Run when a client is resized.
1.511     nicm     4062: .It client-session-changed
                   4063: Run when a client's attached session is changed.
1.475     nicm     4064: .It pane-died
                   4065: Run when the program running in a pane exits, but
                   4066: .Ic remain-on-exit
                   4067: is on so the pane has not closed.
                   4068: .It pane-exited
                   4069: Run when the program running in a pane exits.
1.603     nicm     4070: .It pane-focus-in
                   4071: Run when the focus enters a pane, if the
                   4072: .Ic focus-events
                   4073: option is on.
                   4074: .It pane-focus-out
                   4075: Run when the focus exits a pane, if the
                   4076: .Ic focus-events
                   4077: option is on.
1.560     nicm     4078: .It pane-set-clipboard
                   4079: Run when the terminal clipboard is set using the
                   4080: .Xr xterm 1
                   4081: escape sequence.
1.510     nicm     4082: .It session-created
                   4083: Run when a new session created.
                   4084: .It session-closed
                   4085: Run when a session closed.
1.507     nicm     4086: .It session-renamed
                   4087: Run when a session is renamed.
1.511     nicm     4088: .It window-linked
                   4089: Run when a window is linked into a session.
1.507     nicm     4090: .It window-renamed
                   4091: Run when a window is renamed.
1.511     nicm     4092: .It window-unlinked
                   4093: Run when a window is unlinked from a session.
1.469     nicm     4094: .El
                   4095: .Pp
                   4096: Hooks are managed with these commands:
                   4097: .Bl -tag -width Ds
                   4098: .It Xo Ic set-hook
1.740     nicm     4099: .Op Fl agpRuw
                   4100: .Op Fl t Ar target-pane
1.469     nicm     4101: .Ar hook-name
                   4102: .Ar command
                   4103: .Xc
1.604     nicm     4104: Without
1.605     jmc      4105: .Fl R ,
1.604     nicm     4106: sets (or with
1.496     nicm     4107: .Fl u
                   4108: unsets) hook
1.469     nicm     4109: .Ar hook-name
                   4110: to
                   4111: .Ar command .
1.740     nicm     4112: The flags are the same as for
                   4113: .Ic set-option .
1.604     nicm     4114: .Pp
                   4115: With
                   4116: .Fl R ,
                   4117: run
                   4118: .Ar hook-name
                   4119: immediately.
1.469     nicm     4120: .It Xo Ic show-hooks
1.740     nicm     4121: .Op Fl gpw
                   4122: .Op Fl t Ar target-pane
1.469     nicm     4123: .Xc
1.740     nicm     4124: Shows hooks.
                   4125: The flags are the same as for
                   4126: .Ic show-options .
1.470     jmc      4127: .El
1.419     nicm     4128: .Sh MOUSE SUPPORT
                   4129: If the
                   4130: .Ic mouse
                   4131: option is on (the default is off),
                   4132: .Nm
                   4133: allows mouse events to be bound as keys.
                   4134: The name of each key is made up of a mouse event (such as
                   4135: .Ql MouseUp1 )
1.632     nicm     4136: and a location suffix, one of the following:
                   4137: .Bl -column "XXXXXXXXXXXXX" -offset indent
                   4138: .It Li "Pane" Ta "the contents of a pane"
                   4139: .It Li "Border" Ta "a pane border"
                   4140: .It Li "Status" Ta "the status line window list"
                   4141: .It Li "StatusLeft" Ta "the left part of the status line"
                   4142: .It Li "StatusRight" Ta "the right part of the status line"
                   4143: .It Li "StatusDefault" Ta "any other part of the status line"
                   4144: .El
                   4145: .Pp
1.419     nicm     4146: The following mouse events are available:
                   4147: .Bl -column "MouseDown1" "MouseDrag1" "WheelDown" -offset indent
1.498     nicm     4148: .It Li "WheelUp" Ta "WheelDown" Ta ""
1.481     nicm     4149: .It Li "MouseDown1" Ta "MouseUp1" Ta "MouseDrag1" Ta "MouseDragEnd1"
                   4150: .It Li "MouseDown2" Ta "MouseUp2" Ta "MouseDrag2" Ta "MouseDragEnd2"
                   4151: .It Li "MouseDown3" Ta "MouseUp3" Ta "MouseDrag3" Ta "MouseDragEnd3"
1.724     nicm     4152: .It Li "SecondClick1" Ta "SecondClick2" Ta "SecondClick3"
1.590     nicm     4153: .It Li "DoubleClick1" Ta "DoubleClick2" Ta "DoubleClick3"
                   4154: .It Li "TripleClick1" Ta "TripleClick2" Ta "TripleClick3"
1.419     nicm     4155: .El
1.724     nicm     4156: .Pp
                   4157: The
                   4158: .Ql SecondClick
                   4159: events are fired for the second click of a double click, even if there may be a
                   4160: third click which will fire
                   4161: .Ql TripleClick
                   4162: instead of
                   4163: .Ql DoubleClick .
1.419     nicm     4164: .Pp
                   4165: Each should be suffixed with a location, for example
                   4166: .Ql MouseDown1Status .
                   4167: .Pp
1.423     nicm     4168: The special token
                   4169: .Ql {mouse}
                   4170: or
1.419     nicm     4171: .Ql =
                   4172: may be used as
                   4173: .Ar target-window
                   4174: or
                   4175: .Ar target-pane
                   4176: in commands bound to mouse key bindings.
                   4177: It resolves to the window or pane over which the mouse event took place
                   4178: (for example, the window in the status line over which button 1 was released for a
                   4179: .Ql MouseUp1Status
                   4180: binding, or the pane over which the wheel was scrolled for a
                   4181: .Ql WheelDownPane
                   4182: binding).
                   4183: .Pp
                   4184: The
                   4185: .Ic send-keys
                   4186: .Fl M
                   4187: flag may be used to forward a mouse event to a pane.
                   4188: .Pp
                   4189: The default key bindings allow the mouse to be used to select and resize panes,
                   4190: to copy text and to change window using the status line.
                   4191: These take effect if the
                   4192: .Ic mouse
                   4193: option is turned on.
1.245     nicm     4194: .Sh FORMATS
1.294     nicm     4195: Certain commands accept the
1.245     nicm     4196: .Fl F
                   4197: flag with a
                   4198: .Ar format
                   4199: argument.
                   4200: This is a string which controls the output format of the command.
1.678     nicm     4201: Format variables are enclosed in
1.245     nicm     4202: .Ql #{
                   4203: and
                   4204: .Ql } ,
                   4205: for example
1.359     nicm     4206: .Ql #{session_name} .
1.409     nicm     4207: The possible variables are listed in the table below, or the name of a
                   4208: .Nm
                   4209: option may be used for an option's value.
                   4210: Some variables have a shorter alias such as
1.598     nicm     4211: .Ql #S ;
1.376     nicm     4212: .Ql ##
                   4213: is replaced by a single
1.598     nicm     4214: .Ql # ,
                   4215: .Ql #,
                   4216: by a
                   4217: .Ql \&,
                   4218: and
                   4219: .Ql #}
                   4220: by a
                   4221: .Ql } .
1.409     nicm     4222: .Pp
                   4223: Conditionals are available by prefixing with
1.246     jmc      4224: .Ql \&?
1.245     nicm     4225: and separating two alternatives with a comma;
                   4226: if the specified variable exists and is not zero, the first alternative
1.246     jmc      4227: is chosen, otherwise the second is used.
                   4228: For example
1.245     nicm     4229: .Ql #{?session_attached,attached,not attached}
                   4230: will include the string
                   4231: .Ql attached
                   4232: if the session is attached and the string
                   4233: .Ql not attached
1.409     nicm     4234: if it is unattached, or
                   4235: .Ql #{?automatic-rename,yes,no}
                   4236: will include
                   4237: .Ql yes
                   4238: if
                   4239: .Ic automatic-rename
                   4240: is enabled, or
                   4241: .Ql no
                   4242: if not.
1.599     nicm     4243: Conditionals can be nested arbitrarily.
                   4244: Inside a conditional,
                   4245: .Ql \&,
                   4246: and
                   4247: .Ql }
                   4248: must be escaped as
                   4249: .Ql #,
                   4250: and
                   4251: .Ql #} ,
                   4252: unless they are part of a
                   4253: .Ql #{...}
1.600     nicm     4254: replacement.
                   4255: For example:
1.599     nicm     4256: .Bd -literal -offset indent
                   4257: #{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W .
                   4258: .Ed
1.520     nicm     4259: .Pp
1.678     nicm     4260: String comparisons may be expressed by prefixing two comma-separated
1.520     nicm     4261: alternatives by
1.652     nicm     4262: .Ql == ,
                   4263: .Ql != ,
                   4264: .Ql < ,
                   4265: .Ql > ,
                   4266: .Ql <=
1.520     nicm     4267: or
1.652     nicm     4268: .Ql >=
1.520     nicm     4269: and a colon.
                   4270: For example
1.544     nicm     4271: .Ql #{==:#{host},myhost}
1.520     nicm     4272: will be replaced by
                   4273: .Ql 1
                   4274: if running on
                   4275: .Ql myhost ,
                   4276: otherwise by
1.554     nicm     4277: .Ql 0 .
                   4278: .Ql ||
                   4279: and
                   4280: .Ql &&
                   4281: evaluate to true if either or both of two comma-separated alternatives are
                   4282: true, for example
1.595     nicm     4283: .Ql #{||:#{pane_in_mode},#{alternate_on}} .
1.664     nicm     4284: .Pp
                   4285: An
                   4286: .Ql m
                   4287: specifies an
                   4288: .Xr fnmatch 3
                   4289: or regular expression comparison.
                   4290: The first argument is the pattern and the second the string to compare.
1.714     nicm     4291: An optional argument specifies flags:
1.664     nicm     4292: .Ql r
                   4293: means the pattern is a regular expression instead of the default
                   4294: .Xr fnmatch 3
                   4295: pattern, and
                   4296: .Ql i
                   4297: means to ignore case.
                   4298: For example:
                   4299: .Ql #{m:*foo*,#{host}}
                   4300: or
                   4301: .Ql #{m/ri:^A,MYVAR} .
1.554     nicm     4302: A
                   4303: .Ql C
                   4304: performs a search for an
                   4305: .Xr fnmatch 3
1.664     nicm     4306: pattern or regular expression in the pane content and evaluates to zero if not
                   4307: found, or a line number if found.
                   4308: Like
                   4309: .Ql m ,
1.665     jmc      4310: an
1.664     nicm     4311: .Ql r
                   4312: flag means search for a regular expression and
                   4313: .Ql i
                   4314: ignores case.
                   4315: For example:
                   4316: .Ql #{C/r:^Start}
1.714     nicm     4317: .Pp
                   4318: Numeric operators may be performed by prefixing two comma-separated alternatives with an
                   4319: .Ql e
                   4320: and an operator.
                   4321: An optional
                   4322: .Ql f
                   4323: flag may be given after the operator to use floating point numbers, otherwise integers are used.
                   4324: This may be followed by a number giving the number of decimal places to use for the result.
                   4325: The available operators are:
                   4326: addition
                   4327: .Ql + ,
                   4328: subtraction
                   4329: .Ql - ,
                   4330: multiplication
                   4331: .Ql * ,
                   4332: division
                   4333: .Ql / ,
                   4334: and modulus
                   4335: .Ql m
                   4336: or
                   4337: .Ql %
                   4338: (note that
                   4339: .Ql %
                   4340: must be escaped as
                   4341: .Ql %%
                   4342: in formats which are also expanded by
                   4343: .Xr strftime 3 ) .
                   4344: For example,
                   4345: .Ql #{e|*|f|4:5.5,3}
                   4346: multiplies 5.5 by 3 for a result with four decimal places and
                   4347: .Ql #{e|%%:7,3}
                   4348: returns the modulus of 7 and 3.
1.453     nicm     4349: .Pp
1.367     nicm     4350: A limit may be placed on the length of the resultant string by prefixing it
                   4351: by an
                   4352: .Ql = ,
1.479     nicm     4353: a number and a colon.
                   4354: Positive numbers count from the start of the string and negative from the end,
                   4355: so
                   4356: .Ql #{=5:pane_title}
1.653     nicm     4357: will include at most the first five characters of the pane title, or
1.479     nicm     4358: .Ql #{=-5:pane_title}
1.653     nicm     4359: the last five characters.
                   4360: A suffix or prefix may be given as a second argument - if provided then it is
                   4361: appended or prepended to the string if the length has been trimmed, for example
                   4362: .Ql #{=/5/...:pane_title}
                   4363: will append
                   4364: .Ql ...
                   4365: if the pane title is more than five characters.
1.698     nicm     4366: Similarly,
                   4367: .Ql p
                   4368: pads the string to a given width, for example
                   4369: .Ql #{p10:pane_title}
                   4370: will result in a width of at least 10 characters.
                   4371: A positive width pads on the left, a negative on the right.
1.653     nicm     4372: .Pp
1.453     nicm     4373: Prefixing a time variable with
1.683     nicm     4374: .Ql t:\&
1.453     nicm     4375: will convert it to a string, so if
                   4376: .Ql #{window_activity}
                   4377: gives
1.454     jmc      4378: .Ql 1445765102 ,
1.453     nicm     4379: .Ql #{t:window_activity}
                   4380: gives
                   4381: .Ql Sun Oct 25 09:25:02 2015 .
1.751     nicm     4382: Adding
                   4383: .Ql p (
                   4384: .Ql `t/p` )
                   4385: will use shorter but less accurate time format for times in the past.
1.453     nicm     4386: The
1.683     nicm     4387: .Ql b:\&
1.453     nicm     4388: and
1.683     nicm     4389: .Ql d:\&
1.453     nicm     4390: prefixes are
                   4391: .Xr basename 3
                   4392: and
                   4393: .Xr dirname 3
                   4394: of the variable respectively.
1.683     nicm     4395: .Ql q:\&
1.610     nicm     4396: will escape
                   4397: .Xr sh 1
                   4398: special characters.
1.683     nicm     4399: .Ql E:\&
1.617     nicm     4400: will expand the format twice, for example
                   4401: .Ql #{E:status-left}
                   4402: is the result of expanding the content of the
                   4403: .Ic status-left
1.671     nicm     4404: option rather than the option itself.
1.683     nicm     4405: .Ql T:\&
1.620     nicm     4406: is like
1.683     nicm     4407: .Ql E:\&
1.620     nicm     4408: but also expands
                   4409: .Xr strftime 3
                   4410: specifiers.
1.683     nicm     4411: .Ql S:\& ,
                   4412: .Ql W:\&
1.618     nicm     4413: or
1.683     nicm     4414: .Ql P:\&
1.618     nicm     4415: will loop over each session, window or pane and insert the format once
1.619     nicm     4416: for each.
                   4417: For windows and panes, two comma-separated formats may be given:
                   4418: the second is used for the current window or active pane.
                   4419: For example, to get a list of windows formatted like the status line:
1.618     nicm     4420: .Bd -literal -offset indent
                   4421: #{W:#{E:window-status-format} ,#{E:window-status-current-format} }
                   4422: .Ed
1.625     nicm     4423: .Pp
1.461     nicm     4424: A prefix of the form
1.683     nicm     4425: .Ql s/foo/bar/:\&
1.461     nicm     4426: will substitute
                   4427: .Ql foo
                   4428: with
                   4429: .Ql bar
                   4430: throughout.
1.664     nicm     4431: The first argument may be an extended regular expression and a final argument may be
                   4432: .Ql i
                   4433: to ignore case, for example
1.683     nicm     4434: .Ql s/a(.)/\e1x/i:\&
1.664     nicm     4435: would change
                   4436: .Ql abABab
                   4437: into
                   4438: .Ql bxBxbx .
1.431     nicm     4439: .Pp
1.671     nicm     4440: In addition, the last line of a shell command's output may be inserted using
1.431     nicm     4441: .Ql #() .
                   4442: For example,
                   4443: .Ql #(uptime)
                   4444: will insert the system's uptime.
                   4445: When constructing formats,
                   4446: .Nm
                   4447: does not wait for
                   4448: .Ql #()
                   4449: commands to finish; instead, the previous result from running the same command is used,
                   4450: or a placeholder if the command has not been run before.
1.543     nicm     4451: If the command hasn't exited, the most recent line of output will be used, but the status
                   4452: line will not be updated more than once a second.
1.431     nicm     4453: Commands are executed with the
                   4454: .Nm
                   4455: global environment set (see the
1.644     schwarze 4456: .Sx GLOBAL AND SESSION ENVIRONMENT
1.431     nicm     4457: section).
1.671     nicm     4458: .Pp
                   4459: An
                   4460: .Ql l
                   4461: specifies that a string should be interpreted literally and not expanded.
                   4462: For example
                   4463: .Ql #{l:#{?pane_in_mode,yes,no}}
                   4464: will be replaced by
                   4465: .Ql #{?pane_in_mode,yes,no} .
1.245     nicm     4466: .Pp
                   4467: The following variables are available, where appropriate:
1.359     nicm     4468: .Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX"
                   4469: .It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with"
1.678     nicm     4470: .It Li "alternate_on" Ta "" Ta "1 if pane is in alternate screen"
1.359     nicm     4471: .It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen"
                   4472: .It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen"
1.572     nicm     4473: .It Li "buffer_created" Ta "" Ta "Time buffer created"
1.490     nicm     4474: .It Li "buffer_name" Ta "" Ta "Name of buffer"
1.386     nicm     4475: .It Li "buffer_sample" Ta "" Ta "Sample of start of buffer"
1.359     nicm     4476: .It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes"
1.572     nicm     4477: .It Li "client_activity" Ta "" Ta "Time client last had activity"
1.699     nicm     4478: .It Li "client_cell_height" Ta "" Ta "Height of each client cell in pixels"
                   4479: .It Li "client_cell_width" Ta "" Ta "Width of each client cell in pixels"
1.646     nicm     4480: .It Li "client_control_mode" Ta "" Ta "1 if client is in control mode"
1.572     nicm     4481: .It Li "client_created" Ta "" Ta "Time client created"
1.542     nicm     4482: .It Li "client_discarded" Ta "" Ta "Bytes discarded when client behind"
1.359     nicm     4483: .It Li "client_height" Ta "" Ta "Height of client"
1.451     nicm     4484: .It Li "client_key_table" Ta "" Ta "Current key table"
1.359     nicm     4485: .It Li "client_last_session" Ta "" Ta "Name of the client's last session"
1.540     nicm     4486: .It Li "client_name" Ta "" Ta "Name of client"
1.437     nicm     4487: .It Li "client_pid" Ta "" Ta "PID of client process"
1.359     nicm     4488: .It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed"
                   4489: .It Li "client_readonly" Ta "" Ta "1 if client is readonly"
                   4490: .It Li "client_session" Ta "" Ta "Name of the client's session"
                   4491: .It Li "client_termname" Ta "" Ta "Terminal name of client"
1.754     nicm     4492: .It Li "client_termtype" Ta "" Ta "Terminal type of client, if available"
                   4493: .It Li "client_termfeatures" Ta "" Ta "Terminal features of client, if any"
1.359     nicm     4494: .It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
1.699     nicm     4495: .It Li "client_utf8" Ta "" Ta "1 if client supports UTF-8"
1.359     nicm     4496: .It Li "client_width" Ta "" Ta "Width of client"
1.541     nicm     4497: .It Li "client_written" Ta "" Ta "Bytes written to client"
1.509     nicm     4498: .It Li "command" Ta "" Ta "Name of command in use, if any"
1.646     nicm     4499: .It Li "command_list_alias" Ta "" Ta "Command alias if listing commands"
1.489     nicm     4500: .It Li "command_list_name" Ta "" Ta "Command name if listing commands"
                   4501: .It Li "command_list_usage" Ta "" Ta "Command usage if listing commands"
1.692     nicm     4502: .It Li "copy_cursor_line" Ta "" Ta "Line the cursor is on in copy mode"
                   4503: .It Li "copy_cursor_word" Ta "" Ta "Word under cursor in copy mode"
1.691     nicm     4504: .It Li "copy_cursor_x" Ta "" Ta "Cursor X position in copy mode"
                   4505: .It Li "copy_cursor_y" Ta "" Ta "Cursor Y position in copy mode"
1.646     nicm     4506: .It Li "cursor_character" Ta "" Ta "Character at cursor in pane"
1.359     nicm     4507: .It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
                   4508: .It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
                   4509: .It Li "cursor_y" Ta "" Ta "Cursor Y position in pane"
                   4510: .It Li "history_bytes" Ta "" Ta "Number of bytes in window history"
                   4511: .It Li "history_limit" Ta "" Ta "Maximum window history lines"
1.581     nicm     4512: .It Li "history_size" Ta "" Ta "Size of history in lines"
1.509     nicm     4513: .It Li "hook" Ta "" Ta "Name of running hook, if any"
1.511     nicm     4514: .It Li "hook_pane" Ta "" Ta "ID of pane where hook was run, if any"
1.510     nicm     4515: .It Li "hook_session" Ta "" Ta "ID of session where hook was run, if any"
                   4516: .It Li "hook_session_name" Ta "" Ta "Name of session where hook was run, if any"
                   4517: .It Li "hook_window" Ta "" Ta "ID of window where hook was run, if any"
                   4518: .It Li "hook_window_name" Ta "" Ta "Name of window where hook was run, if any"
1.359     nicm     4519: .It Li "host" Ta "#H" Ta "Hostname of local host"
                   4520: .It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)"
                   4521: .It Li "insert_flag" Ta "" Ta "Pane insert flag"
                   4522: .It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag"
                   4523: .It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
                   4524: .It Li "line" Ta "" Ta "Line number in the list"
1.646     nicm     4525: .It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag"
1.359     nicm     4526: .It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
                   4527: .It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag"
1.676     nicm     4528: .It Li "mouse_line" Ta "" Ta "Line under mouse, if any"
                   4529: .It Li "mouse_sgr_flag" Ta "" Ta "Pane mouse SGR flag"
1.359     nicm     4530: .It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag"
1.676     nicm     4531: .It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag"
                   4532: .It Li "mouse_word" Ta "" Ta "Word under mouse, if any"
1.654     nicm     4533: .It Li "mouse_x" Ta "" Ta "Mouse X position, if any"
                   4534: .It Li "mouse_y" Ta "" Ta "Mouse Y position, if any"
1.676     nicm     4535: .It Li "origin_flag" Ta "" Ta "Pane origin flag"
1.359     nicm     4536: .It Li "pane_active" Ta "" Ta "1 if active pane"
1.570     nicm     4537: .It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window"
                   4538: .It Li "pane_at_left" Ta "" Ta "1 if pane is at the left of window"
                   4539: .It Li "pane_at_right" Ta "" Ta "1 if pane is at the right of window"
                   4540: .It Li "pane_at_top" Ta "" Ta "1 if pane is at the top of window"
1.396     nicm     4541: .It Li "pane_bottom" Ta "" Ta "Bottom of pane"
1.359     nicm     4542: .It Li "pane_current_command" Ta "" Ta "Current command if available"
1.733     nicm     4543: .It Li "pane_current_path" Ta "" Ta "Current path if available"
1.359     nicm     4544: .It Li "pane_dead" Ta "" Ta "1 if pane is dead"
1.411     nicm     4545: .It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane"
1.696     nicm     4546: .It Li "pane_format" Ta "" Ta "1 if format is for a pane"
1.359     nicm     4547: .It Li "pane_height" Ta "" Ta "Height of pane"
                   4548: .It Li "pane_id" Ta "#D" Ta "Unique pane ID"
1.678     nicm     4549: .It Li "pane_in_mode" Ta "" Ta "1 if pane is in a mode"
1.646     nicm     4550: .It Li "pane_index" Ta "#P" Ta "Index of pane"
1.678     nicm     4551: .It Li "pane_input_off" Ta "" Ta "1 if input to pane is disabled"
1.396     nicm     4552: .It Li "pane_left" Ta "" Ta "Left of pane"
1.650     nicm     4553: .It Li "pane_marked" Ta "" Ta "1 if this is the marked pane"
                   4554: .It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set"
1.678     nicm     4555: .It Li "pane_mode" Ta "" Ta "Name of pane mode, if any"
1.761   ! nicm     4556: .It Li "pane_path" Ta "" Ta "Path of pane (can be set by application)"
1.359     nicm     4557: .It Li "pane_pid" Ta "" Ta "PID of first process in pane"
1.567     nicm     4558: .It Li "pane_pipe" Ta "" Ta "1 if pane is being piped"
1.396     nicm     4559: .It Li "pane_right" Ta "" Ta "Right of pane"
1.546     nicm     4560: .It Li "pane_search_string" Ta "" Ta "Last search string in copy mode"
1.743     nicm     4561: .It Li "pane_skipped" Ta "" Ta "Bytes skipped as not visible in pane"
1.359     nicm     4562: .It Li "pane_start_command" Ta "" Ta "Command pane started with"
1.678     nicm     4563: .It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized"
1.359     nicm     4564: .It Li "pane_tabs" Ta "" Ta "Pane tab positions"
1.696     nicm     4565: .It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
1.396     nicm     4566: .It Li "pane_top" Ta "" Ta "Top of pane"
1.359     nicm     4567: .It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
                   4568: .It Li "pane_width" Ta "" Ta "Width of pane"
1.743     nicm     4569: .It Li "pane_written" Ta "" Ta "Bytes written by pane (aside from redrawing)"
1.721     nicm     4570: .It Li "pid" Ta "" Ta "Server PID"
                   4571: .It Li "popup_key" Ta "" Ta "Key pressed in popup"
                   4572: .It Li "popup_mouse_x" Ta "" Ta "Mouse X position in popup"
                   4573: .It Li "popup_mouse_y" Ta "" Ta "Mouse Y position in popup"
1.606     nicm     4574: .It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated"
1.646     nicm     4575: .It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
1.359     nicm     4576: .It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
                   4577: .It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
1.713     nicm     4578: .It Li "selection_active" Ta "" Ta "1 if selection started and changes with the cursor in copy mode"
1.691     nicm     4579: .It Li "selection_end_x" Ta "" Ta "X position of the end of the selection"
                   4580: .It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection"
1.571     nicm     4581: .It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
1.691     nicm     4582: .It Li "selection_start_x" Ta "" Ta "X position of the start of the selection"
                   4583: .It Li "selection_start_y" Ta "" Ta "Y position of the start of the selection"
1.646     nicm     4584: .It Li "session_activity" Ta "" Ta "Time of session last activity"
1.430     nicm     4585: .It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
1.382     nicm     4586: .It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
1.702     nicm     4587: .It Li "session_attached_list" Ta "" Ta "List of clients session is attached to"
1.572     nicm     4588: .It Li "session_created" Ta "" Ta "Time session created"
1.696     nicm     4589: .It Li "session_format" Ta "" Ta "1 if format is for a session"
1.536     nicm     4590: .It Li "session_group" Ta "" Ta "Name of session group"
1.702     nicm     4591: .It Li "session_group_attached" Ta "" Ta "Number of clients sessions in group are attached to"
                   4592: .It Li "session_group_attached_list" Ta "" Ta "List of clients sessions in group are attached to"
1.646     nicm     4593: .It Li "session_group_list" Ta "" Ta "List of sessions in group"
1.702     nicm     4594: .It Li "session_group_many_attached" Ta "" Ta "1 if multiple clients attached to sessions in group"
1.586     nicm     4595: .It Li "session_group_size" Ta "" Ta "Size of session group"
1.359     nicm     4596: .It Li "session_grouped" Ta "" Ta "1 if session in a group"
                   4597: .It Li "session_id" Ta "" Ta "Unique session ID"
1.646     nicm     4598: .It Li "session_last_attached" Ta "" Ta "Time session last attached"
1.382     nicm     4599: .It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached"
1.748     nicm     4600: .It Li "session_marked" Ta "" Ta "1 if this session contains the marked pane"
1.359     nicm     4601: .It Li "session_name" Ta "#S" Ta "Name of session"
1.725     nicm     4602: .It Li "session_path" Ta "" Ta "Working directory of session"
1.548     nicm     4603: .It Li "session_stack" Ta "" Ta "Window indexes in most recent order"
1.359     nicm     4604: .It Li "session_windows" Ta "" Ta "Number of windows in session"
1.487     nicm     4605: .It Li "socket_path" Ta "" Ta "Server socket path"
1.465     nicm     4606: .It Li "start_time" Ta "" Ta "Server start time"
1.708     nicm     4607: .It Li "version" Ta "" Ta "Server version"
1.646     nicm     4608: .It Li "window_active" Ta "" Ta "1 if window active"
1.702     nicm     4609: .It Li "window_active_clients" Ta "" Ta "Number of clients viewing this window"
                   4610: .It Li "window_active_clients_list" Ta "" Ta "List of clients viewing this window"
                   4611: .It Li "window_active_sessions" Ta "" Ta "Number of sessions on which this window is active"
                   4612: .It Li "window_active_sessions_list" Ta "" Ta "List of sessions on which this window is active"
1.572     nicm     4613: .It Li "window_activity" Ta "" Ta "Time of window last activity"
1.487     nicm     4614: .It Li "window_activity_flag" Ta "" Ta "1 if window has activity"
1.366     nicm     4615: .It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
1.642     nicm     4616: .It Li "window_bigger" Ta "" Ta "1 if window is larger than client"
1.700     nicm     4617: .It Li "window_cell_height" Ta "" Ta "Height of each cell in pixels"
                   4618: .It Li "window_cell_width" Ta "" Ta "Width of each cell in pixels"
1.621     nicm     4619: .It Li "window_end_flag" Ta "" Ta "1 if window has the highest index"
1.359     nicm     4620: .It Li "window_flags" Ta "#F" Ta "Window flags"
1.696     nicm     4621: .It Li "window_format" Ta "" Ta "1 if format is for a window"
1.359     nicm     4622: .It Li "window_height" Ta "" Ta "Height of window"
                   4623: .It Li "window_id" Ta "" Ta "Unique window ID"
                   4624: .It Li "window_index" Ta "#I" Ta "Index of window"
1.400     nicm     4625: .It Li "window_last_flag" Ta "" Ta "1 if window is the last used"
1.460     nicm     4626: .It Li "window_layout" Ta "" Ta "Window layout description, ignoring zoomed window panes"
1.426     nicm     4627: .It Li "window_linked" Ta "" Ta "1 if window is linked across sessions"
1.702     nicm     4628: .It Li "window_linked_sessions" Ta "" Ta "Number of sessions this window is linked to"
                   4629: .It Li "window_linked_sessions_list" Ta "" Ta "List of sessions this window is linked to"
1.687     nicm     4630: .It Li "window_marked_flag" Ta "" Ta "1 if window contains the marked pane"
1.359     nicm     4631: .It Li "window_name" Ta "#W" Ta "Name of window"
1.642     nicm     4632: .It Li "window_offset_x" Ta "" Ta "X offset into window if larger than client"
                   4633: .It Li "window_offset_y" Ta "" Ta "Y offset into window if larger than client"
1.359     nicm     4634: .It Li "window_panes" Ta "" Ta "Number of panes in window"
1.366     nicm     4635: .It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert"
1.548     nicm     4636: .It Li "window_stack_index" Ta "" Ta "Index in session most recent stack"
1.621     nicm     4637: .It Li "window_start_flag" Ta "" Ta "1 if window has the lowest index"
1.460     nicm     4638: .It Li "window_visible_layout" Ta "" Ta "Window layout description, respecting zoomed window panes"
1.359     nicm     4639: .It Li "window_width" Ta "" Ta "Width of window"
1.400     nicm     4640: .It Li "window_zoomed_flag" Ta "" Ta "1 if window is zoomed"
1.359     nicm     4641: .It Li "wrap_flag" Ta "" Ta "Pane wrap flag"
1.245     nicm     4642: .El
1.623     nicm     4643: .Sh STYLES
                   4644: .Nm
                   4645: offers various options to specify the colour and attributes of aspects of the
                   4646: interface, for example
                   4647: .Ic status-style
                   4648: for the status line.
                   4649: In addition, embedded styles may be specified in format options, such as
1.701     nicm     4650: .Ic status-left ,
1.623     nicm     4651: by enclosing them in
                   4652: .Ql #[
                   4653: and
1.639     nicm     4654: .Ql \&] .
1.623     nicm     4655: .Pp
                   4656: A style may be the single term
                   4657: .Ql default
1.688     nicm     4658: to specify the default style (which may come from an option, for example
                   4659: .Ic status-style
                   4660: in the status line) or a space
1.630     nicm     4661: or comma separated list of the following:
1.623     nicm     4662: .Bl -tag -width Ds
                   4663: .It Ic fg=colour
                   4664: Set the foreground colour.
                   4665: The colour is one of:
                   4666: .Ic black ,
                   4667: .Ic red ,
                   4668: .Ic green ,
                   4669: .Ic yellow ,
                   4670: .Ic blue ,
                   4671: .Ic magenta ,
                   4672: .Ic cyan ,
                   4673: .Ic white ;
                   4674: if supported the bright variants
                   4675: .Ic brightred ,
                   4676: .Ic brightgreen ,
                   4677: .Ic brightyellow ;
                   4678: .Ic colour0
                   4679: to
                   4680: .Ic colour255
                   4681: from the 256-colour set;
                   4682: .Ic default
                   4683: for the default colour;
                   4684: .Ic terminal
                   4685: for the terminal default colour; or a hexadecimal RGB string such as
                   4686: .Ql #ffffff .
                   4687: .It Ic bg=colour
                   4688: Set the background colour.
                   4689: .It Ic none
                   4690: Set no attributes (turn off any active attributes).
1.752     nicm     4691: .It Xo Ic acs ,
                   4692: .Ic bright
1.625     nicm     4693: (or
                   4694: .Ic bold ) ,
1.623     nicm     4695: .Ic dim ,
                   4696: .Ic underscore ,
                   4697: .Ic blink ,
                   4698: .Ic reverse ,
                   4699: .Ic hidden ,
                   4700: .Ic italics ,
1.649     nicm     4701: .Ic overline ,
1.623     nicm     4702: .Ic strikethrough ,
                   4703: .Ic double-underscore ,
                   4704: .Ic curly-underscore ,
                   4705: .Ic dotted-underscore ,
                   4706: .Ic dashed-underscore
                   4707: .Xc
                   4708: Set an attribute.
                   4709: Any of the attributes may be prefixed with
                   4710: .Ql no
                   4711: to unset.
1.752     nicm     4712: .Ic acs
                   4713: is the terminal alternate character set.
1.625     nicm     4714: .It Xo Ic align=left
                   4715: (or
                   4716: .Ic noalign ) ,
                   4717: .Ic align=centre ,
                   4718: .Ic align=right
                   4719: .Xc
                   4720: Align text to the left, centre or right of the available space if appropriate.
1.675     nicm     4721: .It Ic fill=colour
1.674     nicm     4722: Fill the available space with a background colour if appropriate.
1.625     nicm     4723: .It Xo Ic list=on ,
                   4724: .Ic list=focus ,
                   4725: .Ic list=left-marker ,
1.661     nicm     4726: .Ic list=right-marker ,
1.625     nicm     4727: .Ic nolist
                   4728: .Xc
                   4729: Mark the position of the various window list components in the
                   4730: .Ic status-format
                   4731: option:
                   4732: .Ic list=on
                   4733: marks the start of the list;
                   4734: .Ic list=focus
                   4735: is the part of the list that should be kept in focus if the entire list won't fit
                   4736: in the available space (typically the current window);
                   4737: .Ic list=left-marker
                   4738: and
                   4739: .Ic list=right-marker
                   4740: mark the text to be used to mark that text has been trimmed from the left or
                   4741: right of the list if there is not enough space.
1.688     nicm     4742: .It Xo Ic push-default ,
                   4743: .Ic pop-default
                   4744: .Xc
                   4745: Store the current colours and attributes as the default or reset to the previous
                   4746: default.
                   4747: A
                   4748: .Ic push-default
                   4749: affects any subsequent use of the
                   4750: .Ic default
                   4751: term until a
                   4752: .Ic pop-default .
                   4753: Only one default may be pushed (each
                   4754: .Ic push-default
                   4755: replaces the previous saved default).
1.625     nicm     4756: .It Xo Ic range=left ,
                   4757: .Ic range=right ,
                   4758: .Ic range=window|X ,
                   4759: .Ic norange
                   4760: .Xc
                   4761: Mark a range in the
1.651     nicm     4762: .Ic status-format
1.625     nicm     4763: option.
                   4764: .Ic range=left
                   4765: and
                   4766: .Ic range=right
                   4767: are the text used for the
                   4768: .Ql StatusLeft
                   4769: and
                   4770: .Ql StatusRight
                   4771: mouse keys.
                   4772: .Ic range=window|X
                   4773: is the range for a window passed to the
                   4774: .Ql Status
                   4775: mouse key, where
                   4776: .Ql X
                   4777: is a window index.
1.623     nicm     4778: .El
                   4779: .Pp
                   4780: Examples are:
                   4781: .Bd -literal -offset indent
1.630     nicm     4782: fg=yellow bold underscore blink
1.623     nicm     4783: bg=black,fg=default,noreverse
                   4784: .Ed
1.261     nicm     4785: .Sh NAMES AND TITLES
                   4786: .Nm
                   4787: distinguishes between names and titles.
                   4788: Windows and sessions have names, which may be used to specify them in targets
                   4789: and are displayed in the status line and various lists: the name is the
                   4790: .Nm
                   4791: identifier for a window or session.
                   4792: Only panes have titles.
1.577     nicm     4793: A pane's title is typically set by the program running inside the pane using
                   4794: an escape sequence (like it would set the
1.261     nicm     4795: .Xr xterm 1
1.577     nicm     4796: window title in
1.578     nicm     4797: .Xr X 7 ) .
1.268     nicm     4798: Windows themselves do not have titles - a window's title is the title of its
1.261     nicm     4799: active pane.
                   4800: .Nm
                   4801: itself may set the title of the terminal in which the client is running, see
                   4802: the
                   4803: .Ic set-titles
                   4804: option.
                   4805: .Pp
                   4806: A session's name is set with the
                   4807: .Ic new-session
                   4808: and
                   4809: .Ic rename-session
                   4810: commands.
                   4811: A window's name is set with one of:
                   4812: .Bl -enum -width Ds
                   4813: .It
                   4814: A command argument (such as
                   4815: .Fl n
                   4816: for
                   4817: .Ic new-window
                   4818: or
                   4819: .Ic new-session ) .
                   4820: .It
1.597     nicm     4821: An escape sequence (if the
                   4822: .Ic allow-rename
                   4823: option is turned on):
1.261     nicm     4824: .Bd -literal -offset indent
                   4825: $ printf '\e033kWINDOW_NAME\e033\e\e'
                   4826: .Ed
                   4827: .It
                   4828: Automatic renaming, which sets the name to the active command in the window's
                   4829: active pane.
                   4830: See the
                   4831: .Ic automatic-rename
                   4832: option.
                   4833: .El
                   4834: .Pp
                   4835: When a pane is first created, its title is the hostname.
1.612     nicm     4836: A pane's title can be set via the title setting escape sequence, for example:
1.261     nicm     4837: .Bd -literal -offset indent
                   4838: $ printf '\e033]2;My Title\e033\e\e'
                   4839: .Ed
1.577     nicm     4840: .Pp
                   4841: It can also be modified with the
                   4842: .Ic select-pane
                   4843: .Fl T
                   4844: command.
1.644     schwarze 4845: .Sh GLOBAL AND SESSION ENVIRONMENT
1.63      nicm     4846: When the server is started,
                   4847: .Nm
                   4848: copies the environment into the
                   4849: .Em global environment ;
                   4850: in addition, each session has a
                   4851: .Em session environment .
1.193     nicm     4852: When a window is created, the session and global environments are merged.
                   4853: If a variable exists in both, the value from the session environment is used.
                   4854: The result is the initial environment passed to the new process.
1.63      nicm     4855: .Pp
                   4856: The
                   4857: .Ic update-environment
                   4858: session option may be used to update the session environment from the client
                   4859: when a new session is created or an old reattached.
                   4860: .Nm
                   4861: also initialises the
                   4862: .Ev TMUX
                   4863: variable with some internal information to allow commands to be executed
                   4864: from inside, and the
                   4865: .Ev TERM
                   4866: variable with the correct terminal setting of
                   4867: .Ql screen .
                   4868: .Pp
1.728     nicm     4869: Variables in both session and global environments may be marked as hidden.
                   4870: Hidden variables are not passed into the environment of new processes and
                   4871: instead can only be used by tmux itself (for example in formats, see the
                   4872: .Sx FORMATS
                   4873: section).
                   4874: .Pp
1.63      nicm     4875: Commands to alter and view the environment are:
                   4876: .Bl -tag -width Ds
                   4877: .It Xo Ic set-environment
1.728     nicm     4878: .Op Fl hgru
1.63      nicm     4879: .Op Fl t Ar target-session
                   4880: .Ar name Op Ar value
                   4881: .Xc
1.115     nicm     4882: .D1 (alias: Ic setenv )
1.63      nicm     4883: Set or unset an environment variable.
                   4884: If
                   4885: .Fl g
                   4886: is used, the change is made in the global environment; otherwise, it is applied
                   4887: to the session environment for
                   4888: .Ar target-session .
                   4889: The
                   4890: .Fl u
                   4891: flag unsets a variable.
                   4892: .Fl r
                   4893: indicates the variable is to be removed from the environment before starting a
                   4894: new process.
1.728     nicm     4895: .Fl h
                   4896: marks the variable as hidden.
1.63      nicm     4897: .It Xo Ic show-environment
1.728     nicm     4898: .Op Fl hgs
1.63      nicm     4899: .Op Fl t Ar target-session
1.286     nicm     4900: .Op Ar variable
1.63      nicm     4901: .Xc
1.115     nicm     4902: .D1 (alias: Ic showenv )
1.63      nicm     4903: Display the environment for
                   4904: .Ar target-session
                   4905: or the global environment with
                   4906: .Fl g .
1.286     nicm     4907: If
                   4908: .Ar variable
                   4909: is omitted, all variables are shown.
1.63      nicm     4910: Variables removed from the environment are prefixed with
                   4911: .Ql - .
1.442     nicm     4912: If
                   4913: .Fl s
                   4914: is used, the output is formatted as a set of Bourne shell commands.
1.728     nicm     4915: .Fl h
                   4916: shows hidden variables (omitted by default).
1.57      jmc      4917: .El
                   4918: .Sh STATUS LINE
                   4919: .Nm
                   4920: includes an optional status line which is displayed in the bottom line of each
                   4921: terminal.
1.626     nicm     4922: .Pp
                   4923: By default, the status line is enabled and one line in height (it may be
                   4924: disabled or made multiple lines with the
1.57      jmc      4925: .Ic status
                   4926: session option) and contains, from left-to-right: the name of the current
1.261     nicm     4927: session in square brackets; the window list; the title of the active pane
                   4928: in double quotes; and the time and date.
1.57      jmc      4929: .Pp
1.626     nicm     4930: Each line of the status line is configured with the
                   4931: .Ic status-format
                   4932: option.
                   4933: The default is made of three parts: configurable left and right sections (which
                   4934: may contain dynamic content such as the time or output from a shell command,
                   4935: see the
1.57      jmc      4936: .Ic status-left ,
                   4937: .Ic status-left-length ,
                   4938: .Ic status-right ,
                   4939: and
                   4940: .Ic status-right-length
                   4941: options below), and a central window list.
1.125     nicm     4942: By default, the window list shows the index, name and (if any) flag of the
                   4943: windows present in the current session in ascending numerical order.
                   4944: It may be customised with the
                   4945: .Ar window-status-format
                   4946: and
                   4947: .Ar window-status-current-format
                   4948: options.
1.57      jmc      4949: The flag is one of the following symbols appended to the window name:
                   4950: .Bl -column "Symbol" "Meaning" -offset indent
                   4951: .It Sy "Symbol" Ta Sy "Meaning"
                   4952: .It Li "*" Ta "Denotes the current window."
                   4953: .It Li "-" Ta "Marks the last window (previously selected)."
1.574     nicm     4954: .It Li "#" Ta "Window activity is monitored and activity has been detected."
                   4955: .It Li "\&!" Ta "Window bells are monitored and a bell has occurred in the window."
1.192     nicm     4956: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.432     nicm     4957: .It Li "M" Ta "The window contains the marked pane."
1.349     nicm     4958: .It Li "Z" Ta "The window's active pane is zoomed."
1.57      jmc      4959: .El
                   4960: .Pp
                   4961: The # symbol relates to the
                   4962: .Ic monitor-activity
1.388     nicm     4963: window option.
1.57      jmc      4964: The window name is printed in inverted colours if an alert (bell, activity or
1.388     nicm     4965: silence) is present.
1.57      jmc      4966: .Pp
1.131     nicm     4967: The colour and attributes of the status line may be configured, the entire
                   4968: status line using the
1.378     nicm     4969: .Ic status-style
                   4970: session option and individual windows using the
                   4971: .Ic window-status-style
                   4972: window option.
1.57      jmc      4973: .Pp
1.131     nicm     4974: The status line is automatically refreshed at interval if it has changed, the
                   4975: interval may be controlled with the
1.57      jmc      4976: .Ic status-interval
                   4977: session option.
                   4978: .Pp
                   4979: Commands related to the status line are as follows:
                   4980: .Bl -tag -width Ds
                   4981: .It Xo Ic command-prompt
1.758     nicm     4982: .Op Fl 1ikNTW
1.235     nicm     4983: .Op Fl I Ar inputs
1.73      nicm     4984: .Op Fl p Ar prompts
1.57      jmc      4985: .Op Fl t Ar target-client
                   4986: .Op Ar template
                   4987: .Xc
                   4988: Open the command prompt in a client.
                   4989: This may be used from inside
                   4990: .Nm
                   4991: to execute commands interactively.
1.231     nicm     4992: .Pp
1.57      jmc      4993: If
                   4994: .Ar template
1.73      nicm     4995: is specified, it is used as the command.
1.235     nicm     4996: If present,
                   4997: .Fl I
                   4998: is a comma-separated list of the initial text for each prompt.
1.73      nicm     4999: If
                   5000: .Fl p
                   5001: is given,
                   5002: .Ar prompts
                   5003: is a comma-separated list of prompts which are displayed in order; otherwise
                   5004: a single prompt is displayed, constructed from
                   5005: .Ar template
                   5006: if it is present, or
                   5007: .Ql \&:
                   5008: if not.
1.231     nicm     5009: .Pp
1.73      nicm     5010: Before the command is executed, the first occurrence of the string
                   5011: .Ql %%
1.74      jmc      5012: and all occurrences of
1.73      nicm     5013: .Ql %1
1.492     nicm     5014: are replaced by the response to the first prompt, all
1.73      nicm     5015: .Ql %2
                   5016: are replaced with the response to the second prompt, and so on for further
1.74      jmc      5017: prompts.
                   5018: Up to nine prompt responses may be replaced
                   5019: .Po
                   5020: .Ql %1
1.73      nicm     5021: to
1.74      jmc      5022: .Ql %9
                   5023: .Pc .
1.513     nicm     5024: .Ql %%%
                   5025: is like
                   5026: .Ql %%
                   5027: but any quotation marks are escaped.
1.497     nicm     5028: .Pp
                   5029: .Fl 1
                   5030: makes the prompt only accept one key press, in this case the resulting input
                   5031: is a single character.
1.706     nicm     5032: .Fl k
                   5033: is like
                   5034: .Fl 1
                   5035: but the key press is translated to a key name.
1.678     nicm     5036: .Fl N
                   5037: makes the prompt only accept numeric key presses.
1.517     nicm     5038: .Fl i
                   5039: executes the command every time the prompt input changes instead of when the
                   5040: user exits the command prompt.
1.758     nicm     5041: .Fl T
                   5042: tells
                   5043: .Nm
                   5044: that the prompt is for a target which affects what completions are offered when
                   5045: .Em Tab
                   5046: is pressed;
                   5047: .Fl W
                   5048: is similar but indicates the prompt is for a window.
1.500     nicm     5049: .Pp
                   5050: The following keys have a special meaning in the command prompt, depending
                   5051: on the value of the
                   5052: .Ic status-keys
                   5053: option:
                   5054: .Bl -column "FunctionXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXX" "emacsX" -offset indent
                   5055: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.715     nicm     5056: .It Li "Cancel command prompt" Ta "q" Ta "Escape"
1.678     nicm     5057: .It Li "Delete from cursor to start of word" Ta "" Ta "C-w"
1.500     nicm     5058: .It Li "Delete entire command" Ta "d" Ta "C-u"
                   5059: .It Li "Delete from cursor to end" Ta "D" Ta "C-k"
                   5060: .It Li "Execute command" Ta "Enter" Ta "Enter"
                   5061: .It Li "Get next command from history" Ta "" Ta "Down"
                   5062: .It Li "Get previous command from history" Ta "" Ta "Up"
                   5063: .It Li "Insert top paste buffer" Ta "p" Ta "C-y"
                   5064: .It Li "Look for completions" Ta "Tab" Ta "Tab"
                   5065: .It Li "Move cursor left" Ta "h" Ta "Left"
                   5066: .It Li "Move cursor right" Ta "l" Ta "Right"
                   5067: .It Li "Move cursor to end" Ta "$" Ta "C-e"
                   5068: .It Li "Move cursor to next word" Ta "w" Ta "M-f"
                   5069: .It Li "Move cursor to previous word" Ta "b" Ta "M-b"
                   5070: .It Li "Move cursor to start" Ta "0" Ta "C-a"
                   5071: .It Li "Transpose characters" Ta "" Ta "C-t"
                   5072: .El
1.57      jmc      5073: .It Xo Ic confirm-before
1.238     nicm     5074: .Op Fl p Ar prompt
1.57      jmc      5075: .Op Fl t Ar target-client
                   5076: .Ar command
                   5077: .Xc
                   5078: .D1 (alias: Ic confirm )
                   5079: Ask for confirmation before executing
                   5080: .Ar command .
1.238     nicm     5081: If
                   5082: .Fl p
                   5083: is given,
                   5084: .Ar prompt
                   5085: is the prompt to display; otherwise a prompt is constructed from
                   5086: .Ar command .
                   5087: It may contain the special character sequences supported by the
                   5088: .Ic status-left
                   5089: option.
                   5090: .Pp
1.57      jmc      5091: This command works only from inside
                   5092: .Nm .
1.646     nicm     5093: .It Xo Ic display-menu
                   5094: .Op Fl c Ar target-client
                   5095: .Op Fl t Ar target-pane
                   5096: .Op Fl T Ar title
                   5097: .Op Fl x Ar position
                   5098: .Op Fl y Ar position
1.657     nicm     5099: .Ar name
                   5100: .Ar key
                   5101: .Ar command
                   5102: .Ar ...
1.646     nicm     5103: .Xc
1.651     nicm     5104: .D1 (alias: Ic menu )
1.646     nicm     5105: Display a menu on
                   5106: .Ar target-client .
                   5107: .Ar target-pane
                   5108: gives the target for any commands run from the menu.
                   5109: .Pp
1.657     nicm     5110: A menu is passed as a series of arguments: first the menu item name,
                   5111: second the key shortcut (or empty for none) and third the command
                   5112: to run when the menu item is chosen.
                   5113: The name and command are formats, see the
1.646     nicm     5114: .Sx FORMATS
                   5115: and
                   5116: .Sx STYLES
                   5117: sections.
1.658     nicm     5118: If the name begins with a hyphen (-), then the item is disabled (shown dim) and
                   5119: may not be chosen.
1.657     nicm     5120: The name may be empty for a separator line, in which case both the key and
                   5121: command should be omitted.
1.646     nicm     5122: .Pp
                   5123: .Fl T
                   5124: is a format for the menu title (see
                   5125: .Sx FORMATS ) .
                   5126: .Pp
                   5127: .Fl x
                   5128: and
                   5129: .Fl y
                   5130: give the position of the menu.
                   5131: Both may be a row or column number, or one of the following special values:
                   5132: .Bl -column "XXXXX" "XXXX" -offset indent
                   5133: .It Sy "Value" Ta Sy "Flag" Ta Sy "Meaning"
1.719     nicm     5134: .It Li "C" Ta "Both" Ta "The centre of the terminal"
1.646     nicm     5135: .It Li "R" Ta Fl x Ta "The right side of the terminal"
                   5136: .It Li "P" Ta "Both" Ta "The bottom left of the pane"
                   5137: .It Li "M" Ta "Both" Ta "The mouse position"
1.730     nicm     5138: .It Li "W" Ta "Both" Ta "The window position on the status line"
1.646     nicm     5139: .It Li "S" Ta Fl y Ta "The line above or below the status line"
                   5140: .El
                   5141: .Pp
                   5142: Each menu consists of items followed by a key shortcut shown in brackets.
                   5143: If the menu is too large to fit on the terminal, it is not displayed.
                   5144: Pressing the key shortcut chooses the corresponding item.
                   5145: If the mouse is enabled and the menu is opened from a mouse key binding, releasing
                   5146: the mouse button with an item selected will choose that item.
                   5147: The following keys are also available:
                   5148: .Bl -column "Key" "Function" -offset indent
                   5149: .It Sy "Key" Ta Sy "Function"
                   5150: .It Li "Enter" Ta "Choose selected item"
                   5151: .It Li "Up" Ta "Select previous item"
                   5152: .It Li "Down" Ta "Select next item"
                   5153: .It Li "q" Ta "Exit menu"
                   5154: .El
1.57      jmc      5155: .It Xo Ic display-message
1.643     nicm     5156: .Op Fl aIpv
1.215     nicm     5157: .Op Fl c Ar target-client
                   5158: .Op Fl t Ar target-pane
1.57      jmc      5159: .Op Ar message
                   5160: .Xc
                   5161: .D1 (alias: Ic display )
1.127     nicm     5162: Display a message.
                   5163: If
                   5164: .Fl p
                   5165: is given, the output is printed to stdout, otherwise it is displayed in the
                   5166: .Ar target-client
                   5167: status line.
1.122     nicm     5168: The format of
1.124     jmc      5169: .Ar message
1.275     nicm     5170: is described in the
                   5171: .Sx FORMATS
                   5172: section; information is taken from
1.215     nicm     5173: .Ar target-pane
                   5174: if
                   5175: .Fl t
1.678     nicm     5176: is given, otherwise the active pane.
1.622     nicm     5177: .Pp
1.624     nicm     5178: .Fl v
                   5179: prints verbose logging as the format is parsed and
                   5180: .Fl a
                   5181: lists the format variables and their values.
1.643     nicm     5182: .Pp
                   5183: .Fl I
                   5184: forwards any input read from stdin to the empty pane given by
                   5185: .Ar target-pane .
1.721     nicm     5186: .It Xo Ic display-popup
                   5187: .Op Fl CEK
                   5188: .Op Fl c Ar target-client
                   5189: .Op Fl d Ar start-directory
                   5190: .Op Fl h Ar height
                   5191: .Op Fl R Ar shell-command
                   5192: .Op Fl t Ar target-pane
                   5193: .Op Fl w Ar width
                   5194: .Op Fl x Ar position
                   5195: .Op Fl y Ar position
                   5196: .Op Ar command Ar line Ar ...
                   5197: .Xc
                   5198: .D1 (alias: Ic popup )
                   5199: Display a popup on
                   5200: .Ar target-client .
                   5201: A popup is a rectangular box drawn over the top of any panes.
                   5202: Panes are not updated while a popup is present.
                   5203: The popup content may be given in two ways:
                   5204: .Bl -enum -offset Ds
                   5205: .It
                   5206: A set of lines as arguments.
                   5207: Each line is a format which is expanded using
                   5208: .Ar target-pane
                   5209: as the target.
                   5210: If a line contains newlines it is split into multiple lines.
                   5211: Lines may use styles, see the
                   5212: .Sx STYLES
                   5213: section.
                   5214: .It
                   5215: A shell command given by
                   5216: .Fl R
                   5217: which is run and any output shown in the pane.
                   5218: .El
                   5219: .Pp
                   5220: The first argument,
                   5221: .Ar command ,
                   5222: is a
                   5223: .Nm
                   5224: command which is run when a key is pressed.
                   5225: The key is available in the
                   5226: .Ql popup_key
                   5227: format.
                   5228: After
                   5229: .Ar command
                   5230: is run, the popup is closed.
                   5231: It may be empty to discard any key presses.
                   5232: If
                   5233: .Fl K
                   5234: is given together with
1.722     nicm     5235: .Fl R ,
1.721     nicm     5236: key presses are instead passed to the
                   5237: .Fl R
                   5238: shell command.
                   5239: .Fl E
                   5240: closes the popup automatically when
                   5241: .Ar shell-command
                   5242: exits.
1.723     nicm     5243: Two
                   5244: .Fl E
                   5245: closes the popup only if
                   5246: .Ar shell-command
                   5247: exited with success.
1.721     nicm     5248: With
                   5249: .Fl K ,
                   5250: .Ql Escape
                   5251: and
                   5252: .Ql C-c
                   5253: close the popup unless
                   5254: .Fl E
                   5255: is also given.
                   5256: .Pp
                   5257: .Fl x
                   5258: and
                   5259: .Fl y
                   5260: give the position of the popup, they have the same meaning as for the
                   5261: .Ic display-menu
                   5262: command.
                   5263: .Fl w
                   5264: and
                   5265: .Fl h
                   5266: give the width and height - both may be a percentage (followed by
                   5267: .Ql % ) .
                   5268: If omitted, without
                   5269: .Fl R
                   5270: they are calculated from the given lines and with
                   5271: .Fl R
                   5272: they use half the terminal size.
                   5273: .Pp
                   5274: The
                   5275: .Fl C
                   5276: flag closes any popup on the client.
1.57      jmc      5277: .El
                   5278: .Sh BUFFERS
                   5279: .Nm
1.392     nicm     5280: maintains a set of named
1.199     nicm     5281: .Em paste buffers .
1.392     nicm     5282: Each buffer may be either explicitly or automatically named.
                   5283: Explicitly named buffers are named when created with the
                   5284: .Ic set-buffer
                   5285: or
                   5286: .Ic load-buffer
                   5287: commands, or by renaming an automatically named buffer with
                   5288: .Ic set-buffer
                   5289: .Fl n .
                   5290: Automatically named buffers are given a name such as
                   5291: .Ql buffer0001 ,
                   5292: .Ql buffer0002
                   5293: and so on.
                   5294: When the
                   5295: .Ic buffer-limit
                   5296: option is reached, the oldest automatically named buffer is deleted.
1.493     nicm     5297: Explicitly named buffers are not subject to
1.57      jmc      5298: .Ic buffer-limit
1.709     nicm     5299: and may be deleted with the
1.392     nicm     5300: .Ic delete-buffer
                   5301: command.
                   5302: .Pp
1.57      jmc      5303: Buffers may be added using
                   5304: .Ic copy-mode
                   5305: or the
                   5306: .Ic set-buffer
1.392     nicm     5307: and
                   5308: .Ic load-buffer
                   5309: commands, and pasted into a window using the
1.57      jmc      5310: .Ic paste-buffer
                   5311: command.
1.392     nicm     5312: If a buffer command is used and no buffer is specified, the most
                   5313: recently added automatically named buffer is assumed.
1.57      jmc      5314: .Pp
                   5315: A configurable history buffer is also maintained for each window.
                   5316: By default, up to 2000 lines are kept; this can be altered with the
                   5317: .Ic history-limit
                   5318: option (see the
                   5319: .Ic set-option
                   5320: command above).
                   5321: .Pp
                   5322: The buffer commands are as follows:
                   5323: .Bl -tag -width Ds
1.178     nicm     5324: .It Xo
                   5325: .Ic choose-buffer
1.682     nicm     5326: .Op Fl NZr
1.572     nicm     5327: .Op Fl F Ar format
1.562     nicm     5328: .Op Fl f Ar filter
1.561     nicm     5329: .Op Fl O Ar sort-order
1.555     nicm     5330: .Op Fl t Ar target-pane
1.178     nicm     5331: .Op Ar template
                   5332: .Xc
1.555     nicm     5333: Put a pane into buffer mode, where a buffer may be chosen interactively from
                   5334: a list.
1.593     nicm     5335: .Fl Z
                   5336: zooms the pane.
1.555     nicm     5337: The following keys may be used in buffer mode:
                   5338: .Bl -column "Key" "Function" -offset indent
                   5339: .It Sy "Key" Ta Sy "Function"
1.582     nicm     5340: .It Li "Enter" Ta "Paste selected buffer"
1.555     nicm     5341: .It Li "Up" Ta "Select previous buffer"
                   5342: .It Li "Down" Ta "Select next buffer"
1.559     nicm     5343: .It Li "C-s" Ta "Search by name or content"
                   5344: .It Li "n" Ta "Repeat last search"
1.555     nicm     5345: .It Li "t" Ta "Toggle if buffer is tagged"
                   5346: .It Li "T" Ta "Tag no buffers"
                   5347: .It Li "C-t" Ta "Tag all buffers"
1.582     nicm     5348: .It Li "p" Ta "Paste selected buffer"
                   5349: .It Li "P" Ta "Paste tagged buffers"
1.555     nicm     5350: .It Li "d" Ta "Delete selected buffer"
                   5351: .It Li "D" Ta "Delete tagged buffers"
1.759     nicm     5352: .It Li "e" Ta "Open the buffer in an editor"
1.562     nicm     5353: .It Li "f" Ta "Enter a format to filter items"
1.682     nicm     5354: .It Li "O" Ta "Change sort field"
                   5355: .It Li "r" Ta "Reverse sort order"
1.576     nicm     5356: .It Li "v" Ta "Toggle preview"
1.555     nicm     5357: .It Li "q" Ta "Exit mode"
                   5358: .El
                   5359: .Pp
                   5360: After a buffer is chosen,
1.178     nicm     5361: .Ql %%
1.392     nicm     5362: is replaced by the buffer name in
1.178     nicm     5363: .Ar template
                   5364: and the result executed as a command.
                   5365: If
                   5366: .Ar template
                   5367: is not given, "paste-buffer -b '%%'" is used.
1.555     nicm     5368: .Pp
1.561     nicm     5369: .Fl O
1.682     nicm     5370: specifies the initial sort field: one of
1.561     nicm     5371: .Ql time ,
                   5372: .Ql name
                   5373: or
                   5374: .Ql size .
1.682     nicm     5375: .Fl r
                   5376: reverses the sort order.
1.562     nicm     5377: .Fl f
1.579     nicm     5378: specifies an initial filter: the filter is a format - if it evaluates to zero,
                   5379: the item in the list is not shown, otherwise it is shown.
                   5380: If a filter would lead to an empty list, it is ignored.
1.572     nicm     5381: .Fl F
                   5382: specifies the format for each item in the list.
1.576     nicm     5383: .Fl N
                   5384: starts without the preview.
1.314     nicm     5385: This command works only if at least one client is attached.
1.57      jmc      5386: .It Ic clear-history Op Fl t Ar target-pane
                   5387: .D1 (alias: Ic clearhist )
                   5388: Remove and free the history for the specified pane.
1.392     nicm     5389: .It Ic delete-buffer Op Fl b Ar buffer-name
1.57      jmc      5390: .D1 (alias: Ic deleteb )
1.392     nicm     5391: Delete the buffer named
                   5392: .Ar buffer-name ,
                   5393: or the most recently added automatically named buffer if not specified.
1.294     nicm     5394: .It Xo Ic list-buffers
                   5395: .Op Fl F Ar format
1.738     nicm     5396: .Op Fl f Ar filter
1.294     nicm     5397: .Xc
1.57      jmc      5398: .D1 (alias: Ic lsb )
1.198     nicm     5399: List the global buffers.
1.294     nicm     5400: .Fl F
1.738     nicm     5401: specifies the format of each line and
                   5402: .Fl f
                   5403: a filter.
                   5404: Only buffers for which the filter is true are shown.
                   5405: See the
1.294     nicm     5406: .Sx FORMATS
                   5407: section.
1.200     jmc      5408: .It Xo Ic load-buffer
1.392     nicm     5409: .Op Fl b Ar buffer-name
1.57      jmc      5410: .Ar path
                   5411: .Xc
                   5412: .D1 (alias: Ic loadb )
                   5413: Load the contents of the specified paste buffer from
                   5414: .Ar path .
                   5415: .It Xo Ic paste-buffer
1.278     nicm     5416: .Op Fl dpr
1.392     nicm     5417: .Op Fl b Ar buffer-name
1.170     nicm     5418: .Op Fl s Ar separator
1.158     nicm     5419: .Op Fl t Ar target-pane
1.57      jmc      5420: .Xc
                   5421: .D1 (alias: Ic pasteb )
1.158     nicm     5422: Insert the contents of a paste buffer into the specified pane.
                   5423: If not specified, paste into the current one.
1.57      jmc      5424: With
                   5425: .Fl d ,
1.392     nicm     5426: also delete the paste buffer.
1.57      jmc      5427: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170     nicm     5428: a separator, by default carriage return (CR).
                   5429: A custom separator may be specified using the
                   5430: .Fl s
                   5431: flag.
                   5432: The
1.57      jmc      5433: .Fl r
1.170     nicm     5434: flag means to do no replacement (equivalent to a separator of LF).
1.278     nicm     5435: If
                   5436: .Fl p
                   5437: is specified, paste bracket control codes are inserted around the
                   5438: buffer if the application has requested bracketed paste mode.
1.57      jmc      5439: .It Xo Ic save-buffer
                   5440: .Op Fl a
1.392     nicm     5441: .Op Fl b Ar buffer-name
1.57      jmc      5442: .Ar path
                   5443: .Xc
                   5444: .D1 (alias: Ic saveb )
                   5445: Save the contents of the specified paste buffer to
                   5446: .Ar path .
                   5447: The
                   5448: .Fl a
                   5449: option appends to rather than overwriting the file.
                   5450: .It Xo Ic set-buffer
1.383     nicm     5451: .Op Fl a
1.392     nicm     5452: .Op Fl b Ar buffer-name
                   5453: .Op Fl n Ar new-buffer-name
1.57      jmc      5454: .Ar data
                   5455: .Xc
                   5456: .D1 (alias: Ic setb )
                   5457: Set the contents of the specified buffer to
                   5458: .Ar data .
1.383     nicm     5459: The
                   5460: .Fl a
                   5461: option appends to rather than overwriting the buffer.
1.392     nicm     5462: The
                   5463: .Fl n
                   5464: option renames the buffer to
                   5465: .Ar new-buffer-name .
1.1       nicm     5466: .It Xo Ic show-buffer
1.392     nicm     5467: .Op Fl b Ar buffer-name
1.1       nicm     5468: .Xc
                   5469: .D1 (alias: Ic showb )
                   5470: Display the contents of the specified buffer.
1.57      jmc      5471: .El
                   5472: .Sh MISCELLANEOUS
                   5473: Miscellaneous commands are as follows:
                   5474: .Bl -tag -width Ds
1.72      nicm     5475: .It Ic clock-mode Op Fl t Ar target-pane
1.57      jmc      5476: Display a large clock.
1.334     nicm     5477: .It Xo Ic if-shell
1.410     nicm     5478: .Op Fl bF
1.334     nicm     5479: .Op Fl t Ar target-pane
                   5480: .Ar shell-command command
                   5481: .Op Ar command
                   5482: .Xc
1.57      jmc      5483: .D1 (alias: Ic if )
1.251     nicm     5484: Execute the first
1.57      jmc      5485: .Ar command
                   5486: if
                   5487: .Ar shell-command
1.251     nicm     5488: returns success or the second
                   5489: .Ar command
                   5490: otherwise.
1.410     nicm     5491: Before being executed,
                   5492: .Ar shell-command
                   5493: is expanded using the rules specified in the
1.334     nicm     5494: .Sx FORMATS
                   5495: section, including those relevant to
                   5496: .Ar target-pane .
1.335     nicm     5497: With
                   5498: .Fl b ,
                   5499: .Ar shell-command
                   5500: is run in the background.
1.410     nicm     5501: .Pp
                   5502: If
                   5503: .Fl F
                   5504: is given,
                   5505: .Ar shell-command
                   5506: is not executed but considered success if neither empty nor zero (after formats
                   5507: are expanded).
1.57      jmc      5508: .It Ic lock-server
                   5509: .D1 (alias: Ic lock )
1.90      nicm     5510: Lock each client individually by running the command specified by the
                   5511: .Ic lock-command
                   5512: option.
1.308     nicm     5513: .It Xo Ic run-shell
1.357     nicm     5514: .Op Fl b
1.717     nicm     5515: .Op Fl d Ar delay
1.308     nicm     5516: .Op Fl t Ar target-pane
1.718     nicm     5517: .Op Ar shell-command
1.308     nicm     5518: .Xc
1.87      nicm     5519: .D1 (alias: Ic run )
                   5520: Execute
1.153     nicm     5521: .Ar shell-command
1.106     nicm     5522: in the background without creating a window.
1.334     nicm     5523: Before being executed, shell-command is expanded using the rules specified in
                   5524: the
                   5525: .Sx FORMATS
                   5526: section.
1.335     nicm     5527: With
                   5528: .Fl b ,
                   5529: the command is run in the background.
1.717     nicm     5530: .Fl d
                   5531: waits for
                   5532: .Ar delay
                   5533: seconds before starting the command.
                   5534: After the command finishes, any output to stdout is displayed in view mode (in
                   5535: the pane specified by
1.308     nicm     5536: .Fl t
                   5537: or the current pane if omitted).
1.153     nicm     5538: If the command doesn't return success, the exit status is also displayed.
1.342     nicm     5539: .It Xo Ic wait-for
1.370     nicm     5540: .Op Fl L | S | U
1.342     nicm     5541: .Ar channel
                   5542: .Xc
                   5543: .D1 (alias: Ic wait )
1.343     nicm     5544: When used without options, prevents the client from exiting until woken using
1.342     nicm     5545: .Ic wait-for
                   5546: .Fl S
                   5547: with the same channel.
1.343     nicm     5548: When
                   5549: .Fl L
                   5550: is used, the channel is locked and any clients that try to lock the same
                   5551: channel are made to wait until the channel is unlocked with
                   5552: .Ic wait-for
                   5553: .Fl U .
1.703     nicm     5554: .El
                   5555: .Sh EXIT MESSAGES
                   5556: When a
                   5557: .Nm
                   5558: client detaches, it prints a message.
                   5559: This may be one of:
                   5560: .Bl -tag -width Ds
                   5561: .It [detached (from session ...)]
                   5562: The client was detached normally.
                   5563: .It [detached and SIGHUP]
                   5564: The client was detached and its parent sent the
                   5565: .Dv SIGHUP
                   5566: signal (for example with
                   5567: .Ic detach-client
                   5568: .Fl P ) .
                   5569: .It [lost tty]
                   5570: The client's
                   5571: .Xr tty 4
                   5572: or
                   5573: .Xr pty 4
                   5574: was unexpectedly destroyed.
                   5575: .It [terminated]
                   5576: The client was killed with
                   5577: .Dv SIGTERM .
                   5578: .It [exited]
                   5579: The server exited when it had no sessions.
                   5580: .It [server exited]
                   5581: The server exited when it received
                   5582: .Dv SIGTERM .
                   5583: .It [server exited unexpectedly]
                   5584: The server crashed or otherwise exited without telling the client the reason.
1.228     nicm     5585: .El
                   5586: .Sh TERMINFO EXTENSIONS
                   5587: .Nm
1.478     nicm     5588: understands some unofficial extensions to
1.746     nicm     5589: .Xr terminfo 5 .
1.744     nicm     5590: It is not normally necessary to set these manually, instead the
                   5591: .Ic terminal-features
                   5592: option should be used.
1.228     nicm     5593: .Bl -tag -width Ds
1.756     nicm     5594: .It Em \&AX
                   5595: An existing extension that tells
                   5596: .Nm
                   5597: the terminal supports default colours.
1.739     nicm     5598: .It Em \&Cs , Cr
1.233     nicm     5599: Set the cursor colour.
1.232     jmc      5600: The first takes a single string argument and is used to set the colour;
                   5601: the second takes no arguments and restores the default cursor colour.
                   5602: If set, a sequence such as this may be used
                   5603: to change the cursor colour from inside
                   5604: .Nm :
                   5605: .Bd -literal -offset indent
                   5606: $ printf '\e033]12;red\e033\e\e'
                   5607: .Ed
1.753     nicm     5608: .It Em \&Cmg, \&Clmg, \&Dsmg , \&Enmg
                   5609: Set, clear, disable or enable DECSLRM margins.
1.756     nicm     5610: These are set automatically if the terminal reports it is
                   5611: .Em VT420
                   5612: compatible.
1.755     nicm     5613: .It Em \&Dsbp , \&Enbp
                   5614: Disable and enable bracketed paste.
1.756     nicm     5615: These are set automatically if the
                   5616: .Em XT
                   5617: capability is present.
                   5618: .It Em \&Dsfcs , \&Enfcs
                   5619: Disable and enable focus reporting.
                   5620: These are set automatically if the
                   5621: .Em XT
                   5622: capability is present.
1.649     nicm     5623: .It Em \&Smol
                   5624: Enable the overline attribute.
1.611     nicm     5625: .It Em \&Smulx
1.672     nicm     5626: Set a styled underscore.
                   5627: The single parameter is one of: 0 for no underscore, 1 for normal
                   5628: underscore, 2 for double underscore, 3 for curly underscore, 4 for dotted
                   5629: underscore and 5 for dashed underscore.
                   5630: .It Em \&Setulc
                   5631: Set the underscore colour.
                   5632: The argument is (red * 65536) + (green * 256) + blue where each is between 0
                   5633: and 255.
1.361     jmc      5634: .It Em \&Ss , Se
1.403     nicm     5635: Set or reset the cursor style.
1.232     jmc      5636: If set, a sequence such as this may be used
                   5637: to change the cursor to an underline:
1.230     nicm     5638: .Bd -literal -offset indent
                   5639: $ printf '\e033[4 q'
                   5640: .Ed
                   5641: .Pp
                   5642: If
1.403     nicm     5643: .Em Se
                   5644: is not set, \&Ss with argument 0 will be used to reset the cursor style instead.
1.741     nicm     5645: .It Em \&Sync
1.745     nicm     5646: Start (parameter is 1) or end (parameter is 2) a synchronized update.
1.478     nicm     5647: .It Em \&Tc
                   5648: Indicate that the terminal supports the
                   5649: .Ql direct colour
                   5650: RGB escape sequence (for example, \ee[38;2;255;255;255m).
1.518     nicm     5651: .Pp
1.612     nicm     5652: If supported, this is used for the initialize colour escape sequence (which
1.518     nicm     5653: may be enabled by adding the
                   5654: .Ql initc
                   5655: and
                   5656: .Ql ccc
                   5657: capabilities to the
                   5658: .Nm
                   5659: .Xr terminfo 5
                   5660: entry).
1.739     nicm     5661: .Pp
                   5662: This is equivalent to the
                   5663: .Em RGB
                   5664: .Xr terminfo 5
                   5665: capability.
1.232     jmc      5666: .It Em \&Ms
1.478     nicm     5667: Store the current buffer in the host terminal's selection (clipboard).
1.232     jmc      5668: See the
                   5669: .Em set-clipboard
                   5670: option above and the
                   5671: .Xr xterm 1
                   5672: man page.
1.756     nicm     5673: .It Em \&XT
                   5674: This is an existing extension capability that tmux uses to mean that the
                   5675: terminal supports the
                   5676: .Xr xterm 1
                   5677: title set sequences and to automatically set some of the capabilities above.
1.345     nicm     5678: .El
                   5679: .Sh CONTROL MODE
                   5680: .Nm
                   5681: offers a textual interface called
                   5682: .Em control mode .
                   5683: This allows applications to communicate with
                   5684: .Nm
                   5685: using a simple text-only protocol.
                   5686: .Pp
                   5687: In control mode, a client sends
                   5688: .Nm
                   5689: commands or command sequences terminated by newlines on standard input.
                   5690: Each command will produce one block of output on standard output.
                   5691: An output block consists of a
                   5692: .Em %begin
                   5693: line followed by the output (which may be empty).
                   5694: The output block ends with a
                   5695: .Em %end
                   5696: or
                   5697: .Em %error .
                   5698: .Em %begin
                   5699: and matching
                   5700: .Em %end
                   5701: or
                   5702: .Em %error
                   5703: have two arguments: an integer time (as seconds from epoch) and command number.
                   5704: For example:
                   5705: .Bd -literal -offset indent
                   5706: %begin 1363006971 2
                   5707: 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
                   5708: %end 1363006971 2
                   5709: .Ed
1.535     nicm     5710: .Pp
                   5711: The
                   5712: .Ic refresh-client
                   5713: .Fl C
                   5714: command may be used to set the size of a client in control mode.
1.345     nicm     5715: .Pp
                   5716: In control mode,
                   5717: .Nm
                   5718: outputs notifications.
                   5719: A notification will never occur inside an output block.
                   5720: .Pp
                   5721: The following notifications are defined:
                   5722: .Bl -tag -width Ds
1.750     jmc      5723: .It Ic %client-session-changed Ar client session-id name
1.547     nicm     5724: The client is now attached to the session with ID
                   5725: .Ar session-id ,
                   5726: which is named
                   5727: .Ar name .
1.345     nicm     5728: .It Ic %exit Op Ar reason
                   5729: The
                   5730: .Nm
                   5731: client is exiting immediately, either because it is not attached to any session
                   5732: or an error occurred.
                   5733: If present,
                   5734: .Ar reason
                   5735: describes why the client exited.
1.460     nicm     5736: .It Ic %layout-change Ar window-id Ar window-layout Ar window-visible-layout Ar window-flags
1.345     nicm     5737: The layout of a window with ID
                   5738: .Ar window-id
                   5739: changed.
                   5740: The new layout is
                   5741: .Ar window-layout .
1.460     nicm     5742: The window's visible layout is
                   5743: .Ar window-visible-layout
                   5744: and the window flags are
                   5745: .Ar window-flags .
1.347     nicm     5746: .It Ic %output Ar pane-id Ar value
                   5747: A window pane produced output.
1.345     nicm     5748: .Ar value
1.350     nicm     5749: escapes non-printable characters and backslash as octal \\xxx.
1.547     nicm     5750: .It Ic %pane-mode-changed Ar pane-id
                   5751: The pane with ID
                   5752: .Ar pane-id
                   5753: has changed mode.
1.345     nicm     5754: .It Ic %session-changed Ar session-id Ar name
                   5755: The client is now attached to the session with ID
                   5756: .Ar session-id ,
                   5757: which is named
                   5758: .Ar name .
                   5759: .It Ic %session-renamed Ar name
                   5760: The current session was renamed to
                   5761: .Ar name .
1.547     nicm     5762: .It Ic %session-window-changed Ar session-id Ar window-id
                   5763: The session with ID
                   5764: .Ar session-id
                   5765: changed its active window to the window with ID
                   5766: .Ar window-id .
1.345     nicm     5767: .It Ic %sessions-changed
                   5768: A session was created or destroyed.
                   5769: .It Ic %unlinked-window-add Ar window-id
                   5770: The window with ID
                   5771: .Ar window-id
                   5772: was created but is not linked to the current session.
                   5773: .It Ic %window-add Ar window-id
                   5774: The window with ID
                   5775: .Ar window-id
                   5776: was linked to the current session.
                   5777: .It Ic %window-close Ar window-id
                   5778: The window with ID
                   5779: .Ar window-id
                   5780: closed.
1.547     nicm     5781: .It Ic %window-pane-changed Ar window-id Ar pane-id
                   5782: The active pane in the window with ID
                   5783: .Ar window-id
                   5784: changed to the pane with ID
                   5785: .Ar pane-id .
1.345     nicm     5786: .It Ic %window-renamed Ar window-id Ar name
                   5787: The window with ID
                   5788: .Ar window-id
                   5789: was renamed to
                   5790: .Ar name .
1.644     schwarze 5791: .El
                   5792: .Sh ENVIRONMENT
                   5793: When
                   5794: .Nm
                   5795: is started, it inspects the following environment variables:
                   5796: .Bl -tag -width LC_CTYPE
                   5797: .It Ev EDITOR
                   5798: If the command specified in this variable contains the string
                   5799: .Ql vi
                   5800: and
                   5801: .Ev VISUAL
                   5802: is unset, use vi-style key bindings.
                   5803: Overridden by the
                   5804: .Ic mode-keys
                   5805: and
                   5806: .Ic status-keys
                   5807: options.
                   5808: .It Ev HOME
                   5809: The user's login directory.
                   5810: If unset, the
                   5811: .Xr passwd 5
                   5812: database is consulted.
                   5813: .It Ev LC_CTYPE
                   5814: The character encoding
                   5815: .Xr locale 1 .
                   5816: It is used for two separate purposes.
                   5817: For output to the terminal, UTF-8 is used if the
                   5818: .Fl u
                   5819: option is given or if
                   5820: .Ev LC_CTYPE
                   5821: contains
                   5822: .Qq UTF-8
                   5823: or
                   5824: .Qq UTF8 .
                   5825: Otherwise, only ASCII characters are written and non-ASCII characters
                   5826: are replaced with underscores
                   5827: .Pq Ql _ .
                   5828: For input,
                   5829: .Nm
                   5830: always runs with a UTF-8 locale.
                   5831: If en_US.UTF-8 is provided by the operating system it is used and
                   5832: .Ev LC_CTYPE
                   5833: is ignored for input.
                   5834: Otherwise,
                   5835: .Ev LC_CTYPE
                   5836: tells
                   5837: .Nm
                   5838: what the UTF-8 locale is called on the current system.
                   5839: If the locale specified by
                   5840: .Ev LC_CTYPE
                   5841: is not available or is not a UTF-8 locale,
                   5842: .Nm
                   5843: exits with an error message.
                   5844: .It Ev LC_TIME
                   5845: The date and time format
                   5846: .Xr locale 1 .
                   5847: It is used for locale-dependent
                   5848: .Xr strftime 3
                   5849: format specifiers.
                   5850: .It Ev PWD
                   5851: The current working directory to be set in the global environment.
                   5852: This may be useful if it contains symbolic links.
                   5853: If the value of the variable does not match the current working
                   5854: directory, the variable is ignored and the result of
                   5855: .Xr getcwd 3
                   5856: is used instead.
                   5857: .It Ev SHELL
                   5858: The absolute path to the default shell for new windows.
                   5859: See the
                   5860: .Ic default-shell
                   5861: option for details.
                   5862: .It Ev TMUX_TMPDIR
                   5863: The parent directory of the directory containing the server sockets.
                   5864: See the
                   5865: .Fl L
                   5866: option for details.
                   5867: .It Ev VISUAL
                   5868: If the command specified in this variable contains the string
                   5869: .Ql vi ,
                   5870: use vi-style key bindings.
                   5871: Overridden by the
                   5872: .Ic mode-keys
                   5873: and
                   5874: .Ic status-keys
                   5875: options.
1.1       nicm     5876: .El
                   5877: .Sh FILES
1.26      nicm     5878: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1       nicm     5879: .It Pa ~/.tmux.conf
1.6       jmc      5880: Default
1.1       nicm     5881: .Nm
1.6       jmc      5882: configuration file.
1.26      nicm     5883: .It Pa /etc/tmux.conf
                   5884: System-wide configuration file.
1.1       nicm     5885: .El
1.57      jmc      5886: .Sh EXAMPLES
                   5887: To create a new
                   5888: .Nm
                   5889: session running
                   5890: .Xr vi 1 :
                   5891: .Pp
                   5892: .Dl $ tmux new-session vi
                   5893: .Pp
                   5894: Most commands have a shorter form, known as an alias.
                   5895: For new-session, this is
                   5896: .Ic new :
                   5897: .Pp
                   5898: .Dl $ tmux new vi
                   5899: .Pp
                   5900: Alternatively, the shortest unambiguous form of a command is accepted.
                   5901: If there are several options, they are listed:
                   5902: .Bd -literal -offset indent
                   5903: $ tmux n
                   5904: ambiguous command: n, could be: new-session, new-window, next-window
                   5905: .Ed
                   5906: .Pp
                   5907: Within an active session, a new window may be created by typing
                   5908: .Ql C-b c
                   5909: (Ctrl
                   5910: followed by the
                   5911: .Ql b
                   5912: key
                   5913: followed by the
                   5914: .Ql c
                   5915: key).
                   5916: .Pp
                   5917: Windows may be navigated with:
                   5918: .Ql C-b 0
                   5919: (to select window 0),
                   5920: .Ql C-b 1
                   5921: (to select window 1), and so on;
                   5922: .Ql C-b n
                   5923: to select the next window; and
                   5924: .Ql C-b p
                   5925: to select the previous window.
                   5926: .Pp
                   5927: A session may be detached using
                   5928: .Ql C-b d
1.64      nicm     5929: (or by an external event such as
                   5930: .Xr ssh 1
                   5931: disconnection) and reattached with:
1.57      jmc      5932: .Pp
                   5933: .Dl $ tmux attach-session
                   5934: .Pp
                   5935: Typing
                   5936: .Ql C-b \&?
                   5937: lists the current key bindings in the current window; up and down may be used
                   5938: to navigate the list or
                   5939: .Ql q
                   5940: to exit from it.
                   5941: .Pp
                   5942: Commands to be run when the
                   5943: .Nm
                   5944: server is started may be placed in the
                   5945: .Pa ~/.tmux.conf
                   5946: configuration file.
                   5947: Common examples include:
                   5948: .Pp
                   5949: Changing the default prefix key:
                   5950: .Bd -literal -offset indent
                   5951: set-option -g prefix C-a
                   5952: unbind-key C-b
                   5953: bind-key C-a send-prefix
                   5954: .Ed
                   5955: .Pp
                   5956: Turning the status line off, or changing its colour:
                   5957: .Bd -literal -offset indent
                   5958: set-option -g status off
1.378     nicm     5959: set-option -g status-style bg=blue
1.57      jmc      5960: .Ed
                   5961: .Pp
                   5962: Setting other options, such as the default command,
                   5963: or locking after 30 minutes of inactivity:
                   5964: .Bd -literal -offset indent
                   5965: set-option -g default-command "exec /bin/ksh"
                   5966: set-option -g lock-after-time 1800
                   5967: .Ed
                   5968: .Pp
                   5969: Creating new key bindings:
                   5970: .Bd -literal -offset indent
                   5971: bind-key b set-option status
                   5972: bind-key / command-prompt "split-window 'exec man %%'"
1.73      nicm     5973: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57      jmc      5974: .Ed
1.1       nicm     5975: .Sh SEE ALSO
                   5976: .Xr pty 4
                   5977: .Sh AUTHORS
1.477     nicm     5978: .An Nicholas Marriott Aq Mt nicholas.marriott@gmail.com