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

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