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

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