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

1.114   ! nicm        1: .\" $OpenBSD: tmux.1,v 1.113 2009/10/25 01:10:57 nicm Exp $
1.1       nicm        2: .\"
                      3: .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
                      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.114   ! nicm       17: .Dd $Mdocdate: October 25 2009 $
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.114   ! nicm       26: .Op Fl 28lquv
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.
                    101: .It Fl 8
                    102: Like
                    103: .Fl 2 ,
1.6       jmc       104: but indicates that the terminal supports 88 colours.
1.91      nicm      105: .It Fl c Ar shell-command
                    106: Execute
                    107: .Ar shell-command
                    108: using the default shell.
                    109: If necessary, the
                    110: .Nm
                    111: server will be started to retrieve the
                    112: .Ic default-shell
                    113: option.
1.1       nicm      114: .It Fl f Ar file
                    115: Specify an alternative configuration file.
                    116: By default,
                    117: .Nm
1.26      nicm      118: loads the system configuration file from
                    119: .Pa /etc/tmux.conf ,
                    120: if present, then looks for a user configuration file at
1.1       nicm      121: .Pa ~/.tmux.conf .
                    122: The configuration file is a set of
                    123: .Nm
                    124: commands which are executed in sequence when the server is first started.
1.61      nicm      125: .Pp
                    126: If a command in the configuration file fails,
                    127: .Nm
                    128: will report an error and exit without executing further commands.
1.82      nicm      129: .It Fl l
                    130: Behave as a login shell.
                    131: This flag currently has no effect and is for compatibility with other shells
                    132: when using tmux as a login shell.
1.1       nicm      133: .It Fl L Ar socket-name
                    134: .Nm
                    135: stores the server socket in a directory under
                    136: .Pa /tmp ;
                    137: the default socket is named
                    138: .Em default .
                    139: This option allows a different socket name to be specified, allowing several
                    140: independent
                    141: .Nm
                    142: servers to be run.
                    143: Unlike
                    144: .Fl S
                    145: a full path is not necessary: the sockets are all created in the same
                    146: directory.
1.2       nicm      147: .Pp
                    148: If the socket is accidentally removed, the
1.6       jmc       149: .Dv SIGUSR1
1.2       nicm      150: signal may be sent to the
                    151: .Nm
                    152: server process to recreate it.
1.4       sobrado   153: .It Fl q
1.6       jmc       154: Prevent the server sending various informational messages, for example when
1.4       sobrado   155: window flags are altered.
1.1       nicm      156: .It Fl S Ar socket-path
                    157: Specify a full alternative path to the server socket.
                    158: If
                    159: .Fl S
                    160: is specified, the default socket directory is not used and any
                    161: .Fl L
                    162: flag is ignored.
                    163: .It Fl u
                    164: .Nm
1.14      nicm      165: attempts to guess if the terminal is likely to support UTF-8 by checking the
                    166: first of the
                    167: .Ev LC_ALL ,
                    168: .Ev LC_CTYPE
                    169: and
1.2       nicm      170: .Ev LANG
1.14      nicm      171: environment variables to be set for the string "UTF-8".
1.5       nicm      172: This is not always correct: the
1.2       nicm      173: .Fl u
                    174: flag explicitly informs
                    175: .Nm
1.6       jmc       176: that UTF-8 is supported.
1.33      nicm      177: .Pp
                    178: If the server is started from a client passed
                    179: .Fl u
                    180: or where UTF-8 is detected, the
                    181: .Ic utf8
                    182: and
                    183: .Ic status-utf8
                    184: options are enabled in the global window and session options respectively.
1.1       nicm      185: .It Fl v
                    186: Request verbose logging.
                    187: This option may be specified multiple times for increasing verbosity.
                    188: Log messages will be saved into
                    189: .Pa tmux-client-PID.log
                    190: and
                    191: .Pa tmux-server-PID.log
                    192: files in the current directory, where
                    193: .Em PID
1.6       jmc       194: is the PID of the server or client process.
1.1       nicm      195: .It Ar command Op Ar flags
                    196: This specifies one of a set of commands used to control
                    197: .Nm ,
1.6       jmc       198: as described in the following sections.
1.59      jmc       199: If no commands are specified, the
1.1       nicm      200: .Ic new-session
                    201: command is assumed.
1.57      jmc       202: .El
1.64      nicm      203: .Sh KEY BINDINGS
                    204: .Nm
                    205: may be controlled from an attached client by using a key combination of a
                    206: prefix key,
                    207: .Ql C-b
                    208: (Ctrl-b) by default, followed by a command key.
                    209: .Pp
                    210: Some of the default key bindings are:
                    211: .Pp
1.67      jmc       212: .Bl -tag -width Ds -offset indent -compact
1.64      nicm      213: .It c
1.65      nicm      214: Create a new window.
1.64      nicm      215: .It d
1.65      nicm      216: Detach the current client.
1.64      nicm      217: .It l
1.65      nicm      218: Move to the previously selected window.
1.64      nicm      219: .It n
1.65      nicm      220: Change to the next window.
1.64      nicm      221: .It p
1.65      nicm      222: Change to the previous window.
                    223: .It &
                    224: Kill the current window.
                    225: .It ,
                    226: Rename the current window.
1.64      nicm      227: .It \&?
1.65      nicm      228: List all key bindings.
1.64      nicm      229: .El
                    230: .Pp
                    231: A complete list may be obtained with the
                    232: .Ic list-keys
                    233: command (bound to
                    234: .Ql \&?
                    235: by default).
                    236: Key bindings may be changed with the
                    237: .Ic bind-key
                    238: and
                    239: .Ic unbind-key
                    240: commands.
1.57      jmc       241: .Sh COMMANDS
                    242: This section contains a list of the commands supported by
                    243: .Nm .
                    244: Most commands accept the optional
                    245: .Fl t
                    246: argument with one of
                    247: .Ar target-client ,
                    248: .Ar target-session
                    249: .Ar target-window ,
                    250: or
                    251: .Ar target-pane .
                    252: These specify the client, session, window or pane which a command should affect.
                    253: .Ar target-client
                    254: is the name of the
                    255: .Xr pty 4
                    256: file to which the client is connected, for example either of
                    257: .Pa /dev/ttyp1
                    258: or
                    259: .Pa ttyp1
                    260: for the client attached to
                    261: .Pa /dev/ttyp1 .
                    262: If no client is specified, the current client is chosen, if possible, or an
                    263: error is reported.
                    264: Clients may be listed with the
                    265: .Ic list-clients
                    266: command.
1.1       nicm      267: .Pp
1.57      jmc       268: .Ar target-session
                    269: is either the name of a session (as listed by the
                    270: .Ic list-sessions
                    271: command) or the name of a client with the same syntax as
                    272: .Ar target-client ,
                    273: in which case the session attached to the client is used.
                    274: When looking for the session name,
                    275: .Nm
                    276: initially searches for an exact match; if none is found, the session names
                    277: are checked for any for which
                    278: .Ar target-session
                    279: is a prefix or for which it matches as an
                    280: .Xr fnmatch 3
                    281: pattern.
                    282: If a single match is found, it is used as the target session; multiple matches
                    283: produce an error.
                    284: If a session is omitted, the current session is used if available; if no
                    285: current session is available, the most recently created is chosen.
1.1       nicm      286: .Pp
1.57      jmc       287: .Ar target-window
                    288: specifies a window in the form
                    289: .Em session Ns \&: Ns Em window .
                    290: .Em session
                    291: follows the same rules as for
                    292: .Ar target-session ,
                    293: and
                    294: .Em window
                    295: is looked for in order: as a window index, for example mysession:1; as an exact
                    296: window name, such as mysession:mywindow; then as an
                    297: .Xr fnmatch 3
                    298: pattern or the start of a window name, such as mysession:mywin* or
                    299: mysession:mywin.
                    300: An empty window name specifies the next unused index if appropriate (for
                    301: example the
                    302: .Ic new-window
                    303: and
                    304: .Ic link-window
                    305: commands)
                    306: otherwise the current window in
                    307: .Em session
                    308: is chosen.
                    309: When the argument does not contain a colon,
                    310: .Nm
                    311: first attempts to parse it as window; if that fails, an attempt is made to
                    312: match a session.
1.1       nicm      313: .Pp
1.57      jmc       314: .Ar target-pane
                    315: takes a similar form to
                    316: .Ar target-window
                    317: but with the optional addition of a period followed by a pane index, for
                    318: example: mysession:mywindow.1.
                    319: If the pane index is omitted, the currently active pane in the specified
                    320: window is used.
                    321: If neither a colon nor period appears,
1.13      nicm      322: .Nm
1.57      jmc       323: first attempts to use the argument as a pane index; if that fails, it is looked
                    324: up as for
                    325: .Ar target-window .
1.15      jmc       326: .Pp
1.57      jmc       327: Multiple commands may be specified together as part of a
                    328: .Em command sequence .
                    329: Each command should be separated by spaces and a semicolon;
                    330: commands are executed sequentially from left to right.
                    331: A literal semicolon may be included by escaping it with a backslash (for
                    332: example, when specifying a command sequence to
                    333: .Ic bind-key ) .
1.13      nicm      334: .Pp
1.57      jmc       335: Examples include:
1.13      nicm      336: .Bd -literal -offset indent
1.57      jmc       337: refresh-client -t/dev/ttyp2
                    338:
                    339: rename-session -tfirst newname
                    340:
                    341: set-window-option -t:0 monitor-activity on
                    342:
                    343: new-window ; split-window -d
1.13      nicm      344: .Ed
1.57      jmc       345: .Sh CLIENTS AND SESSIONS
                    346: The following commands are available:
                    347: .Bl -tag -width Ds
                    348: .It Xo Ic attach-session
                    349: .Op Fl d
                    350: .Op Fl t Ar target-session
                    351: .Xc
                    352: .D1 (alias: Ic attach )
                    353: If run from outside
                    354: .Nm ,
                    355: create a new client in the current terminal and attach it to
                    356: .Ar target-session .
                    357: If used from inside, switch the current client.
                    358: If
                    359: .Fl d
                    360: is specified, any other clients attached to the session are detached.
1.13      nicm      361: .Pp
1.57      jmc       362: If no server is started,
                    363: .Ic attach-session
                    364: will attempt to start it; this will fail unless sessions are created in the
                    365: configuration file.
                    366: .It Ic detach-client Op Fl t Ar target-client
                    367: .D1 (alias: Ic detach )
                    368: Detach the current client if bound to a key, or the specified client with
                    369: .Fl t .
                    370: .It Ic has-session Op Fl t Ar target-session
                    371: .D1 (alias: Ic has )
                    372: Report an error and exit with 1 if the specified session does not exist.
                    373: If it does exist, exit with 0.
                    374: .It Ic kill-server
                    375: Kill the
