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

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