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

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