1.1       nicm      376: .Nm
1.57      jmc       377: server and clients and destroy all sessions.
                    378: .It Ic kill-session Op Fl t Ar target-session
                    379: Destroy the given session, closing any windows linked to it and no other
                    380: sessions, and detaching all clients attached to it.
                    381: .It Ic list-clients
                    382: .D1 (alias: Ic lsc )
                    383: List all clients attached to the server.
                    384: .It Ic list-commands
                    385: .D1 (alias: Ic lscm )
                    386: List the syntax of all commands supported by
                    387: .Nm .
                    388: .It Ic list-sessions
                    389: .D1 (alias: Ic ls )
                    390: List all sessions managed by the server.
1.92      nicm      391: .It Xo Ic lock-client
                    392: .Op Fl t Ar target-client
                    393: .Xc
                    394: Lock
                    395: .Ar target-client ,
                    396: see the
                    397: .Ic lock-server
                    398: command.
                    399: .It Xo Ic lock-session
                    400: .Op Fl t Ar target-session
                    401: .Xc
                    402: Lock all clients attached to
                    403: .Ar target-session .
1.57      jmc       404: .It Xo Ic new-session
                    405: .Op Fl d
                    406: .Op Fl n Ar window-name
                    407: .Op Fl s Ar session-name
1.101     nicm      408: .Op Fl t Ar target-session
1.57      jmc       409: .Op Ar command
                    410: .Xc
                    411: .D1 (alias: Ic new )
                    412: Create a new session with name
                    413: .Ar session-name .
                    414: The new session is attached to the current terminal unless
                    415: .Fl d
                    416: is given.
                    417: .Ar window-name
1.1       nicm      418: and
1.57      jmc       419: .Ar command
                    420: are the name of and command to execute in the initial window.
1.68      nicm      421: .Pp
                    422: If run from a terminal, any
                    423: .Xr termios 4
                    424: special characters are saved and used for new windows in the new session.
1.101     nicm      425: .Pp
                    426: If
                    427: .Fl t
                    428: is given, the new session is
                    429: .Em grouped
                    430: with
                    431: .Ar target-session .
                    432: This means they share the same set of windows - all windows from
                    433: .Ar target-session
                    434: are linked to the new session and any subsequent new windows or windows being
                    435: closed are applied to both sessions.
                    436: The current and previous window and any session options remain independent and
                    437: either session may be killed without affecting the other.
                    438: Giving
                    439: .Fl n
                    440: or
                    441: .Ar command
                    442: are invalid if
                    443: .Fl t
                    444: is used.
1.57      jmc       445: .It Ic refresh-client Op Fl t Ar target-client
                    446: .D1 (alias: Ic refresh )
                    447: Refresh the current client if bound to a key, or a single client if one is given
                    448: with
                    449: .Fl t .
                    450: .It Xo Ic rename-session
                    451: .Op Fl t Ar target-session
                    452: .Ar new-name
                    453: .Xc
                    454: .D1 (alias: Ic rename )
                    455: Rename the session to
                    456: .Ar new-name .
                    457: .It Ic source-file Ar path
                    458: .D1 (alias: Ic source )
                    459: Execute commands from
                    460: .Ar path .
                    461: .It Ic start-server
                    462: .D1 (alias: Ic start )
                    463: Start the
1.1       nicm      464: .Nm
1.57      jmc       465: server, if not already running, without creating any sessions.
                    466: .It Xo Ic suspend-client
                    467: .Op Fl c Ar target-client
                    468: .Xc
                    469: .D1 (alias: Ic suspendc )
                    470: Suspend a client by sending
                    471: .Dv SIGTSTP
                    472: (tty stop).
                    473: .It Xo Ic switch-client
                    474: .Op Fl c Ar target-client
                    475: .Op Fl t Ar target-session
                    476: .Xc
                    477: .D1 (alias: Ic switchc )
                    478: Switch the current session for client
                    479: .Ar target-client
                    480: to
                    481: .Ar target-session .
                    482: .El
                    483: .Sh WINDOWS AND PANES
1.1       nicm      484: A
                    485: .Nm
                    486: window may be in one of several modes.
                    487: The default permits direct access to the terminal attached to the window.
                    488: The others are:
                    489: .Bl -tag -width Ds
                    490: .It Em output mode
                    491: This is entered when a command which produces output, such as
                    492: .Ic list-keys ,
                    493: is executed from a key binding.
                    494: .It Em copy mode
                    495: This permits a section of a window or its history to be copied to a
                    496: .Em paste buffer
                    497: for later insertion into another window.
                    498: This mode is entered with the
                    499: .Ic copy-mode
                    500: command, bound to
