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

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