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

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