1.113     nicm      501: .Ql \&[
1.1       nicm      502: by default.
                    503: .El
                    504: .Pp
1.6       jmc       505: The keys available depend on whether emacs or vi mode is selected
                    506: (see the
1.1       nicm      507: .Ic mode-keys
                    508: option).
                    509: The following keys are supported as appropriate for the mode:
1.98      nicm      510: .Bl -column "FunctionXXXXXXXXXXXX" "viXXXXXXXXX" "emacs" -offset indent
1.1       nicm      511: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27      nicm      512: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.1       nicm      513: .It Li "Clear selection" Ta "Escape" Ta "C-g"
                    514: .It Li "Copy selection" Ta "Enter" Ta "M-w"
                    515: .It Li "Cursor down" Ta "j" Ta "Down"
1.70      nicm      516: .It Li "Cursor left" Ta "h" Ta "Left"
                    517: .It Li "Cursor right" Ta "l" Ta "Right"
                    518: .It Li "Cursor up" Ta "k" Ta "Up"
1.71      nicm      519: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.70      nicm      520: .It Li "Delete to end of line" Ta "D" Ta "C-k"
1.1       nicm      521: .It Li "End of line" Ta "$" Ta "C-e"
1.94      nicm      522: .It Li "Goto line" Ta ":" Ta "g"
1.1       nicm      523: .It Li "Next page" Ta "C-f" Ta "Page down"
                    524: .It Li "Next word" Ta "w" Ta "M-f"
1.70      nicm      525: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.1       nicm      526: .It Li "Previous page" Ta "C-u" Ta "Page up"
                    527: .It Li "Previous word" Ta "b" Ta "M-b"
                    528: .It Li "Quit mode" Ta "q" Ta "Escape"
1.98      nicm      529: .It Li "Scroll down" Ta "C-Down or J" Ta "C-Down"
                    530: .It Li "Scroll up" Ta "C-Up or K" Ta "C-Up"
1.70      nicm      531: .It Li "Search again" Ta "n" Ta "n"
                    532: .It Li "Search backward" Ta "?" Ta "C-r"
                    533: .It Li "Search forward" Ta "/" Ta "C-s"
                    534: .It Li "Start of line" Ta "0" Ta "C-a"
1.1       nicm      535: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.80      nicm      536: .It Li "Transpose chars" Ta "" Ta "C-t"
1.110     nicm      537: .It Li "Cursor to top line" Ta "H" Ta "M-R"
                    538: .It Li "Cursor to middle line" Ta "M" Ta "M-r"
                    539: .It Li "Cursor to bottom line" Ta "L" Ta ""
1.1       nicm      540: .El
                    541: .Pp
1.48      nicm      542: These key bindings are defined in a set of named tables:
                    543: .Em vi-edit
                    544: and
                    545: .Em emacs-edit
                    546: for keys used when line editing at the command prompt;
                    547: .Em vi-choice
                    548: and
                    549: .Em emacs-choice
                    550: for keys used when choosing from lists (such as produced by the
                    551: .Ic window-choose
                    552: command) or in output mode; and
                    553: .Em vi-copy
                    554: and
                    555: .Em emacs-copy
1.97      nicm      556: used in copy mode.
1.48      nicm      557: The tables may be viewed with the
                    558: .Ic list-keys
1.49      nicm      559: command and keys modified or removed with
                    560: .Ic bind-key
                    561: and
                    562: .Ic unbind-key .
1.48      nicm      563: .Pp
1.2       nicm      564: The paste buffer key pastes the first line from the top paste buffer on the
                    565: stack.
1.57      jmc       566: .Pp
                    567: The mode commands are as follows:
                    568: .Bl -tag -width Ds
                    569: .It Xo Ic copy-mode
                    570: .Op Fl u
1.72      nicm      571: .Op Fl t Ar target-pane
1.57      jmc       572: .Xc
                    573: Enter copy mode.
                    574: The
                    575: .Fl u
                    576: option scrolls one page up.
                    577: .El
1.18      nicm      578: .Pp
1.1       nicm      579: Each window displayed by
                    580: .Nm
                    581: may be split into one or more
                    582: .Em panes ;
                    583: each pane takes up a certain area of the display and is a separate terminal.
                    584: A window may be split into panes using the
                    585: .Ic split-window
                    586: command.
1.38      nicm      587: Windows may be split horizontally (with the
                    588: .Fl h
                    589: flag) or vertically.
                    590: Panes may be resized with the
                    591: .Ic resize-pane
1.1       nicm      592: command (bound to
1.38      nicm      593: .Ql C-up ,
                    594: .Ql C-down
                    595: .Ql C-left
                    596: and
                    597: .Ql C-right
1.1       nicm      598: by default), the current pane may be changed with the
                    599: .Ic up-pane
                    600: and
                    601: .Ic down-pane
                    602: commands and the
                    603: .Ic rotate-window
                    604: and
                    605: .Ic swap-pane
1.38      nicm      606: commands may be used to swap panes without changing their position.
                    607: Panes are numbered beginning from zero in the order they are created.
                    608: .Pp
                    609: A number of preset
                    610: .Em layouts
                    611: are available.
                    612: These may be selected with the
                    613: .Ic select-layout
                    614: command or cycled with
                    615: .Ic next-layout
                    616: (bound to
                    617: .Ql C-space
                    618: by default); once a layout is chosen, panes within it may be moved and resized as normal.
1.1       nicm      619: .Pp
                    620: The following layouts are supported:
                    621: .Bl -tag -width Ds
                    622: .It Ic even-horizontal
                    623: Panes are spread out evenly from left to right across the window.
                    624: .It Ic even-vertical
                    625: Panes are spread evenly from top to bottom.
1.2       nicm      626: .It Ic main-horizontal
                    627: A large (main) pane is shown at the top of the window and the remaining panes are
1.6       jmc       628: spread from left to right in the leftover space at the bottom.
1.2       nicm      629: Use the
                    630: .Em main-pane-height
                    631: window option to specify the height of the top pane.
1.1       nicm      632: .It Ic main-vertical
1.2       nicm      633: Similar to
                    634: .Ic main-horizontal
                    635: but the large pane is placed on the left and the others spread from top to
                    636: bottom along the right.
                    637: See the
                    638: .Em main-pane-width
                    639: window option.
1.1       nicm      640: .El
1.8       nicm      641: .Pp
1.57      jmc       642: Commands related to windows and panes are as follows:
                    643: .Bl -tag -width Ds
                    644: .It Xo Ic break-pane
                    645: .Op Fl d
                    646: .Op Fl t Ar target-pane
                    647: .Xc
                    648: .D1 (alias: Ic breakp )
                    649: Break
                    650: .Ar target-pane
                    651: off from its containing window to make it the only pane in a new window.
                    652: If
                    653: .Fl d
                    654: is given, the new window does not become the current window.
1.76      nicm      655: .It Xo
                    656: .Ic choose-client
                    657: .Op Fl t Ar target-window
                    658: .Op Ar template
                    659: .Xc
                    660: Put a window into client choice mode, allowing a client to be selected
                    661: interactively from a list.
                    662: After a client is chosen,
                    663: .Ql %%
                    664: is replaced by the client
                    665: .Xr pty 4
                    666: path in
                    667: .Ar template
                    668: and the result executed as a command.
                    669: If
                    670: .Ar template
                    671: is not given, "detach-client -t '%%'" is used.
1.57      jmc       672: This command works only from inside
                    673: .Nm .
1.76      nicm      674: .It Xo
                    675: .Ic choose-session
                    676: .Op Fl t Ar target-window
                    677: .Op Ar template
                    678: .Xc
                    679: Put a window into session choice mode, where a session may be selected
                    680: interactively from a list.
                    681: When one is chosen,
                    682: .Ql %%
                    683: is replaced by the session name in
                    684: .Ar template
                    685: and the result executed as a command.
                    686: If
                    687: .Ar template
                    688: is not given, "switch-client -t '%%'" is used.
                    689: This command works only from inside
                    690: .Nm .
                    691: .It Xo
                    692: .Ic choose-window
                    693: .Op Fl t Ar target-window
                    694: .Op Ar template
                    695: .Xc
                    696: Put a window into window choice mode, where a window may be chosen
                    697: interactively from a list.
                    698: After a window is selected,
                    699: .Ql %%
                    700: is replaced by the session name and window index in
                    701: .Ar template
                    702: and the result executed as a command.
                    703: If
                    704: .Ar template
                    705: is not given, "select-window -t '%%'" is used.
1.57      jmc       706: This command works only from inside
                    707: .Nm .
1.78      nicm      708: .It Ic display-panes Op Fl t Ar target-client
                    709: .D1 (alias: Ic displayp)
                    710: Display a visible indicator of each pane shown by
                    711: .Ar target-client .
                    712: See the
                    713: .Ic display-panes-time
                    714: and
                    715: .Ic display-panes-colour
                    716: session options.
1.84      nicm      717: While the indicator is on screen, a pane may be selected with the
                    718: .Ql 0
                    719: to
                    720: .Ql 9
                    721: keys.
1.57      jmc       722: .It Ic down-pane Op Fl t Ar target-pane
                    723: .D1 (alias: Ic downp )
1.111     nicm      724: Change the active pane to the next pane (higher index).
1.57      jmc       725: .It Xo Ic find-window
                    726: .Op Fl t Ar target-window
                    727: .Ar match-string
                    728: .Xc
                    729: .D1 (alias: Ic findw )
                    730: Search for the
                    731: .Xr fnmatch 3
                    732: pattern
                    733: .Ar match-string
                    734: in window names, titles, and visible content (but not history).
                    735: If only one window is matched, it'll be automatically selected, otherwise a
                    736: choice list is shown.
                    737: This command only works from inside
1.1       nicm      738: .Nm .
1.112     nicm      739: .It Xo Ic kill-pane
                    740: .Op Fl a
                    741: .Op Fl t Ar target-pane
                    742: .Xc
1.57      jmc       743: .D1 (alias: Ic killp )
                    744: Destroy the given pane.
                    745: If no panes remain in the containing window, it is also destroyed.
1.112     nicm      746: The
                    747: .Fl a
                    748: option kills all but the pane given with
                    749: .Fl t .
1.57      jmc       750: .It Ic kill-window Op Fl t Ar target-window
                    751: .D1 (alias: Ic killw )
                    752: Kill the current window or the window at
                    753: .Ar target-window ,
1.1       nicm      754: removing it from any sessions to which it is linked.
1.56      jmc       755: .It Ic last-window Op Fl t Ar target-session
1.1       nicm      756: .D1 (alias: Ic last )
                    757: Select the last (previously selected) window.
                    758: If no
                    759: .Ar target-session
                    760: is specified, select the last window of the current session.
                    761: .It Xo Ic link-window
                    762: .Op Fl dk
                    763: .Op Fl s Ar src-window
                    764: .Op Fl t Ar dst-window
                    765: .Xc
                    766: .D1 (alias: Ic linkw )
                    767: Link the window at
                    768: .Ar src-window
                    769: to the specified
                    770: .Ar dst-window .
                    771: If
                    772: .Ar dst-window
                    773: is specified and no such window exists, the
                    774: .Ar src-window
                    775: is linked there.
                    776: If
                    777: .Fl k
                    778: is given and
                    779: .Ar dst-window
                    780: exists, it is killed, otherwise an error is generated.
                    781: If
                    782: .Fl d
                    783: is given, the newly linked window is not selected.
1.104     nicm      784: .It Ic list-panes Op Fl t Ar target-window
                    785: .D1 (alias: Ic lsp )
                    786: List the panes in the current window or in
                    787: .Ar target-window .
1.56      jmc       788: .It Ic list-windows Op Fl t Ar target-session
1.1       nicm      789: .D1 (alias: Ic lsw )
                    790: List windows in the current session or in
                    791: .Ar target-session .
                    792: .It Xo Ic move-window
                    793: .Op Fl d
                    794: .Op Fl s Ar src-window
                    795: .Op Fl t Ar dst-window
                    796: .Xc
                    797: .D1 (alias: Ic movew )
                    798: This is similar to
                    799: .Ic link-window ,
                    800: except the window at
                    801: .Ar src-window
                    802: is moved to
                    803: .Ar dst-window .
                    804: .It Xo Ic new-window
1.28      nicm      805: .Op Fl dk
1.1       nicm      806: .Op Fl n Ar window-name
                    807: .Op Fl t Ar target-window
                    808: .Op Ar command
                    809: .Xc
                    810: .D1 (alias: Ic neww )
                    811: Create a new window.
                    812: If
                    813: .Fl d
                    814: is given, the session does not make the new window the current window.
                    815: .Ar target-window
1.28      nicm      816: represents the window to be created; if the target already exists an error is
                    817: shown, unless the
                    818: .Fl k
                    819: flag is used, in which case it is destroyed.
1.1       nicm      820: .Ar command
                    821: is the command to execute.
                    822: If
                    823: .Ar command
                    824: is not specified, the default command is used.
                    825: .Pp
                    826: The
                    827: .Ev TERM
                    828: environment variable must be set to
                    829: .Dq screen
                    830: for all programs running
                    831: .Em inside
                    832: .Nm .
                    833: New windows will automatically have
                    834: .Dq TERM=screen
                    835: added to their environment, but care must be taken not to reset this in shell
                    836: start-up files.
1.56      jmc       837: .It Ic next-layout Op Fl t Ar target-window
1.1       nicm      838: .D1 (alias: Ic nextl )
                    839: Move a window to the next layout and rearrange the panes to fit.
                    840: .It Xo Ic next-window
1.9       nicm      841: .Op Fl a
1.1       nicm      842: .Op Fl t Ar target-session
                    843: .Xc
                    844: .D1 (alias: Ic next )
                    845: Move to the next window in the session.
1.9       nicm      846: If
1.12      jmc       847: .Fl a
1.9       nicm      848: is used, move to the next window with a bell, activity or content alert.
1.107     nicm      849: .It Xo Ic pipe-pane
                    850: .Op Fl o
                    851: .Op Fl t Ar target-pane
                    852: .Op Ar command
                    853: .Xc
                    854: .D1 (alias: Ic pipep )
                    855: Pipe any output sent by the program in
                    856: .Ar target-pane
                    857: to a shell command.
                    858: A pane may only be piped to one command at a time, any existing pipe is
                    859: closed before
                    860: .Ar command
                    861: is executed.
                    862: If no
                    863: .Ar command
                    864: is given, the current pipe (if any) is closed.
                    865: .Pp
                    866: The
                    867: .Fl o
                    868: option only opens a new pipe if no previous pipe exists, allowing a pipe to
                    869: be toggled with a single key, for example:
                    870: .Bd -literal -offset indent
                    871: bind-key C-p pipe-pane -o 'cat >>~/output'
                    872: .Ed
1.1       nicm      873: .It Xo Ic previous-window
1.9       nicm      874: .Op Fl a
1.1       nicm      875: .Op Fl t Ar target-session
                    876: .Xc
                    877: .D1 (alias: Ic prev )
                    878: Move to the previous window in the session.
1.9       nicm      879: With
                    880: .Fl a ,
                    881: move to the previous window with a bell, activity or content alert.
1.1       nicm      882: .It Xo Ic rename-window
                    883: .Op Fl t Ar target-window
                    884: .Ar new-name
                    885: .Xc
                    886: .D1 (alias: Ic renamew )
                    887: Rename the current window, or the window at
                    888: .Ar target-window
                    889: if specified, to
                    890: .Ar new-name .
                    891: .It Xo Ic resize-pane
1.39      jmc       892: .Op Fl DLRU
1.52      nicm      893: .Op Fl t Ar target-pane
1.1       nicm      894: .Op Ar adjustment
                    895: .Xc
                    896: .D1 (alias: Ic resizep )
1.57      jmc       897: Resize a pane, upward with
                    898: .Fl U
                    899: (the default), downward with
                    900: .Fl D ,
                    901: to the left with
                    902: .Fl L
                    903: and to the right with
                    904: .Fl R .
                    905: The
                    906: .Ar adjustment
                    907: is given in lines or cells (the default is 1).
                    908: .It Xo Ic respawn-window
                    909: .Op Fl k
                    910: .Op Fl t Ar target-window
                    911: .Op Ar command
                    912: .Xc
                    913: .D1 (alias: Ic respawnw )
                    914: Reactive a window in which the command has exited (see the
                    915: .Ic remain-on-exit
                    916: window option).
                    917: If
                    918: .Ar command
                    919: is not given, the command used when the window was created is executed.
                    920: The window must be already inactive, unless
                    921: .Fl k
                    922: is given, in which case any existing command is killed.
                    923: .It Xo Ic rotate-window
                    924: .Op Fl DU
                    925: .Op Fl t Ar target-window
                    926: .Xc
                    927: .D1 (alias: Ic rotatew )
                    928: Rotate the positions of the panes within a window, either upward (numerically
                    929: lower) with
                    930: .Fl U
                    931: or downward (numerically higher).
                    932: .It Xo Ic select-layout
                    933: .Op Fl t Ar target-window
                    934: .Op Ar layout-name
                    935: .Xc
                    936: .D1 (alias: selectl )
                    937: Choose a specific layout for a window.
                    938: If
                    939: .Ar layout-name
                    940: is not given, the last layout used (if any) is reapplied.
                    941: .It Ic select-pane Op Fl t Ar target-pane
                    942: .D1 (alias: Ic selectp )
                    943: Make pane
                    944: .Ar target-pane
                    945: the active pane in window
                    946: .Ar target-window .
                    947: .It Ic select-window Op Fl t Ar target-window
                    948: .D1 (alias: Ic selectw )
                    949: Select the window at
                    950: .Ar target-window .
                    951: .It Xo Ic split-window
                    952: .Op Fl dhv
                    953: .Oo Fl l
                    954: .Ar size |
                    955: .Fl p Ar percentage Oc
                    956: .Op Fl t Ar target-window
                    957: .Op Ar command
                    958: .Xc
                    959: .D1 (alias: splitw )
                    960: Creates a new pane by splitting the active pane:
                    961: .Fl h
                    962: does a horizontal split and
                    963: .Fl v
                    964: a vertical split; if neither is specified,
                    965: .Fl v
                    966: is assumed.
                    967: The
                    968: .Fl l
                    969: and
                    970: .Fl p
                    971: options specify the size of the new window in lines (for vertical split) or in
                    972: cells (for horizontal split), or as a percentage, respectively.
                    973: All other options have the same meaning as in the
                    974: .Ic new-window
                    975: command.
                    976: .It Xo Ic swap-pane
                    977: .Op Fl dDU
                    978: .Op Fl s Ar src-pane
                    979: .Op Fl t Ar dst-pane
                    980: .Xc
                    981: .D1 (alias: Ic swapp )
                    982: Swap two panes.
                    983: If
                    984: .Fl U
                    985: is used and no source pane is specified with
                    986: .Fl s ,
                    987: .Ar dst-pane
                    988: is swapped with the previous pane (before it numerically);
                    989: .Fl D
                    990: swaps with the next pane (after it numerically).
                    991: .It Xo Ic swap-window
                    992: .Op Fl d
                    993: .Op Fl s Ar src-window
                    994: .Op Fl t Ar dst-window
                    995: .Xc
                    996: .D1 (alias: Ic swapw )
                    997: This is similar to
                    998: .Ic link-window ,
                    999: except the source and destination windows are swapped.
                   1000: It is an error if no window exists at
                   1001: .Ar src-window .
                   1002: .It Xo Ic unlink-window
1.1       nicm     1003: .Op Fl k
                   1004: .Op Fl t Ar target-window
                   1005: .Xc
1.57      jmc      1006: .D1 (alias: Ic unlinkw )
                   1007: Unlink
                   1008: .Ar target-window .
                   1009: Unless
                   1010: .Fl k
                   1011: is given, a window may be unlinked only if it is linked to multiple sessions -
                   1012: windows may not be linked to no sessions;
                   1013: if
1.1       nicm     1014: .Fl k
1.57      jmc      1015: is specified and the window is linked to only one session, it is unlinked and
                   1016: destroyed.
                   1017: .It Ic up-pane Op Fl t Ar target-pane
                   1018: .D1 (alias: Ic upp )
1.111     nicm     1019: Change the active pane to the previous pane (lower index).
1.57      jmc      1020: .El
                   1021: .Sh KEY BINDINGS
1.93      nicm     1022: .Nm
                   1023: allows a command to be bound to most keys, with or without a prefix key.
                   1024: When specifying keys, most represent themselves (for example
                   1025: .Ql A
                   1026: to
1.95      jmc      1027: .Ql Z ) .
1.93      nicm     1028: Ctrl keys may be prefixed with
                   1029: .Ql C-
                   1030: or
1.95      jmc      1031: .Ql ^ ,
                   1032: and Alt (meta) with
1.93      nicm     1033: .Ql M- .
                   1034: In addition, the following special key names are accepted:
                   1035: .Em BSpace ,
                   1036: .Em BTab ,
                   1037: .Em DC
                   1038: (Delete),
                   1039: .Em End ,
                   1040: .Em Enter ,
                   1041: .Em Escape ,
                   1042: .Em F1
                   1043: to
                   1044: .Em F20 ,
                   1045: .Em Home ,
                   1046: .Em IC
                   1047: (Insert),
                   1048: .Em NPage
                   1049: (Page Up),
                   1050: .Em PPage
                   1051: (Page Down),
                   1052: .Em Space ,
                   1053: and
                   1054: .Em Tab .
                   1055: Note that to bind the
                   1056: .Ql \&"
                   1057: or
                   1058: .Ql '
                   1059: keys, quotation marks are necessary, for example:
                   1060: .Bd -literal -offset indent
                   1061: bind-key '"' split-window
                   1062: bind-key "'" select-prompt
                   1063: .Ed
                   1064: .Pp
1.57      jmc      1065: Commands related to key bindings are as follows:
                   1066: .Bl -tag -width Ds
                   1067: .It Xo Ic bind-key
                   1068: .Op Fl cnr
                   1069: .Op Fl t Ar key-table
                   1070: .Ar key Ar command Op Ar arguments
1.1       nicm     1071: .Xc
1.57      jmc      1072: .D1 (alias: Ic bind )
                   1073: Bind key
                   1074: .Ar key
                   1075: to
                   1076: .Ar command .
                   1077: By default (without
                   1078: .Fl t )
                   1079: the primary key bindings are modified (those normally activated with the prefix
                   1080: key); in this case, if
                   1081: .Fl n
                   1082: is specified, it is not necessary to use the prefix key,
                   1083: .Ar command
                   1084: is bound to
                   1085: .Ar key
                   1086: alone.
1.1       nicm     1087: The
1.57      jmc      1088: .Fl r
                   1089: flag indicates this key may repeat, see the
                   1090: .Ic repeat-time
                   1091: option.
                   1092: .Pp
                   1093: If
                   1094: .Fl t
                   1095: is present,
                   1096: .Ar key
                   1097: is bound in
                   1098: .Ar key-table :
                   1099: the binding for command mode with
                   1100: .Fl c
                   1101: or for normal mode without.
                   1102: To view the default bindings and possible commands, see the
                   1103: .Ic list-keys
                   1104: command.
                   1105: .It Ic list-keys Op Fl t Ar key-table
                   1106: .D1 (alias: Ic lsk )
                   1107: List all key bindings.
                   1108: Without
                   1109: .Fl t
                   1110: the primary key bindings - those executed when preceded by the prefix key -
                   1111: are printed.
                   1112: Keys bound without the prefix key (see
                   1113: .Ic bind-key
                   1114: .Fl n )
                   1115: are enclosed in square brackets.
                   1116: .Pp
                   1117: With
                   1118: .Fl t ,
                   1119: the key bindings in
                   1120: .Ar key-table
                   1121: are listed; this may be one of:
                   1122: .Em vi-edit ,
                   1123: .Em emacs-edit ,
                   1124: .Em vi-choice ,
                   1125: .Em emacs-choice ,
                   1126: .Em vi-copy
                   1127: or
                   1128: .Em emacs-copy .
                   1129: .It Xo Ic send-keys
1.72      nicm     1130: .Op Fl t Ar target-pane
1.57      jmc      1131: .Ar key Ar ...
1.1       nicm     1132: .Xc
1.57      jmc      1133: .D1 (alias: Ic send )
                   1134: Send a key or keys to a window.
                   1135: Each argument
                   1136: .Ar key
                   1137: is the name of the key (such as
                   1138: .Ql C-a
                   1139: or
                   1140: .Ql npage
                   1141: ) to send; if the string is not recognised as a key, it is sent as a series of
                   1142: characters.
                   1143: All arguments are sent sequentially from first to last.
1.72      nicm     1144: .It Ic send-prefix Op Fl t Ar target-pane
1.57      jmc      1145: Send the prefix key to a window as if it was pressed.
1.89      nicm     1146: If multiple prefix keys are configured, only the first is sent.
1.57      jmc      1147: .It Xo Ic unbind-key
                   1148: .Op Fl cn
                   1149: .Op Fl t Ar key-table
                   1150: .Ar key
1.2       nicm     1151: .Xc
1.57      jmc      1152: .D1 (alias: Ic unbind )
                   1153: Unbind the command bound to
                   1154: .Ar key .
                   1155: Without
                   1156: .Fl t
                   1157: the primary key bindings are modified; in this case, if
                   1158: .Fl n
                   1159: is specified, the command bound to
                   1160: .Ar key
                   1161: without a prefix (if any) is removed.
                   1162: .Pp
1.47      nicm     1163: If
1.57      jmc      1164: .Fl t
                   1165: is present,
                   1166: .Ar key
                   1167: in
                   1168: .Ar key-table
                   1169: is unbound: the binding for command mode with
                   1170: .Fl c
                   1171: or for normal mode without.
                   1172: .El
                   1173: .Sh OPTIONS
                   1174: The appearance and behaviour of
                   1175: .Nm
                   1176: may be modified by changing the value of various options.
                   1177: There are two types of option:
                   1178: .Em session options
                   1179: and
                   1180: .Em window options .
                   1181: .Pp
                   1182: Each individual session may have a set of session options, and there is a
                   1183: separate set of global session options.
                   1184: Sessions which do not have a particular option configured inherit the value
                   1185: from the global session options.
                   1186: Session options are set or unset with the
                   1187: .Ic set-option
                   1188: command and may be listed with the
                   1189: .Ic show-options
                   1190: command.
                   1191: The available session options are listed under the
                   1192: .Ic set-option
                   1193: command.
                   1194: .Pp
                   1195: Similarly, a set of window options is attached to each window, and there is
                   1196: a set of global window options from which any unset options are inherited.
                   1197: Window options are altered with the
                   1198: .Ic set-window-option
                   1199: command and can be listed with the
                   1200: .Ic show-window-options
                   1201: command.
                   1202: All window options are documented with the
                   1203: .Ic set-window-option
                   1204: command.
                   1205: .Pp
                   1206: Commands which set options are as follows:
                   1207: .Bl -tag -width Ds
1.1       nicm     1208: .It Xo Ic set-option
1.58      nicm     1209: .Op Fl agu
1.1       nicm     1210: .Op Fl t Ar target-session
                   1211: .Ar option Ar value
                   1212: .Xc
                   1213: .D1 (alias: Ic set )
1.18      nicm     1214: Set a session option.
1.58      nicm     1215: With
                   1216: .Fl a ,
                   1217: and if the option expects a string,
                   1218: .Ar value
                   1219: is appended to the existing setting.
1.1       nicm     1220: If
                   1221: .Fl g
1.18      nicm     1222: is specified, the global session option is set.
1.1       nicm     1223: The
                   1224: .Fl u
                   1225: flag unsets an option, so a session inherits the option from the global
                   1226: options - it is not possible to unset a global option.
                   1227: .Pp
1.18      nicm     1228: Available session options are:
1.1       nicm     1229: .Bl -tag -width Ds
1.69      nicm     1230: .It Ic base-index Ar index
                   1231: Set the base index from which an unused index should be searched when a new
                   1232: window is created.
                   1233: The default is zero.
1.1       nicm     1234: .It Xo Ic bell-action
1.56      jmc      1235: .Op Ic any | none | current
1.1       nicm     1236: .Xc
                   1237: Set action on window bell.
                   1238: .Ic any
                   1239: means a bell in any window linked to a session causes a bell in the current
                   1240: window of that session,
                   1241: .Ic none
                   1242: means all bells are ignored and
                   1243: .Ic current
                   1244: means only bell in windows other than the current window are ignored.
                   1245: .It Ic buffer-limit Ar number
                   1246: Set the number of buffers kept for each session; as new buffers are added to
                   1247: the top of the stack, old ones are removed from the bottom if necessary to
                   1248: maintain this maximum length.
                   1249: .It Ic default-command Ar command
                   1250: Set the command used for new windows (if not specified when the window is
                   1251: created) to
1.79      nicm     1252: .Ar command ,
                   1253: which may be any
                   1254: .Xr sh 1
                   1255: command.
1.19      nicm     1256: The default is an empty string, which instructs
                   1257: .Nm
1.79      nicm     1258: to create a login shell using the value of the
                   1259: .Ic default-shell
                   1260: option.
                   1261: .It Ic default-shell Ar path
                   1262: Specify the default shell.
                   1263: This is used as the login shell for new windows when the
                   1264: .Ic default-command
                   1265: option is set to empty, and must be the full path of the executable.
                   1266: When started
                   1267: .Nm
                   1268: tries to set a default value from the first suitable of the
1.19      nicm     1269: .Ev SHELL
1.79      nicm     1270: environment variable, the shell returned by
                   1271: .Xr getpwuid 3 ,
                   1272: or
                   1273: .Pa /bin/sh .
                   1274: This option should be configured when
                   1275: .Nm
                   1276: is used as a login shell.
1.1       nicm     1277: .It Ic default-path Ar path
                   1278: Set the default working directory for processes created from keys, or
                   1279: interactively from the prompt.
                   1280: The default is the current working directory when the server is started.
1.22      nicm     1281: .It Ic default-terminal Ar terminal
                   1282: Set the default terminal for new windows created in this session - the
                   1283: default value of the
                   1284: .Ev TERM
                   1285: environment variable.
                   1286: For
                   1287: .Nm
                   1288: to work correctly, this
                   1289: .Em must
                   1290: be set to
                   1291: .Ql screen
                   1292: or a derivative of it.
1.78      nicm     1293: .It Ic display-panes-colour Ar colour
                   1294: Set the colour used for the
                   1295: .Ic display-panes
                   1296: command.
                   1297: .It Ic display-panes-time Ar time
                   1298: Set the time in milliseconds for which the indicators shown by the
                   1299: .Ic display-panes
                   1300: command appear.
1.21      nicm     1301: .It Ic display-time Ar time
1.78      nicm     1302: Set the amount of time for which status line messages and other on-screen
                   1303: indicators are displayed.
1.21      nicm     1304: .Ar time
                   1305: is in milliseconds.
1.1       nicm     1306: .It Ic history-limit Ar lines
                   1307: Set the maximum number of lines held in window history.
                   1308: This setting applies only to new windows - existing window histories are not
                   1309: resized and retain the limit at the point they were created.
                   1310: .It Ic lock-after-time Ar number
1.100     nicm     1311: Lock the session (like the
                   1312: .Ic lock-session
1.90      nicm     1313: command) after
1.1       nicm     1314: .Ar number
1.100     nicm     1315: seconds of inactivity, or the entire server (all sessions) if the
                   1316: .Ic lock-server
                   1317: option is set.
                   1318: The default is not to lock (set to 0).
1.90      nicm     1319: .It Ic lock-command Ar command
                   1320: Command to run when locking each client.
                   1321: The default is to run
                   1322: .Xr lock 1
                   1323: with
                   1324: .Fl np .
1.100     nicm     1325: .It Xo Ic lock-server
                   1326: .Op Ic on | off
                   1327: .Xc
                   1328: If this option is
1.102     nicm     1329: .Ic on
1.100     nicm     1330: (the default),
                   1331: instead of each session locking individually as each has been
                   1332: idle for
1.108     jmc      1333: .Ic lock-after-time ,
                   1334: the entire server will lock after
1.100     nicm     1335: .Em all
                   1336: sessions would have locked.
                   1337: This has no effect as a session option; it must be set as a global option.
1.1       nicm     1338: .It Ic message-attr Ar attributes
                   1339: Set status line message attributes, where
                   1340: .Ar attributes
                   1341: is either
                   1342: .Ic default
                   1343: or a comma-delimited list of one or more of:
                   1344: .Ic bright
                   1345: (or
                   1346: .Ic bold ) ,
                   1347: .Ic dim ,
                   1348: .Ic underscore ,
                   1349: .Ic blink ,
                   1350: .Ic reverse ,
                   1351: .Ic hidden ,
                   1352: or
                   1353: .Ic italics .
                   1354: .It Ic message-bg Ar colour
                   1355: Set status line message background colour, where
                   1356: .Ar colour
                   1357: is one of:
                   1358: .Ic black ,
                   1359: .Ic red ,
                   1360: .Ic green ,
                   1361: .Ic yellow ,
                   1362: .Ic blue ,
                   1363: .Ic magenta ,
                   1364: .Ic cyan ,
1.85      nicm     1365: .Ic white ,
                   1366: .Ic colour0
                   1367: to
                   1368: .Ic colour255
                   1369: from the 256-colour palette, or
1.1       nicm     1370: .Ic default .
                   1371: .It Ic message-fg Ar colour
                   1372: Set status line message foreground colour.
1.102     nicm     1373: .It Xo Ic mouse-select-pane
                   1374: .Op Ic on | off
                   1375: .Xc
                   1376: If on,
                   1377: .Nm
                   1378: captures the mouse and when a window is split into multiple panes the mouse may
                   1379: be used to select the current pane.
                   1380: The mouse click is also passed through to the application as normal.
1.89      nicm     1381: .It Ic prefix Ar keys
                   1382: Set the keys accepted as a prefix key.
                   1383: .Ar keys
                   1384: is a comma-separated list of key names, each of which individually behave as
                   1385: the prefix key.
1.21      nicm     1386: .It Ic repeat-time Ar time
1.1       nicm     1387: Allow multiple commands to be entered without pressing the prefix-key again
                   1388: in the specified
1.21      nicm     1389: .Ar time
1.1       nicm     1390: milliseconds (the default is 500).
                   1391: Whether a key repeats may be set when it is bound using the
                   1392: .Fl r
                   1393: flag to
                   1394: .Ic bind-key .
1.52      nicm     1395: Repeat is enabled for the default keys bound to the
                   1396: .Ic resize-pane
                   1397: command.
1.1       nicm     1398: .It Xo Ic set-remain-on-exit
1.56      jmc      1399: .Op Ic on | off
1.1       nicm     1400: .Xc
                   1401: Set the
                   1402: .Ic remain-on-exit
                   1403: window option for any windows first created in this session.
                   1404: .It Xo Ic set-titles
1.56      jmc      1405: .Op Ic on | off
1.1       nicm     1406: .Xc
1.77      stsp     1407: Attempt to set the window title using the \ee]2;...\e007 xterm code if
1.1       nicm     1408: the terminal appears to be an xterm.
1.11      nicm     1409: This option is off by default.
1.6       jmc      1410: Note that elinks
1.1       nicm     1411: will only attempt to set the window title if the STY environment
                   1412: variable is set.
