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

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