[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.763

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