1.86      nicm     1413: .It Ic set-titles-string Ar string
                   1414: String used to set the window title if
                   1415: .Ic set-titles
                   1416: is on.
                   1417: Character sequences are replaced as for the
                   1418: .Ic status-left
                   1419: option.
1.1       nicm     1420: .It Xo Ic status
1.56      jmc      1421: .Op Ic on | off
1.1       nicm     1422: .Xc
                   1423: Show or hide the status line.
                   1424: .It Ic status-attr Ar attributes
                   1425: Set status line attributes.
                   1426: .It Ic status-bg Ar colour
                   1427: Set status line background colour.
                   1428: .It Ic status-fg Ar colour
                   1429: Set status line foreground colour.
                   1430: .It Ic status-interval Ar interval
                   1431: Update the status bar every
                   1432: .Ar interval
                   1433: seconds.
                   1434: By default, updates will occur every 15 seconds.
                   1435: A setting of zero disables redrawing at interval.
1.41      nicm     1436: .It Xo Ic status-justify
1.56      jmc      1437: .Op Ic left | centre | right
1.41      nicm     1438: .Xc
                   1439: Set the position of the window list component of the status line: left, centre
                   1440: or right justified.
1.1       nicm     1441: .It Xo Ic status-keys
1.56      jmc      1442: .Op Ic vi | emacs
1.1       nicm     1443: .Xc
1.6       jmc      1444: Use vi or emacs-style
1.1       nicm     1445: key bindings in the status line, for example at the command prompt.
                   1446: Defaults to emacs.
                   1447: .It Ic status-left Ar string
                   1448: Display
                   1449: .Ar string
                   1450: to the left of the status bar.
                   1451: .Ar string
                   1452: will be passed through
                   1453: .Xr strftime 3
                   1454: before being used.
                   1455: By default, the session name is shown.
                   1456: .Ar string
