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

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