1.83      nicm     1457: may contain any of the following special character sequences:
1.1       nicm     1458: .Bl -column "Character pair" "Replaced with" -offset indent
                   1459: .It Sy "Character pair" Ta Sy "Replaced with"
                   1460: .It Li "#(command)" Ta "First line of command's output"
1.83      nicm     1461: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1       nicm     1462: .It Li "#H" Ta "Hostname of local host"
1.35      nicm     1463: .It Li "#I" Ta "Current window index"
                   1464: .It Li "#P" Ta "Current pane index"
1.1       nicm     1465: .It Li "#S" Ta "Session name"
                   1466: .It Li "#T" Ta "Current window title"
1.35      nicm     1467: .It Li "#W" Ta "Current window name"
1.1       nicm     1468: .It Li "##" Ta "A literal" Ql #
                   1469: .El
1.83      nicm     1470: .Pp
                   1471: The #(command) form executes
                   1472: .Ql command
                   1473: as a shell command and inserts the first line of its output.
1.103     nicm     1474: Note that shell commands are only executed once at the interval specified by
                   1475: the
                   1476: .Ic status-interval
                   1477: option: if the status line is redrawn in the meantime, the previous result is
                   1478: used.
1.109     nicm     1479: .Pp
1.83      nicm     1480: #[attributes] allows a comma-separated list of attributes to be specified,
                   1481: these may be
                   1482: .Ql fg=colour
                   1483: to set the foreground colour,
                   1484: .Ql bg=colour
1.109     nicm     1485: to set the background colour, the name of one of the attributes (listed under the
1.83      nicm     1486: .Ic message-attr
1.109     nicm     1487: option) to turn an attribute on, or an attribute prefixed with
                   1488: .Ql no
                   1489: to turn one off, for example
                   1490: .Ic nobright .
1.83      nicm     1491: Examples are:
                   1492: .Bd -literal -offset indent
                   1493: #(sysctl vm.loadavg)
                   1494: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
                   1495: .Ed
1.1       nicm     1496: .Pp
1.109     nicm     1497: Where appropriate, special character sequences may be prefixed with a number to
                   1498: specify the maximum length, for example
1.1       nicm     1499: .Ql #24T .
1.10      nicm     1500: .Pp
1.12      jmc      1501: By default, UTF-8 in
1.10      nicm     1502: .Ar string
                   1503: is not interpreted, to enable UTF-8, use the
                   1504: .Ic status-utf8
                   1505: option.
1.62      nicm     1506: .It Ic status-left-attr Ar attributes
1.66      jmc      1507: Set the attribute of the left part of the status line.
1.62      nicm     1508: .It Ic status-left-fg Ar colour
                   1509: Set the foreground colour of the left part of the status line.
                   1510: .It Ic status-left-bg Ar colour
                   1511: Set the background colour of the left part of the status line.
1.1       nicm     1512: .It Ic status-left-length Ar length
                   1513: Set the maximum
                   1514: .Ar length
                   1515: of the left component of the status bar.
                   1516: The default is 10.
                   1517: .It Ic status-right Ar string
                   1518: Display
                   1519: .Ar string
                   1520: to the right of the status bar.
                   1521: By default, the date and time will be shown.
                   1522: As with
                   1523: .Ic status-left ,
                   1524: .Ar string
                   1525: will be passed to
1.10      nicm     1526: .Xr strftime 3 ,
                   1527: character pairs are replaced, and UTF-8 is dependent on the
                   1528: .Ic status-utf8
                   1529: option.
1.62      nicm     1530: .It Ic status-right-attr Ar attributes
1.66      jmc      1531: Set the attribute of the right part of the status line.
1.62      nicm     1532: .It Ic status-right-fg Ar colour
                   1533: Set the foreground colour of the right part of the status line.
                   1534: .It Ic status-right-bg Ar colour
                   1535: Set the background colour of the right part of the status line.
1.1       nicm     1536: .It Ic status-right-length Ar length
                   1537: Set the maximum
                   1538: .Ar length
                   1539: of the right component of the status bar.
                   1540: The default is 40.
1.10      nicm     1541: .Pp
                   1542: .It Xo Ic status-utf8
1.56      jmc      1543: .Op Ic on | off
1.10      nicm     1544: .Xc
                   1545: Instruct
                   1546: .Nm
                   1547: to treat top-bit-set characters in the
                   1548: .Ic status-left
                   1549: and
                   1550: .Ic status-right
                   1551: strings as UTF-8; notably, this is important for wide characters.
                   1552: This option defaults to off.
1.55      jmc      1553: .It Ic terminal-overrides Ar string
1.54      nicm     1554: Contains a list of entries which override terminal descriptions read using
                   1555: .Xr terminfo 5 .
                   1556: .Ar string
                   1557: is a comma-separated list of items each a colon-separated string made up of a
                   1558: terminal type pattern (matched using
                   1559: .Xr fnmatch 3 )
                   1560: and a set of
                   1561: .Em name=value
                   1562: entries.
                   1563: .Pp
                   1564: For example, to set the
                   1565: .Ql clear
                   1566: .Xr terminfo 5
                   1567: entry to
                   1568: .Ql \ee[H\ee[2J
                   1569: for all terminal types and the
                   1570: .Ql dch1
                   1571: entry to
                   1572: .Ql \ee[P
1.55      jmc      1573: for the
1.54      nicm     1574: .Ql rxvt
                   1575: terminal type, the option could be set to the string:
                   1576: .Bd -literal -offset indent
                   1577: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
                   1578: .Ed
                   1579: .Pp
                   1580: The terminal entry value is passed through
                   1581: .Xr strunvis 3
                   1582: before interpretation.
                   1583: The default value forcibly corrects the
                   1584: .Ql colors
                   1585: entry for terminals which support 88 or 256 colours:
                   1586: .Bd -literal -offset indent
                   1587: "*88col*:colors=88,*256col*:colors=256"
                   1588: .Ed
1.63      nicm     1589: .It Ic update-environment Ar variables
                   1590: Set a space-separated string containing a list of environment variables to be
                   1591: copied into the session environment when a new session is created or an
                   1592: existing session is attached.
                   1593: Any variables that do not exist in the source environment are set to be
                   1594: removed from the session environment (as if
                   1595: .Fl r
                   1596: was given to the
                   1597: .Ic set-environment
                   1598: command).
                   1599: The default is
1.75      nicm     1600: "DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION".
1.37      nicm     1601: .It Xo Ic visual-activity
1.56      jmc      1602: .Op Ic on | off
1.37      nicm     1603: .Xc
                   1604: If on, display a status line message when activity occurs in a window
1.39      jmc      1605: for which the
1.37      nicm     1606: .Ic monitor-activity
                   1607: window option is enabled.
                   1608: .It Xo Ic visual-bell
1.56      jmc      1609: .Op Ic on | off
1.37      nicm     1610: .Xc
                   1611: If this option is on, a message is shown on a bell instead of it being passed
                   1612: through to the terminal (which normally makes a sound).
                   1613: Also see the
                   1614: .Ic bell-action
                   1615: option.
                   1616: .It Xo Ic visual-content
1.56      jmc      1617: .Op Ic on | off
1.37      nicm     1618: .Xc
                   1619: Like
                   1620: .Ic visual-activity ,
                   1621: display a message when content is present in a window
1.39      jmc      1622: for which the
1.37      nicm     1623: .Ic monitor-content
                   1624: window option is enabled.
1.1       nicm     1625: .El
                   1626: .It Xo Ic set-window-option
1.58      nicm     1627: .Op Fl agu
1.1       nicm     1628: .Op Fl t Ar target-window
                   1629: .Ar option Ar value
                   1630: .Xc
                   1631: .D1 (alias: Ic setw )
1.18      nicm     1632: Set a window option.
1.1       nicm     1633: The
1.58      nicm     1634: .Fl a ,
1.1       nicm     1635: .Fl g
                   1636: and
                   1637: .Fl u
                   1638: flags work similarly to the
                   1639: .Ic set-option
                   1640: command.
                   1641: .Pp
1.18      nicm     1642: Supported window options are:
1.56      jmc      1643: .Pp
                   1644: .Bl -tag -width Ds -compact
1.1       nicm     1645: .It Xo Ic aggressive-resize
1.56      jmc      1646: .Op Ic on | off
1.1       nicm     1647: .Xc
                   1648: Aggressively resize the chosen window.
                   1649: This means that
                   1650: .Nm
                   1651: will resize the window to the size of the smallest session for which it is the
                   1652: current window, rather than the smallest session to which it is attached.
                   1653: The window may resize when the current window is changed on another sessions;
1.6       jmc      1654: this option is good for full-screen programs which support
                   1655: .Dv SIGWINCH
                   1656: and poor for interactive programs such as shells.
1.56      jmc      1657: .Pp
1.1       nicm     1658: .It Xo Ic automatic-rename
1.56      jmc      1659: .Op Ic on | off
1.1       nicm     1660: .Xc
                   1661: Control automatic window renaming.
                   1662: When this setting is enabled,
                   1663: .Nm
                   1664: will attempt - on supported platforms - to rename the window to reflect the
                   1665: command currently running in it.
                   1666: This flag is automatically disabled for an individual window when a name
                   1667: is specified at creation with
                   1668: .Ic new-window or
                   1669: .Ic new-session ,
                   1670: or later with
                   1671: .Ic rename-window .
                   1672: It may be switched off globally with:
                   1673: .Bd -literal -offset indent
                   1674: set-window-option -g automatic-rename off
                   1675: .Ed
1.56      jmc      1676: .Pp
1.1       nicm     1677: .It Ic clock-mode-colour Ar colour
                   1678: Set clock colour.
1.56      jmc      1679: .Pp
1.1       nicm     1680: .It Xo Ic clock-mode-style
1.56      jmc      1681: .Op Ic 12 | 24
1.1       nicm     1682: .Xc
                   1683: Set clock hour format.
1.56      jmc      1684: .Pp
1.1       nicm     1685: .It Ic force-height Ar height
                   1686: .It Ic force-width Ar width
                   1687: Prevent
                   1688: .Nm
                   1689: from resizing a window to greater than
                   1690: .Ar width
                   1691: or
                   1692: .Ar height .
                   1693: A value of zero restores the default unlimited setting.
1.56      jmc      1694: .Pp
1.2       nicm     1695: .It Ic main-pane-width Ar width
                   1696: .It Ic main-pane-height Ar height
                   1697: Set the width or height of the main (left or top) pane in the
                   1698: .Ic main-horizontal
                   1699: or
                   1700: .Ic main-vertical
                   1701: layouts.
1.56      jmc      1702: .Pp
1.1       nicm     1703: .It Ic mode-attr Ar attributes
                   1704: Set window modes attributes.
1.56      jmc      1705: .Pp
1.1       nicm     1706: .It Ic mode-bg Ar colour
                   1707: Set window modes background colour.
1.56      jmc      1708: .Pp
1.1       nicm     1709: .It Ic mode-fg Ar colour
                   1710: Set window modes foreground colour.
1.56      jmc      1711: .Pp
1.1       nicm     1712: .It Xo Ic mode-keys
1.56      jmc      1713: .Op Ic vi | emacs
1.1       nicm     1714: .Xc
1.105     nicm     1715: Use vi or emacs-style key bindings in copy and choice modes.
1.1       nicm     1716: Key bindings default to emacs.
1.56      jmc      1717: .Pp
1.50      nicm     1718: .It Xo Ic mode-mouse
1.56      jmc      1719: .Op Ic on | off
1.50      nicm     1720: .Xc
1.51      jmc      1721: Mouse state in modes.
                   1722: If on,
1.50      nicm     1723: .Nm
                   1724: will respond to mouse clicks by moving the cursor in copy mode or selecting an
                   1725: option in choice mode.
1.56      jmc      1726: .Pp
1.1       nicm     1727: .It Xo Ic monitor-activity
1.56      jmc      1728: .Op Ic on | off
1.1       nicm     1729: .Xc
                   1730: Monitor for activity in the window.
                   1731: Windows with activity are highlighted in the status line.
1.56      jmc      1732: .Pp
                   1733: .It Ic monitor-content Ar match-string
1.6       jmc      1734: Monitor content in the window.
                   1735: When
1.16      nicm     1736: .Xr fnmatch 3
                   1737: pattern
1.1       nicm     1738: .Ar match-string
                   1739: appears in the window, it is highlighted in the status line.
1.56      jmc      1740: .Pp
1.1       nicm     1741: .It Xo Ic remain-on-exit
1.56      jmc      1742: .Op Ic on | off
1.1       nicm     1743: .Xc
                   1744: A window with this flag set is not destroyed when the program running in it
                   1745: exits.
                   1746: The window may be reactivated with the
                   1747: .Ic respawn-window
                   1748: command.
1.56      jmc      1749: .Pp
1.99      nicm     1750: .It Xo Ic synchronize-panes
                   1751: .Op Ic on | off
                   1752: .Xc
                   1753: Duplicate input to any pane to all other panes in the same window, except
                   1754: for panes that are not in output mode.
1.1       nicm     1755: .It Xo Ic utf8
1.56      jmc      1756: .Op Ic on | off
1.1       nicm     1757: .Xc
                   1758: Instructs
                   1759: .Nm
                   1760: to expect UTF-8 sequences to appear in this window.
1.56      jmc      1761: .Pp
1.1       nicm     1762: .It Ic window-status-attr Ar attributes
                   1763: Set status line attributes for a single window.
1.56      jmc      1764: .Pp
1.1       nicm     1765: .It Ic window-status-bg Ar colour
                   1766: Set status line background colour for a single window.
1.56      jmc      1767: .Pp
1.1       nicm     1768: .It Ic window-status-fg Ar colour
                   1769: Set status line foreground colour for a single window.
1.56      jmc      1770: .Pp
1.40      nicm     1771: .It Ic window-status-current-attr Ar attributes
                   1772: Set status line attributes for the currently active window.
1.56      jmc      1773: .Pp
1.40      nicm     1774: .It Ic window-status-current-bg Ar colour
                   1775: Set status line background colour for the currently active window.
1.56      jmc      1776: .Pp
1.40      nicm     1777: .It Ic window-status-current-fg Ar colour
                   1778: Set status line foreground colour for the currently active window.
1.56      jmc      1779: .Pp
1.1       nicm     1780: .It Xo Ic xterm-keys
1.56      jmc      1781: .Op Ic on | off
1.1       nicm     1782: .Xc
                   1783: If this option is set,
                   1784: .Nm
                   1785: will generate
1.57      jmc      1786: .Xr xterm 1 -style
                   1787: function key sequences; these have a number included to indicate modifiers such
                   1788: as Shift, Alt or Ctrl.
                   1789: .El
                   1790: .It Xo Ic show-options
                   1791: .Op Fl g
                   1792: .Op Fl t Ar target-session
                   1793: .Xc
                   1794: .D1 (alias: Ic show )
                   1795: Show the session options for
                   1796: .Ar target session ,
                   1797: or the global session options with
                   1798: .Fl g .
                   1799: .It Xo Ic show-window-options
                   1800: .Op Fl g
                   1801: .Op Fl t Ar target-window
                   1802: .Xc
                   1803: .D1 (alias: Ic showw )
                   1804: List the window options for
                   1805: .Ar target-window ,
                   1806: or the global window options if
                   1807: .Fl g
                   1808: is used.
1.63      nicm     1809: .El
                   1810: .Sh ENVIRONMENT
                   1811: When the server is started,
                   1812: .Nm
                   1813: copies the environment into the
                   1814: .Em global environment ;
                   1815: in addition, each session has a
                   1816: .Em session environment .
                   1817: When a window is created, the session and global environments are merged with
                   1818: the session environment overriding any variable present in both.
                   1819: This is the initial environment passed to the new process.
                   1820: .Pp
                   1821: The
                   1822: .Ic update-environment
                   1823: session option may be used to update the session environment from the client
                   1824: when a new session is created or an old reattached.
                   1825: .Nm
                   1826: also initialises the
                   1827: .Ev TMUX
                   1828: variable with some internal information to allow commands to be executed
                   1829: from inside, and the
                   1830: .Ev TERM
                   1831: variable with the correct terminal setting of
                   1832: .Ql screen .
                   1833: .Pp
                   1834: Commands to alter and view the environment are:
                   1835: .Bl -tag -width Ds
                   1836: .It Xo Ic set-environment
                   1837: .Op Fl gru
                   1838: .Op Fl t Ar target-session
                   1839: .Ar name Op Ar value
                   1840: .Xc
                   1841: Set or unset an environment variable.
                   1842: If
                   1843: .Fl g
                   1844: is used, the change is made in the global environment; otherwise, it is applied
                   1845: to the session environment for
                   1846: .Ar target-session .
                   1847: The
                   1848: .Fl u
                   1849: flag unsets a variable.
                   1850: .Fl r
                   1851: indicates the variable is to be removed from the environment before starting a
                   1852: new process.
                   1853: .It Xo Ic show-environment
                   1854: .Op Fl g
                   1855: .Op Fl t Ar target-session
                   1856: .Xc
                   1857: Display the environment for
                   1858: .Ar target-session
                   1859: or the global environment with
                   1860: .Fl g .
                   1861: Variables removed from the environment are prefixed with
                   1862: .Ql - .
1.57      jmc      1863: .El
                   1864: .Sh STATUS LINE
                   1865: .Nm
                   1866: includes an optional status line which is displayed in the bottom line of each
                   1867: terminal.
                   1868: By default, the status line is enabled (it may be disabled with the
                   1869: .Ic status
                   1870: session option) and contains, from left-to-right: the name of the current
                   1871: session in square brackets; the window list; the current window title in double
                   1872: quotes; and the time and date.
                   1873: .Pp
                   1874: The status line is made of three parts: configurable left and right sections
                   1875: (which may contain dynamic content such as the time or output from a shell
                   1876: command, see the
                   1877: .Ic status-left ,
                   1878: .Ic status-left-length ,
                   1879: .Ic status-right ,
                   1880: and
                   1881: .Ic status-right-length
                   1882: options below), and a central window list.
                   1883: The window list shows the index, name and (if any) flag of the windows
                   1884: present in the current session in ascending numerical order.
                   1885: The flag is one of the following symbols appended to the window name:
                   1886: .Bl -column "Symbol" "Meaning" -offset indent
                   1887: .It Sy "Symbol" Ta Sy "Meaning"
                   1888: .It Li "*" Ta "Denotes the current window."
                   1889: .It Li "-" Ta "Marks the last window (previously selected)."
                   1890: .It Li "#" Ta "Window is monitored and activity has been detected."
                   1891: .It Li "!" Ta "A bell has occurred in the window."
                   1892: .It Li "+" Ta "Window is monitored for content and it has appeared."
                   1893: .El
                   1894: .Pp
                   1895: The # symbol relates to the
                   1896: .Ic monitor-activity
                   1897: and + to the
                   1898: .Ic monitor-content
                   1899: window options.
                   1900: The window name is printed in inverted colours if an alert (bell, activity or
                   1901: content) is present.
                   1902: .Pp
                   1903: The colour and attributes of the status line may be configured, the entire status line using
                   1904: the
                   1905: .Ic status-attr ,
                   1906: .Ic status-fg
                   1907: and
                   1908: .Ic status-bg
                   1909: session options and individual windows using the
                   1910: .Ic window-status-attr ,
                   1911: .Ic window-status-fg
                   1912: and
                   1913: .Ic window-status-bg
                   1914: window options.
                   1915: .Pp
                   1916: The status line is automatically refreshed at interval if it has changed, the interval may be
                   1917: controlled with the
                   1918: .Ic status-interval
                   1919: session option.
                   1920: .Pp
                   1921: Commands related to the status line are as follows:
                   1922: .Bl -tag -width Ds
                   1923: .It Xo Ic command-prompt
1.73      nicm     1924: .Op Fl p Ar prompts
1.57      jmc      1925: .Op Fl t Ar target-client
                   1926: .Op Ar template
                   1927: .Xc
                   1928: Open the command prompt in a client.
                   1929: This may be used from inside
                   1930: .Nm
                   1931: to execute commands interactively.
                   1932: If
                   1933: .Ar template
1.73      nicm     1934: is specified, it is used as the command.
                   1935: If
                   1936: .Fl p
                   1937: is given,
                   1938: .Ar prompts
                   1939: is a comma-separated list of prompts which are displayed in order; otherwise
                   1940: a single prompt is displayed, constructed from
                   1941: .Ar template
                   1942: if it is present, or
                   1943: .Ql \&:
                   1944: if not.
                   1945: Before the command is executed, the first occurrence of the string
                   1946: .Ql %%
1.74      jmc      1947: and all occurrences of
1.73      nicm     1948: .Ql %1
                   1949: are replaced by the response to the first prompt, the second
                   1950: .Ql %%
                   1951: and all
                   1952: .Ql %2
                   1953: are replaced with the response to the second prompt, and so on for further
1.74      jmc      1954: prompts.
                   1955: Up to nine prompt responses may be replaced
                   1956: .Po
                   1957: .Ql %1
1.73      nicm     1958: to
1.74      jmc      1959: .Ql %9
                   1960: .Pc .
1.57      jmc      1961: .It Xo Ic confirm-before
                   1962: .Op Fl t Ar target-client
                   1963: .Ar command
                   1964: .Xc
                   1965: .D1 (alias: Ic confirm )
                   1966: Ask for confirmation before executing
                   1967: .Ar command .
                   1968: This command works only from inside
                   1969: .Nm .
                   1970: .It Xo Ic display-message
                   1971: .Op Fl t Ar target-client
                   1972: .Op Ar message
                   1973: .Xc
                   1974: .D1 (alias: Ic display )
                   1975: Display a message (see the
                   1976: .Ic status-left
                   1977: option below)
                   1978: in the status line.
                   1979: .It Ic select-prompt Op Fl t Ar target-client
                   1980: Open a prompt inside
                   1981: .Ar target-client
                   1982: allowing a window index to be entered interactively.
                   1983: .El
                   1984: .Sh BUFFERS
                   1985: .Nm
                   1986: maintains a stack of
                   1987: .Em paste buffers
                   1988: for each session.
                   1989: Up to the value of the
                   1990: .Ic buffer-limit
                   1991: option are kept; when a new buffer is added, the buffer at the bottom of the
                   1992: stack is removed.
                   1993: Buffers may be added using
                   1994: .Ic copy-mode
                   1995: or the
                   1996: .Ic set-buffer
                   1997: command, and pasted into a window using the
                   1998: .Ic paste-buffer
                   1999: command.
                   2000: .Pp
                   2001: A configurable history buffer is also maintained for each window.
                   2002: By default, up to 2000 lines are kept; this can be altered with the
                   2003: .Ic history-limit
                   2004: option (see the
                   2005: .Ic set-option
                   2006: command above).
                   2007: .Pp
                   2008: The buffer commands are as follows:
                   2009: .Bl -tag -width Ds
                   2010: .It Ic clear-history Op Fl t Ar target-pane
                   2011: .D1 (alias: Ic clearhist )
                   2012: Remove and free the history for the specified pane.
                   2013: .It Xo Ic copy-buffer
                   2014: .Op Fl a Ar src-index
                   2015: .Op Fl b Ar dst-index
                   2016: .Op Fl s Ar src-session
                   2017: .Op Fl t Ar dst-session
                   2018: .Xc
                   2019: .D1 (alias: Ic copyb )
                   2020: Copy a session paste buffer to another session.
                   2021: If no sessions are specified, the current one is used instead.
                   2022: .It Xo Ic delete-buffer
                   2023: .Op Fl b Ar buffer-index
                   2024: .Op Fl t Ar target-session
                   2025: .Xc
                   2026: .D1 (alias: Ic deleteb )
                   2027: Delete the buffer at
                   2028: .Ar buffer-index ,
                   2029: or the top buffer if not specified.
                   2030: .It Ic list-buffers Op Fl t Ar target-session
                   2031: .D1 (alias: Ic lsb )
                   2032: List the buffers in the given session.
                   2033: .It Xo Ic load-buffer
                   2034: .Op Fl b Ar buffer-index
                   2035: .Op Fl t Ar target-session
                   2036: .Ar path
                   2037: .Xc
                   2038: .D1 (alias: Ic loadb )
                   2039: Load the contents of the specified paste buffer from
                   2040: .Ar path .
                   2041: .It Xo Ic paste-buffer
                   2042: .Op Fl dr
                   2043: .Op Fl b Ar buffer-index
                   2044: .Op Fl t Ar target-window
                   2045: .Xc
                   2046: .D1 (alias: Ic pasteb )
                   2047: Insert the contents of a paste buffer into the current window.
                   2048: With
                   2049: .Fl d ,
                   2050: also delete the paste buffer from the stack.
                   2051: When output, any linefeed (LF) characters in the paste buffer are replaced with
                   2052: carriage returns (CR).
                   2053: This translation may be disabled with the
                   2054: .Fl r
                   2055: flag.
                   2056: .It Xo Ic save-buffer
                   2057: .Op Fl a
                   2058: .Op Fl b Ar buffer-index
                   2059: .Op Fl t Ar target-session
                   2060: .Ar path
                   2061: .Xc
                   2062: .D1 (alias: Ic saveb )
                   2063: Save the contents of the specified paste buffer to
                   2064: .Ar path .
                   2065: The
                   2066: .Fl a
                   2067: option appends to rather than overwriting the file.
                   2068: .It Xo Ic set-buffer
                   2069: .Op Fl b Ar buffer-index
                   2070: .Op Fl t Ar target-session
                   2071: .Ar data
                   2072: .Xc
                   2073: .D1 (alias: Ic setb )
                   2074: Set the contents of the specified buffer to
                   2075: .Ar data .
1.1       nicm     2076: .It Xo Ic show-buffer
                   2077: .Op Fl b Ar buffer-index
                   2078: .Op Fl t Ar target-session
                   2079: .Xc
                   2080: .D1 (alias: Ic showb )
                   2081: Display the contents of the specified buffer.
1.57      jmc      2082: .El
                   2083: .Sh MISCELLANEOUS
                   2084: .Pp
                   2085: Miscellaneous commands are as follows:
                   2086: .Bl -tag -width Ds
1.72      nicm     2087: .It Ic clock-mode Op Fl t Ar target-pane
1.57      jmc      2088: Display a large clock.
                   2089: .It Ic if-shell Ar shell-command command
                   2090: .D1 (alias: Ic if )
                   2091: Execute
                   2092: .Ar command
                   2093: if
                   2094: .Ar shell-command
                   2095: returns success.
                   2096: .It Ic lock-server
                   2097: .D1 (alias: Ic lock )
1.90      nicm     2098: Lock each client individually by running the command specified by the
                   2099: .Ic lock-command
                   2100: option.
1.87      nicm     2101: .It Ic run-shell Ar command
                   2102: .D1 (alias: Ic run )
                   2103: Execute
                   2104: .Ar command
1.106     nicm     2105: in the background without creating a window.
                   2106: After the command finishes, any output to stdout is displayed in output mode.
1.87      nicm     2107: If
1.88      jmc      2108: .Ar command
1.87      nicm     2109: doesn't return success, the exit status is also displayed.
1.57      jmc      2110: .It Ic server-info
                   2111: .D1 (alias: Ic info )
                   2112: Show server information and terminal details.
1.1       nicm     2113: .El
                   2114: .Sh FILES
1.26      nicm     2115: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1       nicm     2116: .It Pa ~/.tmux.conf
1.6       jmc      2117: Default
1.1       nicm     2118: .Nm
1.6       jmc      2119: configuration file.
1.26      nicm     2120: .It Pa /etc/tmux.conf
                   2121: System-wide configuration file.
1.1       nicm     2122: .El
1.57      jmc      2123: .Sh EXAMPLES
                   2124: To create a new
                   2125: .Nm
                   2126: session running
                   2127: .Xr vi 1 :
                   2128: .Pp
                   2129: .Dl $ tmux new-session vi
                   2130: .Pp
                   2131: Most commands have a shorter form, known as an alias.
                   2132: For new-session, this is
                   2133: .Ic new :
                   2134: .Pp
                   2135: .Dl $ tmux new vi
                   2136: .Pp
                   2137: Alternatively, the shortest unambiguous form of a command is accepted.
                   2138: If there are several options, they are listed:
                   2139: .Bd -literal -offset indent
                   2140: $ tmux n
                   2141: ambiguous command: n, could be: new-session, new-window, next-window
                   2142: .Ed
                   2143: .Pp
                   2144: Within an active session, a new window may be created by typing
                   2145: .Ql C-b c
                   2146: (Ctrl
                   2147: followed by the
                   2148: .Ql b
                   2149: key
                   2150: followed by the
                   2151: .Ql c
                   2152: key).
                   2153: .Pp
                   2154: Windows may be navigated with:
                   2155: .Ql C-b 0
                   2156: (to select window 0),
                   2157: .Ql C-b 1
                   2158: (to select window 1), and so on;
                   2159: .Ql C-b n
                   2160: to select the next window; and
                   2161: .Ql C-b p
                   2162: to select the previous window.
                   2163: .Pp
                   2164: A session may be detached using
                   2165: .Ql C-b d
1.64      nicm     2166: (or by an external event such as
                   2167: .Xr ssh 1
                   2168: disconnection) and reattached with:
1.57      jmc      2169: .Pp
                   2170: .Dl $ tmux attach-session
                   2171: .Pp
                   2172: Typing
                   2173: .Ql C-b \&?
                   2174: lists the current key bindings in the current window; up and down may be used
                   2175: to navigate the list or
                   2176: .Ql q
                   2177: to exit from it.
                   2178: .Pp
                   2179: Commands to be run when the
                   2180: .Nm
                   2181: server is started may be placed in the
                   2182: .Pa ~/.tmux.conf
                   2183: configuration file.
                   2184: Common examples include:
                   2185: .Pp
                   2186: Changing the default prefix key:
                   2187: .Bd -literal -offset indent
                   2188: set-option -g prefix C-a
                   2189: unbind-key C-b
                   2190: bind-key C-a send-prefix
                   2191: .Ed
                   2192: .Pp
                   2193: Turning the status line off, or changing its colour:
                   2194: .Bd -literal -offset indent
                   2195: set-option -g status off
                   2196: set-option -g status-bg blue
                   2197: .Ed
                   2198: .Pp
                   2199: Setting other options, such as the default command,
                   2200: or locking after 30 minutes of inactivity:
                   2201: .Bd -literal -offset indent
                   2202: set-option -g default-command "exec /bin/ksh"
                   2203: set-option -g lock-after-time 1800
                   2204: .Ed
                   2205: .Pp
                   2206: Creating new key bindings:
                   2207: .Bd -literal -offset indent
                   2208: bind-key b set-option status
                   2209: bind-key / command-prompt "split-window 'exec man %%'"
1.73      nicm     2210: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57      jmc      2211: .Ed
1.1       nicm     2212: .Sh SEE ALSO
                   2213: .Xr pty 4
                   2214: .Sh AUTHORS
                   2215: .An Nicholas Marriott Aq nicm@users.sourceforge.net