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

1.210   ! nicm        1: .\" $OpenBSD: tmux.1,v 1.209 2011/01/13 09:50:11 nicm Exp $
1.1       nicm        2: .\"
                      3: .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
                      4: .\"
                      5: .\" Permission to use, copy, modify, and distribute this software for any
                      6: .\" purpose with or without fee is hereby granted, provided that the above
                      7: .\" copyright notice and this permission notice appear in all copies.
                      8: .\"
                      9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
                     14: .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
                     15: .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16: .\"
1.210   ! nicm       17: .Dd $Mdocdate: January 13 2011 $
1.1       nicm       18: .Dt TMUX 1
                     19: .Os
                     20: .Sh NAME
                     21: .Nm tmux
1.6       jmc        22: .Nd terminal multiplexer
1.1       nicm       23: .Sh SYNOPSIS
                     24: .Nm tmux
                     25: .Bk -words
1.114     nicm       26: .Op Fl 28lquv
1.91      nicm       27: .Op Fl c Ar shell-command
1.1       nicm       28: .Op Fl f Ar file
                     29: .Op Fl L Ar socket-name
                     30: .Op Fl S Ar socket-path
                     31: .Op Ar command Op Ar flags
                     32: .Ek
                     33: .Sh DESCRIPTION
                     34: .Nm
1.59      jmc        35: is a terminal multiplexer:
                     36: it enables a number of terminals to be created, accessed, and
                     37: controlled from a single screen.
1.67      jmc        38: .Nm
                     39: may be detached from a screen
                     40: and continue running in the background,
                     41: then later reattached.
1.1       nicm       42: .Pp
1.60      nicm       43: When
                     44: .Nm
                     45: is started it creates a new
                     46: .Em session
                     47: with a single
                     48: .Em window
                     49: and displays it on screen.
                     50: A status line at the bottom of the screen
                     51: shows information on the current session
                     52: and is used to enter interactive commands.
                     53: .Pp
                     54: A session is a single collection of
                     55: .Em pseudo terminals
                     56: under the management of
                     57: .Nm .
                     58: Each session has one or more
                     59: windows linked to it.
                     60: A window occupies the entire screen
                     61: and may be split into rectangular panes,
                     62: each of which is a separate pseudo terminal
                     63: (the
                     64: .Xr pty 4
                     65: manual page documents the technical details of pseudo terminals).
                     66: Any number of
                     67: .Nm
                     68: instances may connect to the same session,
                     69: and any number of windows may be present in the same session.
                     70: Once all sessions are killed,
                     71: .Nm
                     72: exits.
                     73: .Pp
1.64      nicm       74: Each session is persistent and will survive accidental disconnection
1.66      jmc        75: (such as
1.64      nicm       76: .Xr ssh 1
1.67      jmc        77: connection timeout) or intentional detaching (with the
1.64      nicm       78: .Ql C-b d
                     79: key strokes).
                     80: .Nm
                     81: may be reattached using:
                     82: .Pp
                     83: .Dl $ tmux attach
1.60      nicm       84: .Pp
1.64      nicm       85: In
                     86: .Nm ,
                     87: a session is displayed on screen by a
                     88: .Em client
                     89: and all sessions are managed by a single
                     90: .Em server .
                     91: The server and each client are separate processes which communicate through a
                     92: socket in
                     93: .Pa /tmp .
1.65      nicm       94: .Pp
1.1       nicm       95: The options are as follows:
                     96: .Bl -tag -width "XXXXXXXXXXXX"
                     97: .It Fl 2
                     98: Force
                     99: .Nm
                    100: to assume the terminal supports 256 colours.
                    101: .It Fl 8
                    102: Like
                    103: .Fl 2 ,
1.6       jmc       104: but indicates that the terminal supports 88 colours.
1.91      nicm      105: .It Fl c Ar shell-command
                    106: Execute
                    107: .Ar shell-command
                    108: using the default shell.
                    109: If necessary, the
                    110: .Nm
                    111: server will be started to retrieve the
                    112: .Ic default-shell
                    113: option.
1.153     nicm      114: This option is for compatibility with
                    115: .Xr sh 1
                    116: when
                    117: .Nm
                    118: is used as a login shell.
1.1       nicm      119: .It Fl f Ar file
                    120: Specify an alternative configuration file.
                    121: By default,
                    122: .Nm
1.26      nicm      123: loads the system configuration file from
                    124: .Pa /etc/tmux.conf ,
                    125: if present, then looks for a user configuration file at
1.1       nicm      126: .Pa ~/.tmux.conf .
                    127: The configuration file is a set of
                    128: .Nm
                    129: commands which are executed in sequence when the server is first started.
1.61      nicm      130: .Pp
                    131: If a command in the configuration file fails,
                    132: .Nm
                    133: will report an error and exit without executing further commands.
1.1       nicm      134: .It Fl L Ar socket-name
                    135: .Nm
                    136: stores the server socket in a directory under
1.208     nicm      137: .Pa /tmp
                    138: (or
                    139: .Ev TMPDIR
                    140: if set);
1.1       nicm      141: the default socket is named
                    142: .Em default .
                    143: This option allows a different socket name to be specified, allowing several
                    144: independent
                    145: .Nm
                    146: servers to be run.
                    147: Unlike
                    148: .Fl S
                    149: a full path is not necessary: the sockets are all created in the same
                    150: directory.
1.2       nicm      151: .Pp
                    152: If the socket is accidentally removed, the
1.6       jmc       153: .Dv SIGUSR1
1.2       nicm      154: signal may be sent to the
                    155: .Nm
                    156: server process to recreate it.
1.166     sobrado   157: .It Fl l
                    158: Behave as a login shell.
                    159: This flag currently has no effect and is for compatibility with other shells
                    160: when using tmux as a login shell.
1.4       sobrado   161: .It Fl q
1.133     nicm      162: Set the
                    163: .Ic quiet
                    164: server option to prevent the server sending various informational messages.
1.1       nicm      165: .It Fl S Ar socket-path
                    166: Specify a full alternative path to the server socket.
                    167: If
                    168: .Fl S
                    169: is specified, the default socket directory is not used and any
                    170: .Fl L
                    171: flag is ignored.
                    172: .It Fl u
                    173: .Nm
1.14      nicm      174: attempts to guess if the terminal is likely to support UTF-8 by checking the
                    175: first of the
                    176: .Ev LC_ALL ,
                    177: .Ev LC_CTYPE
                    178: and
1.2       nicm      179: .Ev LANG
1.14      nicm      180: environment variables to be set for the string "UTF-8".
1.5       nicm      181: This is not always correct: the
1.2       nicm      182: .Fl u
                    183: flag explicitly informs
                    184: .Nm
1.6       jmc       185: that UTF-8 is supported.
1.33      nicm      186: .Pp
                    187: If the server is started from a client passed
                    188: .Fl u
                    189: or where UTF-8 is detected, the
                    190: .Ic utf8
                    191: and
                    192: .Ic status-utf8
                    193: options are enabled in the global window and session options respectively.
1.1       nicm      194: .It Fl v
                    195: Request verbose logging.
                    196: This option may be specified multiple times for increasing verbosity.
                    197: Log messages will be saved into
                    198: .Pa tmux-client-PID.log
                    199: and
                    200: .Pa tmux-server-PID.log
                    201: files in the current directory, where
                    202: .Em PID
1.6       jmc       203: is the PID of the server or client process.
1.1       nicm      204: .It Ar command Op Ar flags
                    205: This specifies one of a set of commands used to control
                    206: .Nm ,
1.6       jmc       207: as described in the following sections.
1.59      jmc       208: If no commands are specified, the
1.1       nicm      209: .Ic new-session
                    210: command is assumed.
1.57      jmc       211: .El
1.64      nicm      212: .Sh KEY BINDINGS
                    213: .Nm
                    214: may be controlled from an attached client by using a key combination of a
                    215: prefix key,
                    216: .Ql C-b
                    217: (Ctrl-b) by default, followed by a command key.
                    218: .Pp
1.172     nicm      219: The default command key bindings are:
1.64      nicm      220: .Pp
1.171     nicm      221: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
                    222: .It C-b
                    223: Send the prefix key (C-b) through to the application.
                    224: .It C-o
                    225: Rotate the panes in the current window forwards.
                    226: .It C-z
                    227: Suspend the
                    228: .Nm
                    229: client.
                    230: .It !
                    231: Break the current pane out of the window.
                    232: .It \&"
                    233: Split the current pane into two, top and bottom.
                    234: .It #
                    235: List all paste buffers.
                    236: .It %
                    237: Split the current pane into two, left and right.
                    238: .It &
                    239: Kill the current window.
                    240: .It '
                    241: Prompt for a window index to select.
                    242: .It ,
                    243: Rename the current window.
                    244: .It -
                    245: Delete the most recently copied buffer of text.
                    246: .It .
                    247: Prompt for an index to move the current window.
                    248: .It 0 to 9
                    249: Select windows 0 to 9.
                    250: .It :
                    251: Enter the
                    252: .Nm
                    253: command prompt.
1.187     nicm      254: .It ;
                    255: Move to the previously active pane.
1.178     nicm      256: .It =
                    257: Choose which buffer to paste interactively from a list.
1.171     nicm      258: .It \&?
                    259: List all key bindings.
                    260: .It D
                    261: Choose a client to detach.
1.182     jmc       262: .It \&[
1.171     nicm      263: Enter copy mode to copy text or view the history.
1.182     jmc       264: .It \&]
1.171     nicm      265: Paste the most recently copied buffer of text.
1.64      nicm      266: .It c
1.65      nicm      267: Create a new window.
1.64      nicm      268: .It d
1.65      nicm      269: Detach the current client.
1.171     nicm      270: .It f
                    271: Prompt to search for text in open windows.
                    272: .It i
                    273: Display some information about the current window.
1.64      nicm      274: .It l
1.65      nicm      275: Move to the previously selected window.
1.64      nicm      276: .It n
1.65      nicm      277: Change to the next window.
1.171     nicm      278: .It o
                    279: Select the next pane in the current window.
1.64      nicm      280: .It p
1.65      nicm      281: Change to the previous window.
1.171     nicm      282: .It q
                    283: Briefly display pane indexes.
                    284: .It r
                    285: Force redraw of the attached client.
                    286: .It s
                    287: Select a new session for the attached client interactively.
1.194     nicm      288: .It L
                    289: Switch the attached client back to the last session.
1.171     nicm      290: .It t
                    291: Show the time.
                    292: .It w
                    293: Choose the current window interactively.
                    294: .It x
                    295: Kill the current pane.
                    296: .It {
                    297: Swap the current pane with the previous pane.
                    298: .It }
                    299: Swap the current pane with the next pane.
                    300: .It ~
                    301: Show previous messages from
                    302: .Nm ,
                    303: if any.
                    304: .It Page Up
                    305: Enter copy mode and scroll one page up.
                    306: .It Up, Down
                    307: .It Left, Right
                    308: Change to the pane above, below, to the left, or to the right of the current
                    309: pane.
                    310: .It M-1 to M-5
                    311: Arrange panes in one of the five preset layouts: even-horizontal,
                    312: even-vertical, main-horizontal, main-vertical, or tiled.
                    313: .It M-n
                    314: Move to the next window with a bell or activity marker.
                    315: .It M-o
                    316: Rotate the panes in the current window backwards.
                    317: .It M-p
                    318: Move to the previous window with a bell or activity marker.
                    319: .It C-Up, C-Down
                    320: .It C-Left, C-Right
                    321: Resize the current pane in steps of one cell.
                    322: .It M-Up, M-Down
                    323: .It M-Left, M-Right
                    324: Resize the current pane in steps of five cells.
1.64      nicm      325: .El
                    326: .Pp
                    327: Key bindings may be changed with the
                    328: .Ic bind-key
                    329: and
                    330: .Ic unbind-key
                    331: commands.
1.57      jmc       332: .Sh COMMANDS
                    333: This section contains a list of the commands supported by
                    334: .Nm .
                    335: Most commands accept the optional
                    336: .Fl t
                    337: argument with one of
                    338: .Ar target-client ,
                    339: .Ar target-session
                    340: .Ar target-window ,
                    341: or
                    342: .Ar target-pane .
                    343: These specify the client, session, window or pane which a command should affect.
                    344: .Ar target-client
                    345: is the name of the
                    346: .Xr pty 4
                    347: file to which the client is connected, for example either of
                    348: .Pa /dev/ttyp1
                    349: or
                    350: .Pa ttyp1
                    351: for the client attached to
                    352: .Pa /dev/ttyp1 .
                    353: If no client is specified, the current client is chosen, if possible, or an
                    354: error is reported.
                    355: Clients may be listed with the
                    356: .Ic list-clients
                    357: command.
1.1       nicm      358: .Pp
1.57      jmc       359: .Ar target-session
                    360: is either the name of a session (as listed by the
                    361: .Ic list-sessions
                    362: command) or the name of a client with the same syntax as
                    363: .Ar target-client ,
                    364: in which case the session attached to the client is used.
                    365: When looking for the session name,
                    366: .Nm
                    367: initially searches for an exact match; if none is found, the session names
                    368: are checked for any for which
                    369: .Ar target-session
                    370: is a prefix or for which it matches as an
                    371: .Xr fnmatch 3
                    372: pattern.
                    373: If a single match is found, it is used as the target session; multiple matches
                    374: produce an error.
                    375: If a session is omitted, the current session is used if available; if no
1.117     nicm      376: current session is available, the most recently used is chosen.
1.1       nicm      377: .Pp
1.57      jmc       378: .Ar target-window
                    379: specifies a window in the form
                    380: .Em session Ns \&: Ns Em window .
                    381: .Em session
                    382: follows the same rules as for
                    383: .Ar target-session ,
                    384: and
                    385: .Em window
                    386: is looked for in order: as a window index, for example mysession:1; as an exact
                    387: window name, such as mysession:mywindow; then as an
                    388: .Xr fnmatch 3
                    389: pattern or the start of a window name, such as mysession:mywin* or
                    390: mysession:mywin.
                    391: An empty window name specifies the next unused index if appropriate (for
                    392: example the
                    393: .Ic new-window
                    394: and
                    395: .Ic link-window
                    396: commands)
                    397: otherwise the current window in
                    398: .Em session
                    399: is chosen.
1.140     nicm      400: The special character
                    401: .Ql \&!
                    402: uses the last (previously current) window, or
                    403: .Ql +
                    404: and
                    405: .Ql -
                    406: are the next window or the previous window by number.
1.57      jmc       407: When the argument does not contain a colon,
                    408: .Nm
                    409: first attempts to parse it as window; if that fails, an attempt is made to
                    410: match a session.
1.1       nicm      411: .Pp
1.57      jmc       412: .Ar target-pane
                    413: takes a similar form to
                    414: .Ar target-window
                    415: but with the optional addition of a period followed by a pane index, for
                    416: example: mysession:mywindow.1.
                    417: If the pane index is omitted, the currently active pane in the specified
                    418: window is used.
                    419: If neither a colon nor period appears,
1.13      nicm      420: .Nm
1.57      jmc       421: first attempts to use the argument as a pane index; if that fails, it is looked
                    422: up as for
                    423: .Ar target-window .
1.156     nicm      424: A
                    425: .Ql +
                    426: or
                    427: .Ql -
                    428: indicate the next or previous pane index, respectively.
1.132     nicm      429: One of the strings
                    430: .Em top ,
                    431: .Em bottom ,
                    432: .Em left ,
                    433: .Em right ,
                    434: .Em top-left ,
                    435: .Em top-right ,
                    436: .Em bottom-left or
                    437: .Em bottom-right
                    438: may be used instead of a pane index.
1.177     nicm      439: .Pp
                    440: The special characters
                    441: .Ql +
                    442: and
                    443: .Ql -
                    444: may be followed by an offset, for example:
                    445: .Bd -literal -offset indent
                    446: select-window -t:+2
                    447: .Ed
                    448: .Pp
                    449: When dealing with a session that doesn't contain sequential window indexes,
                    450: they will be correctly skipped.
1.15      jmc       451: .Pp
1.153     nicm      452: .Ar shell-command
                    453: arguments are
                    454: .Xr sh 1
                    455: commands.
                    456: These must be passed as a single item, which typically means quoting them, for
                    457: example:
                    458: .Bd -literal -offset indent
                    459: new-window 'vi /etc/passwd'
                    460: .Ed
                    461: .Pp
                    462: .Ar command
                    463: .Op Ar arguments
                    464: refers to a
                    465: .Nm
                    466: command, passed with the command and arguments separately, for example:
                    467: .Bd -literal -offset indent
                    468: bind-key F1 set-window-option force-width 81
                    469: .Ed
                    470: .Pp
                    471: Or if using
                    472: .Xr sh 1 :
                    473: .Bd -literal -offset indent
                    474: $ tmux bind-key F1 set-window-option force-width 81
                    475: .Ed
                    476: .Pp
1.57      jmc       477: Multiple commands may be specified together as part of a
                    478: .Em command sequence .
                    479: Each command should be separated by spaces and a semicolon;
                    480: commands are executed sequentially from left to right.
                    481: A literal semicolon may be included by escaping it with a backslash (for
                    482: example, when specifying a command sequence to
                    483: .Ic bind-key ) .
1.13      nicm      484: .Pp
1.153     nicm      485: Example
                    486: .Nm
                    487: commands include:
1.13      nicm      488: .Bd -literal -offset indent
1.57      jmc       489: refresh-client -t/dev/ttyp2
                    490:
                    491: rename-session -tfirst newname
                    492:
                    493: set-window-option -t:0 monitor-activity on
                    494:
                    495: new-window ; split-window -d
1.13      nicm      496: .Ed
1.153     nicm      497: .Pp
                    498: Or from
                    499: .Xr sh 1 :
                    500: .Bd -literal -offset indent
                    501: $ tmux kill-window -t :1
                    502:
1.159     jmc       503: $ tmux new-window \e; split-window -d
1.153     nicm      504:
1.159     jmc       505: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153     nicm      506: .Ed
1.57      jmc       507: .Sh CLIENTS AND SESSIONS
1.153     nicm      508: The
                    509: .Nm
                    510: server manages clients, sessions, windows and panes.
                    511: Clients are attached to sessions to interact with them, either
                    512: when they are created with the
                    513: .Ic new-session
                    514: command, or later with the
                    515: .Ic attach-session
                    516: command.
1.188     nicm      517: Each session has one or more windows
1.153     nicm      518: .Em linked
                    519: into it.
                    520: Windows may be linked to multiple sessions and are made up of one or
                    521: more panes,
                    522: each of which contains a pseudo terminal.
                    523: Commands for creating, linking and otherwise manipulating windows
                    524: are covered
                    525: in the
                    526: .Sx WINDOWS AND PANES
                    527: section.
                    528: .Pp
                    529: The following commands are available to manage clients and sessions:
1.57      jmc       530: .Bl -tag -width Ds
                    531: .It Xo Ic attach-session
1.148     nicm      532: .Op Fl dr
1.57      jmc       533: .Op Fl t Ar target-session
                    534: .Xc
                    535: .D1 (alias: Ic attach )
                    536: If run from outside
                    537: .Nm ,
                    538: create a new client in the current terminal and attach it to
                    539: .Ar target-session .
                    540: If used from inside, switch the current client.
                    541: If
                    542: .Fl d
                    543: is specified, any other clients attached to the session are detached.
1.148     nicm      544: .Fl r
                    545: signifies the client is read-only (only keys bound to the
                    546: .Ic detach-client
                    547: command have any effect)
1.13      nicm      548: .Pp
1.57      jmc       549: If no server is started,
                    550: .Ic attach-session
                    551: will attempt to start it; this will fail unless sessions are created in the
                    552: configuration file.
                    553: .It Ic detach-client Op Fl t Ar target-client
                    554: .D1 (alias: Ic detach )
                    555: Detach the current client if bound to a key, or the specified client with
                    556: .Fl t .
                    557: .It Ic has-session Op Fl t Ar target-session
                    558: .D1 (alias: Ic has )
                    559: Report an error and exit with 1 if the specified session does not exist.
                    560: If it does exist, exit with 0.
                    561: .It Ic kill-server
                    562: Kill the
1.1       nicm      563: .Nm
1.57      jmc       564: server and clients and destroy all sessions.
                    565: .It Ic kill-session Op Fl t Ar target-session
                    566: Destroy the given session, closing any windows linked to it and no other
                    567: sessions, and detaching all clients attached to it.
                    568: .It Ic list-clients
                    569: .D1 (alias: Ic lsc )
                    570: List all clients attached to the server.
                    571: .It Ic list-commands
                    572: .D1 (alias: Ic lscm )
                    573: List the syntax of all commands supported by
                    574: .Nm .
                    575: .It Ic list-sessions
                    576: .D1 (alias: Ic ls )
                    577: List all sessions managed by the server.
1.175     nicm      578: .It Ic lock-client Op Fl t Ar target-client
                    579: .D1 (alias: Ic lockc )
1.92      nicm      580: Lock
                    581: .Ar target-client ,
                    582: see the
                    583: .Ic lock-server
                    584: command.
1.175     nicm      585: .It Ic lock-session Op Fl t Ar target-session
                    586: .D1 (alias: Ic locks )
1.92      nicm      587: Lock all clients attached to
                    588: .Ar target-session .
1.57      jmc       589: .It Xo Ic new-session
                    590: .Op Fl d
                    591: .Op Fl n Ar window-name
                    592: .Op Fl s Ar session-name
1.101     nicm      593: .Op Fl t Ar target-session
1.210   ! nicm      594: .Op Fl x Ar width
        !           595: .Op Fl y Ar height
1.153     nicm      596: .Op Ar shell-command
1.57      jmc       597: .Xc
                    598: .D1 (alias: Ic new )
                    599: Create a new session with name
                    600: .Ar session-name .
1.153     nicm      601: .Pp
1.57      jmc       602: The new session is attached to the current terminal unless
                    603: .Fl d
                    604: is given.
                    605: .Ar window-name
1.1       nicm      606: and
1.153     nicm      607: .Ar shell-command
                    608: are the name of and shell command to execute in the initial window.
1.210   ! nicm      609: If
        !           610: .Fl d
        !           611: is used,
        !           612: .Fl x
        !           613: and
        !           614: .Fl y
        !           615: specify the size of the initial window (80 by 24 if not given).
1.68      nicm      616: .Pp
                    617: If run from a terminal, any
                    618: .Xr termios 4
                    619: special characters are saved and used for new windows in the new session.
1.101     nicm      620: .Pp
                    621: If
                    622: .Fl t
                    623: is given, the new session is
                    624: .Em grouped
                    625: with
                    626: .Ar target-session .
                    627: This means they share the same set of windows - all windows from
                    628: .Ar target-session
                    629: are linked to the new session and any subsequent new windows or windows being
                    630: closed are applied to both sessions.
                    631: The current and previous window and any session options remain independent and
                    632: either session may be killed without affecting the other.
                    633: Giving
                    634: .Fl n
                    635: or
1.153     nicm      636: .Ar shell-command
1.101     nicm      637: are invalid if
                    638: .Fl t
                    639: is used.
1.57      jmc       640: .It Ic refresh-client Op Fl t Ar target-client
                    641: .D1 (alias: Ic refresh )
                    642: Refresh the current client if bound to a key, or a single client if one is given
                    643: with
                    644: .Fl t .
                    645: .It Xo Ic rename-session
                    646: .Op Fl t Ar target-session
                    647: .Ar new-name
                    648: .Xc
                    649: .D1 (alias: Ic rename )
                    650: Rename the session to
                    651: .Ar new-name .
1.121     nicm      652: .It Xo Ic show-messages
1.120     nicm      653: .Op Fl t Ar target-client
                    654: .Xc
                    655: .D1 (alias: Ic showmsgs )
                    656: Any messages displayed on the status line are saved in a per-client message
                    657: log, up to a maximum of the limit set by the
                    658: .Ar message-limit
                    659: session option for the session attached to that client.
                    660: This command displays the log for
                    661: .Ar target-client .
1.57      jmc       662: .It Ic source-file Ar path
                    663: .D1 (alias: Ic source )
                    664: Execute commands from
                    665: .Ar path .
                    666: .It Ic start-server
                    667: .D1 (alias: Ic start )
                    668: Start the
1.1       nicm      669: .Nm
1.57      jmc       670: server, if not already running, without creating any sessions.
                    671: .It Xo Ic suspend-client
1.202     nicm      672: .Op Fl t Ar target-client
1.57      jmc       673: .Xc
                    674: .D1 (alias: Ic suspendc )
                    675: Suspend a client by sending
                    676: .Dv SIGTSTP
                    677: (tty stop).
                    678: .It Xo Ic switch-client
1.194     nicm      679: .Op Fl lnp
1.57      jmc       680: .Op Fl c Ar target-client
                    681: .Op Fl t Ar target-session
                    682: .Xc
                    683: .D1 (alias: Ic switchc )
                    684: Switch the current session for client
                    685: .Ar target-client
                    686: to
                    687: .Ar target-session .
1.183     nicm      688: If
1.197     jmc       689: .Fl l ,
1.183     nicm      690: .Fl n
                    691: or
                    692: .Fl p
1.194     nicm      693: is used, the client is moved to the last, next or previous session
                    694: respectively.
1.57      jmc       695: .El
                    696: .Sh WINDOWS AND PANES
1.1       nicm      697: A
                    698: .Nm
                    699: window may be in one of several modes.
                    700: The default permits direct access to the terminal attached to the window.
1.164     nicm      701: The other is copy mode, which permits a section of a window or its
                    702: history to be copied to a
1.1       nicm      703: .Em paste buffer
                    704: for later insertion into another window.
                    705: This mode is entered with the
                    706: .Ic copy-mode
                    707: command, bound to
1.113     nicm      708: .Ql \&[
1.1       nicm      709: by default.
1.164     nicm      710: It is also entered when a command that produces output, such as
                    711: .Ic list-keys ,
                    712: is executed from a key binding.
1.1       nicm      713: .Pp
1.6       jmc       714: The keys available depend on whether emacs or vi mode is selected
                    715: (see the
1.1       nicm      716: .Ic mode-keys
                    717: option).
                    718: The following keys are supported as appropriate for the mode:
1.157     nicm      719: .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.1       nicm      720: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27      nicm      721: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.142     nicm      722: .It Li "Bottom of history" Ta "G" Ta "M-<"
1.1       nicm      723: .It Li "Clear selection" Ta "Escape" Ta "C-g"
                    724: .It Li "Copy selection" Ta "Enter" Ta "M-w"
                    725: .It Li "Cursor down" Ta "j" Ta "Down"
1.70      nicm      726: .It Li "Cursor left" Ta "h" Ta "Left"
                    727: .It Li "Cursor right" Ta "l" Ta "Right"
1.116     nicm      728: .It Li "Cursor to bottom line" Ta "L" Ta ""
                    729: .It Li "Cursor to middle line" Ta "M" Ta "M-r"
                    730: .It Li "Cursor to top line" Ta "H" Ta "M-R"
1.70      nicm      731: .It Li "Cursor up" Ta "k" Ta "Up"
1.71      nicm      732: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.70      nicm      733: .It Li "Delete to end of line" Ta "D" Ta "C-k"
1.1       nicm      734: .It Li "End of line" Ta "$" Ta "C-e"
1.142     nicm      735: .It Li "Go to line" Ta ":" Ta "g"
1.116     nicm      736: .It Li "Half page down" Ta "C-d" Ta "M-Down"
                    737: .It Li "Half page up" Ta "C-u" Ta "M-Up"
1.157     nicm      738: .It Li "Jump forward" Ta "f" Ta "f"
                    739: .It Li "Jump backward" Ta "F" Ta "F"
                    740: .It Li "Jump again" Ta ";" Ta ";"
                    741: .It Li "Jump again in reverse" Ta "," Ta ","
1.1       nicm      742: .It Li "Next page" Ta "C-f" Ta "Page down"
1.146     nicm      743: .It Li "Next space" Ta "W" Ta ""
                    744: .It Li "Next space, end of word" Ta "E" Ta ""
1.143     nicm      745: .It Li "Next word" Ta "w" Ta ""
                    746: .It Li "Next word end" Ta "e" Ta "M-f"
1.70      nicm      747: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.116     nicm      748: .It Li "Previous page" Ta "C-b" Ta "Page up"
1.1       nicm      749: .It Li "Previous word" Ta "b" Ta "M-b"
1.146     nicm      750: .It Li "Previous space" Ta "B" Ta ""
1.1       nicm      751: .It Li "Quit mode" Ta "q" Ta "Escape"
1.147     nicm      752: .It Li "Rectangle toggle" Ta "v" Ta "R"
1.141     nicm      753: .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
                    754: .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
1.70      nicm      755: .It Li "Search again" Ta "n" Ta "n"
1.152     nicm      756: .It Li "Search again in reverse" Ta "N" Ta "N"
1.70      nicm      757: .It Li "Search backward" Ta "?" Ta "C-r"
                    758: .It Li "Search forward" Ta "/" Ta "C-s"
                    759: .It Li "Start of line" Ta "0" Ta "C-a"
1.1       nicm      760: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.142     nicm      761: .It Li "Top of history" Ta "g" Ta "M->"
1.80      nicm      762: .It Li "Transpose chars" Ta "" Ta "C-t"
1.1       nicm      763: .El
1.146     nicm      764: .Pp
                    765: The next and previous word keys use space and the
                    766: .Ql - ,
1.154     nicm      767: .Ql _
1.146     nicm      768: and
                    769: .Ql @
1.154     nicm      770: characters as word delimiters by default, but this can be adjusted by
                    771: setting the
                    772: .Em word-separators
                    773: window option.
1.146     nicm      774: Next word moves to the start of the next word, next word end to the end of the
                    775: next word and previous word to the start of the previous word.
                    776: The three next and previous space keys work similarly but use a space alone as
                    777: the word separator.
1.157     nicm      778: .Pp
                    779: The jump commands enable quick movement within a line.
                    780: For instance, typing
                    781: .Ql f
                    782: followed by
                    783: .Ql /
                    784: will move the cursor to the next
                    785: .Ql /
                    786: character on the current line.
                    787: A
                    788: .Ql \&;
                    789: will then jump to the next occurrence.
1.1       nicm      790: .Pp
1.155     nicm      791: Commands in copy mode may be prefaced by an optional repeat count.
                    792: With vi key bindings, a prefix is entered using the number keys; with
                    793: emacs, the Alt (meta) key and a number begins prefix entry.
                    794: For example, to move the cursor forward by ten words, use
                    795: .Ql M-1 0 M-f
                    796: in emacs mode, and
                    797: .Ql 10w
                    798: in vi.
                    799: .Pp
                    800: Mode key bindings are defined in a set of named tables:
1.48      nicm      801: .Em vi-edit
                    802: and
                    803: .Em emacs-edit
                    804: for keys used when line editing at the command prompt;
                    805: .Em vi-choice
                    806: and
                    807: .Em emacs-choice
                    808: for keys used when choosing from lists (such as produced by the
1.144     nicm      809: .Ic choose-window
1.164     nicm      810: command); and
1.48      nicm      811: .Em vi-copy
                    812: and
                    813: .Em emacs-copy
1.97      nicm      814: used in copy mode.
1.48      nicm      815: The tables may be viewed with the
                    816: .Ic list-keys
1.49      nicm      817: command and keys modified or removed with
                    818: .Ic bind-key
                    819: and
                    820: .Ic unbind-key .
1.48      nicm      821: .Pp
1.2       nicm      822: The paste buffer key pastes the first line from the top paste buffer on the
                    823: stack.
1.57      jmc       824: .Pp
1.164     nicm      825: The synopsis for the
                    826: .Ic copy-mode
                    827: command is:
1.57      jmc       828: .Bl -tag -width Ds
                    829: .It Xo Ic copy-mode
                    830: .Op Fl u
1.72      nicm      831: .Op Fl t Ar target-pane
1.57      jmc       832: .Xc
                    833: Enter copy mode.
                    834: The
                    835: .Fl u
                    836: option scrolls one page up.
                    837: .El
1.18      nicm      838: .Pp
1.1       nicm      839: Each window displayed by
                    840: .Nm
                    841: may be split into one or more
                    842: .Em panes ;
                    843: each pane takes up a certain area of the display and is a separate terminal.
                    844: A window may be split into panes using the
                    845: .Ic split-window
                    846: command.
1.38      nicm      847: Windows may be split horizontally (with the
                    848: .Fl h
                    849: flag) or vertically.
                    850: Panes may be resized with the
                    851: .Ic resize-pane
1.1       nicm      852: command (bound to
1.38      nicm      853: .Ql C-up ,
                    854: .Ql C-down
                    855: .Ql C-left
                    856: and
                    857: .Ql C-right
1.1       nicm      858: by default), the current pane may be changed with the
1.156     nicm      859: .Ic select-pane
                    860: command and the
1.1       nicm      861: .Ic rotate-window
                    862: and
                    863: .Ic swap-pane
1.38      nicm      864: commands may be used to swap panes without changing their position.
                    865: Panes are numbered beginning from zero in the order they are created.
                    866: .Pp
                    867: A number of preset
                    868: .Em layouts
                    869: are available.
                    870: These may be selected with the
                    871: .Ic select-layout
                    872: command or cycled with
                    873: .Ic next-layout
                    874: (bound to
1.149     nicm      875: .Ql Space
1.131     nicm      876: by default); once a layout is chosen, panes within it may be moved and resized
                    877: as normal.
1.1       nicm      878: .Pp
                    879: The following layouts are supported:
                    880: .Bl -tag -width Ds
                    881: .It Ic even-horizontal
                    882: Panes are spread out evenly from left to right across the window.
                    883: .It Ic even-vertical
                    884: Panes are spread evenly from top to bottom.
1.2       nicm      885: .It Ic main-horizontal
1.131     nicm      886: A large (main) pane is shown at the top of the window and the remaining panes
                    887: are spread from left to right in the leftover space at the bottom.
1.2       nicm      888: Use the
                    889: .Em main-pane-height
                    890: window option to specify the height of the top pane.
1.1       nicm      891: .It Ic main-vertical
1.2       nicm      892: Similar to
                    893: .Ic main-horizontal
                    894: but the large pane is placed on the left and the others spread from top to
                    895: bottom along the right.
                    896: See the
                    897: .Em main-pane-width
                    898: window option.
1.165     nicm      899: .It Ic tiled
                    900: Panes are spread out as evenly as possible over the window in both rows and
                    901: columns.
1.1       nicm      902: .El
1.8       nicm      903: .Pp
1.181     nicm      904: In addition,
                    905: .Ic select-layout
                    906: may be used to apply a previously used layout - the
                    907: .Ic list-windows
                    908: command displays the layout of each window in a form suitable for use with
                    909: .Ic select-layout .
                    910: For example:
                    911: .Bd -literal -offset indent
                    912: $ tmux list-windows
                    913: 0: ksh [159x48]
                    914:     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                    915: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                    916: .Ed
1.196     nicm      917: .Pp
1.181     nicm      918: .Nm
                    919: automatically adjusts the size of the layout for the current window size.
                    920: Note that a layout cannot be applied to a window with more panes than that
                    921: from which the layout was originally defined.
                    922: .Pp
1.57      jmc       923: Commands related to windows and panes are as follows:
                    924: .Bl -tag -width Ds
                    925: .It Xo Ic break-pane
                    926: .Op Fl d
                    927: .Op Fl t Ar target-pane
                    928: .Xc
                    929: .D1 (alias: Ic breakp )
                    930: Break
                    931: .Ar target-pane
                    932: off from its containing window to make it the only pane in a new window.
                    933: If
                    934: .Fl d
                    935: is given, the new window does not become the current window.
1.128     nicm      936: .It Xo Ic capture-pane
                    937: .Op Fl b Ar buffer-index
                    938: .Op Fl t Ar target-pane
                    939: .Xc
                    940: .D1 (alias: Ic capturep )
                    941: Capture the contents of a pane to the specified buffer, or a new buffer if none
                    942: is specified.
1.76      nicm      943: .It Xo
                    944: .Ic choose-client
                    945: .Op Fl t Ar target-window
                    946: .Op Ar template
                    947: .Xc
                    948: Put a window into client choice mode, allowing a client to be selected
                    949: interactively from a list.
                    950: After a client is chosen,
                    951: .Ql %%
                    952: is replaced by the client
                    953: .Xr pty 4
                    954: path in
                    955: .Ar template
                    956: and the result executed as a command.
                    957: If
                    958: .Ar template
                    959: is not given, "detach-client -t '%%'" is used.
1.57      jmc       960: This command works only from inside
                    961: .Nm .
1.76      nicm      962: .It Xo
                    963: .Ic choose-session
                    964: .Op Fl t Ar target-window
                    965: .Op Ar template
                    966: .Xc
                    967: Put a window into session choice mode, where a session may be selected
                    968: interactively from a list.
                    969: When one is chosen,
                    970: .Ql %%
                    971: is replaced by the session name in
                    972: .Ar template
                    973: and the result executed as a command.
                    974: If
                    975: .Ar template
                    976: is not given, "switch-client -t '%%'" is used.
                    977: This command works only from inside
                    978: .Nm .
                    979: .It Xo
                    980: .Ic choose-window
                    981: .Op Fl t Ar target-window
                    982: .Op Ar template
                    983: .Xc
                    984: Put a window into window choice mode, where a window may be chosen
                    985: interactively from a list.
                    986: After a window is selected,
                    987: .Ql %%
                    988: is replaced by the session name and window index in
                    989: .Ar template
                    990: and the result executed as a command.
                    991: If
                    992: .Ar template
                    993: is not given, "select-window -t '%%'" is used.
1.57      jmc       994: This command works only from inside
                    995: .Nm .
1.78      nicm      996: .It Ic display-panes Op Fl t Ar target-client
                    997: .D1 (alias: Ic displayp)
                    998: Display a visible indicator of each pane shown by
                    999: .Ar target-client .
                   1000: See the
1.145     nicm     1001: .Ic display-panes-time ,
                   1002: .Ic display-panes-colour ,
1.78      nicm     1003: and
1.145     nicm     1004: .Ic display-panes-active-colour
1.78      nicm     1005: session options.
1.84      nicm     1006: While the indicator is on screen, a pane may be selected with the
                   1007: .Ql 0
                   1008: to
                   1009: .Ql 9
                   1010: keys.
1.57      jmc      1011: .It Xo Ic find-window
                   1012: .Op Fl t Ar target-window
                   1013: .Ar match-string
                   1014: .Xc
                   1015: .D1 (alias: Ic findw )
                   1016: Search for the
                   1017: .Xr fnmatch 3
                   1018: pattern
                   1019: .Ar match-string
                   1020: in window names, titles, and visible content (but not history).
                   1021: If only one window is matched, it'll be automatically selected, otherwise a
                   1022: choice list is shown.
                   1023: This command only works from inside
1.1       nicm     1024: .Nm .
1.137     nicm     1025: .It Xo Ic join-pane
                   1026: .Op Fl dhv
                   1027: .Oo Fl l
                   1028: .Ar size |
                   1029: .Fl p Ar percentage Oc
                   1030: .Op Fl s Ar src-pane
                   1031: .Op Fl t Ar dst-pane
                   1032: .Xc
                   1033: .D1 (alias: Ic joinp )
                   1034: Like
                   1035: .Ic split-window ,
                   1036: but instead of splitting
                   1037: .Ar dst-pane
                   1038: and creating a new pane, split it and move
                   1039: .Ar src-pane
                   1040: into the space.
                   1041: This can be used to reverse
                   1042: .Ic break-pane .
1.112     nicm     1043: .It Xo Ic kill-pane
                   1044: .Op Fl a
                   1045: .Op Fl t Ar target-pane
                   1046: .Xc
1.57      jmc      1047: .D1 (alias: Ic killp )
                   1048: Destroy the given pane.
                   1049: If no panes remain in the containing window, it is also destroyed.
1.112     nicm     1050: The
                   1051: .Fl a
                   1052: option kills all but the pane given with
                   1053: .Fl t .
1.57      jmc      1054: .It Ic kill-window Op Fl t Ar target-window
                   1055: .D1 (alias: Ic killw )
                   1056: Kill the current window or the window at
                   1057: .Ar target-window ,
1.1       nicm     1058: removing it from any sessions to which it is linked.
1.187     nicm     1059: .It Ic last-pane Op Fl t Ar target-window
                   1060: .D1 (alias: Ic lastp )
                   1061: Select the last (previously selected) pane.
1.56      jmc      1062: .It Ic last-window Op Fl t Ar target-session
1.1       nicm     1063: .D1 (alias: Ic last )
                   1064: Select the last (previously selected) window.
                   1065: If no
                   1066: .Ar target-session
                   1067: is specified, select the last window of the current session.
                   1068: .It Xo Ic link-window
                   1069: .Op Fl dk
                   1070: .Op Fl s Ar src-window
                   1071: .Op Fl t Ar dst-window
                   1072: .Xc
                   1073: .D1 (alias: Ic linkw )
                   1074: Link the window at
                   1075: .Ar src-window
                   1076: to the specified
                   1077: .Ar dst-window .
                   1078: If
                   1079: .Ar dst-window
                   1080: is specified and no such window exists, the
                   1081: .Ar src-window
                   1082: is linked there.
                   1083: If
                   1084: .Fl k
                   1085: is given and
                   1086: .Ar dst-window
                   1087: exists, it is killed, otherwise an error is generated.
                   1088: If
                   1089: .Fl d
                   1090: is given, the newly linked window is not selected.
1.104     nicm     1091: .It Ic list-panes Op Fl t Ar target-window
                   1092: .D1 (alias: Ic lsp )
                   1093: List the panes in the current window or in
                   1094: .Ar target-window .
1.56      jmc      1095: .It Ic list-windows Op Fl t Ar target-session
1.1       nicm     1096: .D1 (alias: Ic lsw )
                   1097: List windows in the current session or in
                   1098: .Ar target-session .
                   1099: .It Xo Ic move-window
1.175     nicm     1100: .Op Fl dk
1.1       nicm     1101: .Op Fl s Ar src-window
                   1102: .Op Fl t Ar dst-window
                   1103: .Xc
                   1104: .D1 (alias: Ic movew )
                   1105: This is similar to
                   1106: .Ic link-window ,
                   1107: except the window at
                   1108: .Ar src-window
                   1109: is moved to
                   1110: .Ar dst-window .
                   1111: .It Xo Ic new-window
1.201     nicm     1112: .Op Fl adkP
1.1       nicm     1113: .Op Fl n Ar window-name
                   1114: .Op Fl t Ar target-window
1.153     nicm     1115: .Op Ar shell-command
1.1       nicm     1116: .Xc
                   1117: .D1 (alias: Ic neww )
                   1118: Create a new window.
1.160     nicm     1119: With
                   1120: .Fl a ,
                   1121: the new window is inserted at the next index up from the specified
                   1122: .Ar target-window ,
                   1123: moving windows up if necessary,
                   1124: otherwise
                   1125: .Ar target-window
                   1126: is the new window location.
                   1127: .Pp
1.1       nicm     1128: If
                   1129: .Fl d
                   1130: is given, the session does not make the new window the current window.
                   1131: .Ar target-window
1.28      nicm     1132: represents the window to be created; if the target already exists an error is
                   1133: shown, unless the
                   1134: .Fl k
                   1135: flag is used, in which case it is destroyed.
1.153     nicm     1136: .Ar shell-command
1.1       nicm     1137: is the command to execute.
                   1138: If
1.153     nicm     1139: .Ar shell-command
                   1140: is not specified, the value of the
                   1141: .Ic default-command
                   1142: option is used.
                   1143: .Pp
                   1144: When the shell command completes, the window closes.
                   1145: See the
                   1146: .Ic remain-on-exit
                   1147: option to change this behaviour.
1.1       nicm     1148: .Pp
                   1149: The
                   1150: .Ev TERM
                   1151: environment variable must be set to
                   1152: .Dq screen
                   1153: for all programs running
                   1154: .Em inside
                   1155: .Nm .
                   1156: New windows will automatically have
                   1157: .Dq TERM=screen
                   1158: added to their environment, but care must be taken not to reset this in shell
                   1159: start-up files.
1.201     nicm     1160: .Pp
                   1161: The
                   1162: .Fl P
                   1163: option prints the location of the new window after it has been created.
1.56      jmc      1164: .It Ic next-layout Op Fl t Ar target-window
1.1       nicm     1165: .D1 (alias: Ic nextl )
                   1166: Move a window to the next layout and rearrange the panes to fit.
                   1167: .It Xo Ic next-window
1.9       nicm     1168: .Op Fl a
1.1       nicm     1169: .Op Fl t Ar target-session
                   1170: .Xc
                   1171: .D1 (alias: Ic next )
                   1172: Move to the next window in the session.
1.9       nicm     1173: If
1.12      jmc      1174: .Fl a
1.9       nicm     1175: is used, move to the next window with a bell, activity or content alert.
1.107     nicm     1176: .It Xo Ic pipe-pane
                   1177: .Op Fl o
                   1178: .Op Fl t Ar target-pane
1.153     nicm     1179: .Op Ar shell-command
1.107     nicm     1180: .Xc
                   1181: .D1 (alias: Ic pipep )
                   1182: Pipe any output sent by the program in
                   1183: .Ar target-pane
                   1184: to a shell command.
                   1185: A pane may only be piped to one command at a time, any existing pipe is
                   1186: closed before
1.153     nicm     1187: .Ar shell-command
1.107     nicm     1188: is executed.
1.174     nicm     1189: The
                   1190: .Ar shell-command
                   1191: string may contain the special character sequences supported by the
                   1192: .Ic status-left
                   1193: command.
1.107     nicm     1194: If no
1.153     nicm     1195: .Ar shell-command
1.107     nicm     1196: is given, the current pipe (if any) is closed.
                   1197: .Pp
                   1198: The
                   1199: .Fl o
                   1200: option only opens a new pipe if no previous pipe exists, allowing a pipe to
                   1201: be toggled with a single key, for example:
                   1202: .Bd -literal -offset indent
1.174     nicm     1203: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107     nicm     1204: .Ed
1.176     nicm     1205: .It Xo Ic previous-layout
                   1206: .Op Fl t Ar target-window
                   1207: .Xc
                   1208: .D1 (alias: Ic prevl )
                   1209: Move to the previous layout in the session.
1.1       nicm     1210: .It Xo Ic previous-window
1.9       nicm     1211: .Op Fl a
1.1       nicm     1212: .Op Fl t Ar target-session
                   1213: .Xc
                   1214: .D1 (alias: Ic prev )
                   1215: Move to the previous window in the session.
1.9       nicm     1216: With
                   1217: .Fl a ,
                   1218: move to the previous window with a bell, activity or content alert.
1.1       nicm     1219: .It Xo Ic rename-window
                   1220: .Op Fl t Ar target-window
                   1221: .Ar new-name
                   1222: .Xc
                   1223: .D1 (alias: Ic renamew )
                   1224: Rename the current window, or the window at
                   1225: .Ar target-window
                   1226: if specified, to
                   1227: .Ar new-name .
                   1228: .It Xo Ic resize-pane
1.39      jmc      1229: .Op Fl DLRU
1.52      nicm     1230: .Op Fl t Ar target-pane
1.1       nicm     1231: .Op Ar adjustment
                   1232: .Xc
                   1233: .D1 (alias: Ic resizep )
1.57      jmc      1234: Resize a pane, upward with
                   1235: .Fl U
                   1236: (the default), downward with
                   1237: .Fl D ,
                   1238: to the left with
                   1239: .Fl L
                   1240: and to the right with
                   1241: .Fl R .
                   1242: The
                   1243: .Ar adjustment
                   1244: is given in lines or cells (the default is 1).
                   1245: .It Xo Ic respawn-window
                   1246: .Op Fl k
                   1247: .Op Fl t Ar target-window
1.153     nicm     1248: .Op Ar shell-command
1.57      jmc      1249: .Xc
                   1250: .D1 (alias: Ic respawnw )
1.153     nicm     1251: Reactivate a window in which the command has exited (see the
1.57      jmc      1252: .Ic remain-on-exit
                   1253: window option).
                   1254: If
1.153     nicm     1255: .Ar shell-command
1.57      jmc      1256: is not given, the command used when the window was created is executed.
                   1257: The window must be already inactive, unless
                   1258: .Fl k
                   1259: is given, in which case any existing command is killed.
                   1260: .It Xo Ic rotate-window
                   1261: .Op Fl DU
                   1262: .Op Fl t Ar target-window
                   1263: .Xc
                   1264: .D1 (alias: Ic rotatew )
                   1265: Rotate the positions of the panes within a window, either upward (numerically
                   1266: lower) with
                   1267: .Fl U
                   1268: or downward (numerically higher).
                   1269: .It Xo Ic select-layout
1.204     nicm     1270: .Op Fl np
1.57      jmc      1271: .Op Fl t Ar target-window
                   1272: .Op Ar layout-name
                   1273: .Xc
1.176     nicm     1274: .D1 (alias: Ic selectl )
1.57      jmc      1275: Choose a specific layout for a window.
                   1276: If
                   1277: .Ar layout-name
1.181     nicm     1278: is not given, the last preset layout used (if any) is reapplied.
1.204     nicm     1279: .Fl n
                   1280: and
                   1281: .Fl p
                   1282: are equivalent to the
                   1283: .Ic next-layout
                   1284: and
                   1285: .Ic previous-layout
                   1286: commands.
1.156     nicm     1287: .It Xo Ic select-pane
1.204     nicm     1288: .Op Fl lDLRU
1.156     nicm     1289: .Op Fl t Ar target-pane
                   1290: .Xc
1.57      jmc      1291: .D1 (alias: Ic selectp )
                   1292: Make pane
                   1293: .Ar target-pane
                   1294: the active pane in window
                   1295: .Ar target-window .
1.156     nicm     1296: If one of
                   1297: .Fl D ,
                   1298: .Fl L ,
                   1299: .Fl R ,
                   1300: or
                   1301: .Fl U
                   1302: is used, respectively the pane below, to the left, to the right, or above the
                   1303: target pane is used.
1.204     nicm     1304: .Fl l
                   1305: is the same as using the
                   1306: .Ic last-pane
                   1307: command.
                   1308: .It Xo Ic select-window
                   1309: .Op Fl lnp
                   1310: .Op Fl t Ar target-window
                   1311: .Xc
1.57      jmc      1312: .D1 (alias: Ic selectw )
                   1313: Select the window at
                   1314: .Ar target-window .
1.204     nicm     1315: .Fl l ,
                   1316: .Fl n
                   1317: and
                   1318: .Fl p
                   1319: are equivalent to the
                   1320: .Ic last-window ,
                   1321: .Ic next-window
                   1322: and
                   1323: .Ic previous-window
                   1324: commands.
1.57      jmc      1325: .It Xo Ic split-window
1.201     nicm     1326: .Op Fl dhvP
1.57      jmc      1327: .Oo Fl l
                   1328: .Ar size |
                   1329: .Fl p Ar percentage Oc
1.136     nicm     1330: .Op Fl t Ar target-pane
1.153     nicm     1331: .Op Ar shell-command
1.57      jmc      1332: .Xc
1.176     nicm     1333: .D1 (alias: Ic splitw )
1.136     nicm     1334: Create a new pane by splitting
                   1335: .Ar target-pane :
1.57      jmc      1336: .Fl h
                   1337: does a horizontal split and
                   1338: .Fl v
                   1339: a vertical split; if neither is specified,
                   1340: .Fl v
                   1341: is assumed.
                   1342: The
                   1343: .Fl l
                   1344: and
                   1345: .Fl p
1.136     nicm     1346: options specify the size of the new pane in lines (for vertical split) or in
1.57      jmc      1347: cells (for horizontal split), or as a percentage, respectively.
1.136     nicm     1348: All other options have the same meaning as for the
1.57      jmc      1349: .Ic new-window
                   1350: command.
                   1351: .It Xo Ic swap-pane
                   1352: .Op Fl dDU
                   1353: .Op Fl s Ar src-pane
                   1354: .Op Fl t Ar dst-pane
                   1355: .Xc
                   1356: .D1 (alias: Ic swapp )
                   1357: Swap two panes.
                   1358: If
                   1359: .Fl U
                   1360: is used and no source pane is specified with
                   1361: .Fl s ,
                   1362: .Ar dst-pane
                   1363: is swapped with the previous pane (before it numerically);
                   1364: .Fl D
                   1365: swaps with the next pane (after it numerically).
1.138     nicm     1366: .Fl d
                   1367: instructs
                   1368: .Nm
                   1369: not to change the active pane.
1.57      jmc      1370: .It Xo Ic swap-window
                   1371: .Op Fl d
                   1372: .Op Fl s Ar src-window
                   1373: .Op Fl t Ar dst-window
                   1374: .Xc
                   1375: .D1 (alias: Ic swapw )
                   1376: This is similar to
                   1377: .Ic link-window ,
                   1378: except the source and destination windows are swapped.
                   1379: It is an error if no window exists at
                   1380: .Ar src-window .
                   1381: .It Xo Ic unlink-window
1.1       nicm     1382: .Op Fl k
                   1383: .Op Fl t Ar target-window
                   1384: .Xc
1.57      jmc      1385: .D1 (alias: Ic unlinkw )
                   1386: Unlink
                   1387: .Ar target-window .
                   1388: Unless
                   1389: .Fl k
                   1390: is given, a window may be unlinked only if it is linked to multiple sessions -
                   1391: windows may not be linked to no sessions;
                   1392: if
1.1       nicm     1393: .Fl k
1.57      jmc      1394: is specified and the window is linked to only one session, it is unlinked and
                   1395: destroyed.
                   1396: .El
                   1397: .Sh KEY BINDINGS
1.93      nicm     1398: .Nm
                   1399: allows a command to be bound to most keys, with or without a prefix key.
                   1400: When specifying keys, most represent themselves (for example
                   1401: .Ql A
                   1402: to
1.95      jmc      1403: .Ql Z ) .
1.93      nicm     1404: Ctrl keys may be prefixed with
                   1405: .Ql C-
                   1406: or
1.95      jmc      1407: .Ql ^ ,
                   1408: and Alt (meta) with
1.93      nicm     1409: .Ql M- .
                   1410: In addition, the following special key names are accepted:
1.126     nicm     1411: .Em Up ,
                   1412: .Em Down ,
                   1413: .Em Left ,
                   1414: .Em Right ,
1.93      nicm     1415: .Em BSpace ,
                   1416: .Em BTab ,
                   1417: .Em DC
                   1418: (Delete),
                   1419: .Em End ,
                   1420: .Em Enter ,
                   1421: .Em Escape ,
                   1422: .Em F1
                   1423: to
                   1424: .Em F20 ,
                   1425: .Em Home ,
                   1426: .Em IC
                   1427: (Insert),
                   1428: .Em NPage
                   1429: (Page Up),
                   1430: .Em PPage
                   1431: (Page Down),
                   1432: .Em Space ,
                   1433: and
                   1434: .Em Tab .
                   1435: Note that to bind the
                   1436: .Ql \&"
                   1437: or
                   1438: .Ql '
                   1439: keys, quotation marks are necessary, for example:
                   1440: .Bd -literal -offset indent
                   1441: bind-key '"' split-window
1.167     nicm     1442: bind-key "'" new-window
1.93      nicm     1443: .Ed
                   1444: .Pp
1.57      jmc      1445: Commands related to key bindings are as follows:
                   1446: .Bl -tag -width Ds
                   1447: .It Xo Ic bind-key
                   1448: .Op Fl cnr
                   1449: .Op Fl t Ar key-table
                   1450: .Ar key Ar command Op Ar arguments
1.1       nicm     1451: .Xc
1.57      jmc      1452: .D1 (alias: Ic bind )
                   1453: Bind key
                   1454: .Ar key
                   1455: to
                   1456: .Ar command .
                   1457: By default (without
                   1458: .Fl t )
                   1459: the primary key bindings are modified (those normally activated with the prefix
                   1460: key); in this case, if
                   1461: .Fl n
                   1462: is specified, it is not necessary to use the prefix key,
                   1463: .Ar command
                   1464: is bound to
                   1465: .Ar key
                   1466: alone.
1.1       nicm     1467: The
1.57      jmc      1468: .Fl r
                   1469: flag indicates this key may repeat, see the
                   1470: .Ic repeat-time
                   1471: option.
                   1472: .Pp
                   1473: If
                   1474: .Fl t
                   1475: is present,
                   1476: .Ar key
                   1477: is bound in
                   1478: .Ar key-table :
                   1479: the binding for command mode with
                   1480: .Fl c
                   1481: or for normal mode without.
                   1482: To view the default bindings and possible commands, see the
                   1483: .Ic list-keys
                   1484: command.
                   1485: .It Ic list-keys Op Fl t Ar key-table
                   1486: .D1 (alias: Ic lsk )
                   1487: List all key bindings.
                   1488: Without
                   1489: .Fl t
                   1490: the primary key bindings - those executed when preceded by the prefix key -
                   1491: are printed.
                   1492: Keys bound without the prefix key (see
                   1493: .Ic bind-key
                   1494: .Fl n )
1.119     nicm     1495: are marked with
                   1496: .Ql (no prefix) .
1.57      jmc      1497: .Pp
                   1498: With
                   1499: .Fl t ,
                   1500: the key bindings in
                   1501: .Ar key-table
                   1502: are listed; this may be one of:
                   1503: .Em vi-edit ,
                   1504: .Em emacs-edit ,
                   1505: .Em vi-choice ,
                   1506: .Em emacs-choice ,
                   1507: .Em vi-copy
                   1508: or
                   1509: .Em emacs-copy .
                   1510: .It Xo Ic send-keys
1.72      nicm     1511: .Op Fl t Ar target-pane
1.57      jmc      1512: .Ar key Ar ...
1.1       nicm     1513: .Xc
1.57      jmc      1514: .D1 (alias: Ic send )
                   1515: Send a key or keys to a window.
                   1516: Each argument
                   1517: .Ar key
                   1518: is the name of the key (such as
                   1519: .Ql C-a
                   1520: or
                   1521: .Ql npage
                   1522: ) to send; if the string is not recognised as a key, it is sent as a series of
                   1523: characters.
                   1524: All arguments are sent sequentially from first to last.
1.72      nicm     1525: .It Ic send-prefix Op Fl t Ar target-pane
1.57      jmc      1526: Send the prefix key to a window as if it was pressed.
1.89      nicm     1527: If multiple prefix keys are configured, only the first is sent.
1.57      jmc      1528: .It Xo Ic unbind-key
1.189     nicm     1529: .Op Fl acn
1.57      jmc      1530: .Op Fl t Ar key-table
                   1531: .Ar key
1.2       nicm     1532: .Xc
1.57      jmc      1533: .D1 (alias: Ic unbind )
                   1534: Unbind the command bound to
                   1535: .Ar key .
                   1536: Without
                   1537: .Fl t
                   1538: the primary key bindings are modified; in this case, if
                   1539: .Fl n
                   1540: is specified, the command bound to
                   1541: .Ar key
                   1542: without a prefix (if any) is removed.
1.189     nicm     1543: If
                   1544: .Fl a
                   1545: is present, all key bindings are removed.
1.57      jmc      1546: .Pp
1.47      nicm     1547: If
1.57      jmc      1548: .Fl t
                   1549: is present,
                   1550: .Ar key
                   1551: in
                   1552: .Ar key-table
                   1553: is unbound: the binding for command mode with
                   1554: .Fl c
                   1555: or for normal mode without.
                   1556: .El
                   1557: .Sh OPTIONS
                   1558: The appearance and behaviour of
                   1559: .Nm
                   1560: may be modified by changing the value of various options.
1.133     nicm     1561: There are three types of option:
                   1562: .Em server options ,
1.57      jmc      1563: .Em session options
                   1564: and
                   1565: .Em window options .
                   1566: .Pp
1.133     nicm     1567: The
                   1568: .Nm
                   1569: server has a set of global options which do not apply to any particular
                   1570: window or session.
                   1571: These are altered with the
                   1572: .Ic set-option
                   1573: .Fl s
                   1574: command, or displayed with the
                   1575: .Ic show-options
                   1576: .Fl s
                   1577: command.
                   1578: .Pp
                   1579: In addition, each individual session may have a set of session options, and
                   1580: there is a separate set of global session options.
1.57      jmc      1581: Sessions which do not have a particular option configured inherit the value
                   1582: from the global session options.
                   1583: Session options are set or unset with the
                   1584: .Ic set-option
                   1585: command and may be listed with the
                   1586: .Ic show-options
                   1587: command.
1.133     nicm     1588: The available server and session options are listed under the
1.57      jmc      1589: .Ic set-option
                   1590: command.
                   1591: .Pp
                   1592: Similarly, a set of window options is attached to each window, and there is
                   1593: a set of global window options from which any unset options are inherited.
                   1594: Window options are altered with the
                   1595: .Ic set-window-option
                   1596: command and can be listed with the
                   1597: .Ic show-window-options
                   1598: command.
                   1599: All window options are documented with the
                   1600: .Ic set-window-option
                   1601: command.
                   1602: .Pp
                   1603: Commands which set options are as follows:
                   1604: .Bl -tag -width Ds
1.1       nicm     1605: .It Xo Ic set-option
1.133     nicm     1606: .Op Fl agsuw
1.129     nicm     1607: .Op Fl t Ar target-session | Ar target-window
1.1       nicm     1608: .Ar option Ar value
                   1609: .Xc
                   1610: .D1 (alias: Ic set )
1.133     nicm     1611: Set a window option with
                   1612: .Fl w
                   1613: (equivalent to the
                   1614: .Ic set-window-option
                   1615: command),
                   1616: a server option with
                   1617: .Fl s ,
                   1618: otherwise a session option.
                   1619: .Pp
                   1620: If
                   1621: .Fl g
                   1622: is specified, the global session or window option is set.
1.58      nicm     1623: With
                   1624: .Fl a ,
                   1625: and if the option expects a string,
                   1626: .Ar value
                   1627: is appended to the existing setting.
1.1       nicm     1628: The
                   1629: .Fl u
                   1630: flag unsets an option, so a session inherits the option from the global
1.133     nicm     1631: options.
                   1632: It is not possible to unset a global option.
1.1       nicm     1633: .Pp
1.133     nicm     1634: Available window options are listed under
                   1635: .Ic set-window-option .
                   1636: .Pp
                   1637: Available server options are:
                   1638: .Bl -tag -width Ds
1.198     nicm     1639: .It Ic buffer-limit Ar number
                   1640: Set the number of buffers; as new buffers are added to the top of the stack,
                   1641: old ones are removed from the bottom if necessary to maintain this maximum
                   1642: length.
1.206     nicm     1643: .It Ic escape-time Ar time
1.134     nicm     1644: Set the time in milliseconds for which
                   1645: .Nm
                   1646: waits after an escape is input to determine if it is part of a function or meta
                   1647: key sequences.
                   1648: The default is 500 milliseconds.
1.206     nicm     1649: .It Xo Ic exit-unattached
                   1650: .Op Ic on | off
                   1651: .Xc
1.207     nicm     1652: If enabled, the server will exit when there are no attached clients.
1.206     nicm     1653: .It Xo Ic quiet
                   1654: .Op Ic on | off
                   1655: .Xc
1.134     nicm     1656: Enable or disable the display of various informational messages (see also the
1.133     nicm     1657: .Fl q
                   1658: command line flag).
                   1659: .El
1.129     nicm     1660: .Pp
1.18      nicm     1661: Available session options are:
1.1       nicm     1662: .Bl -tag -width Ds
1.69      nicm     1663: .It Ic base-index Ar index
                   1664: Set the base index from which an unused index should be searched when a new
                   1665: window is created.
                   1666: The default is zero.
1.1       nicm     1667: .It Xo Ic bell-action
1.56      jmc      1668: .Op Ic any | none | current
1.1       nicm     1669: .Xc
                   1670: Set action on window bell.
                   1671: .Ic any
                   1672: means a bell in any window linked to a session causes a bell in the current
                   1673: window of that session,
                   1674: .Ic none
                   1675: means all bells are ignored and
                   1676: .Ic current
                   1677: means only bell in windows other than the current window are ignored.
1.153     nicm     1678: .It Ic default-command Ar shell-command
1.1       nicm     1679: Set the command used for new windows (if not specified when the window is
                   1680: created) to
1.153     nicm     1681: .Ar shell-command ,
1.79      nicm     1682: which may be any
                   1683: .Xr sh 1
                   1684: command.
1.19      nicm     1685: The default is an empty string, which instructs
                   1686: .Nm
1.79      nicm     1687: to create a login shell using the value of the
                   1688: .Ic default-shell
                   1689: option.
1.196     nicm     1690: .It Ic default-path Ar path
                   1691: Set the default working directory for processes created from keys, or
                   1692: interactively from the prompt.
                   1693: The default is empty, which means to use the working directory of the shell
                   1694: from which the server was started if it is available or the user's home if not.
1.79      nicm     1695: .It Ic default-shell Ar path
                   1696: Specify the default shell.
                   1697: This is used as the login shell for new windows when the
                   1698: .Ic default-command
                   1699: option is set to empty, and must be the full path of the executable.
                   1700: When started
                   1701: .Nm
                   1702: tries to set a default value from the first suitable of the
1.19      nicm     1703: .Ev SHELL
1.79      nicm     1704: environment variable, the shell returned by
                   1705: .Xr getpwuid 3 ,
                   1706: or
                   1707: .Pa /bin/sh .
                   1708: This option should be configured when
                   1709: .Nm
                   1710: is used as a login shell.
1.22      nicm     1711: .It Ic default-terminal Ar terminal
                   1712: Set the default terminal for new windows created in this session - the
                   1713: default value of the
                   1714: .Ev TERM
                   1715: environment variable.
                   1716: For
                   1717: .Nm
                   1718: to work correctly, this
                   1719: .Em must
                   1720: be set to
                   1721: .Ql screen
                   1722: or a derivative of it.
1.206     nicm     1723: .It Xo Ic destroy-unattached
                   1724: .Op Ic on | off
                   1725: .Xc
1.185     nicm     1726: If enabled and the session is no longer attached to any clients, it is
                   1727: destroyed.
1.206     nicm     1728: .It Xo Ic detach-on-destroy
                   1729: .Op Ic on | off
                   1730: .Xc
1.184     nicm     1731: If on (the default), the client is detached when the session it is attached to
                   1732: is destroyed.
                   1733: If off, the client is switched to the most recently active of the remaining
                   1734: sessions.
1.145     nicm     1735: .It Ic display-panes-active-colour Ar colour
                   1736: Set the colour used by the
                   1737: .Ic display-panes
                   1738: command to show the indicator for the active pane.
1.78      nicm     1739: .It Ic display-panes-colour Ar colour
1.145     nicm     1740: Set the colour used by the
1.78      nicm     1741: .Ic display-panes
1.145     nicm     1742: command to show the indicators for inactive panes.
1.78      nicm     1743: .It Ic display-panes-time Ar time
                   1744: Set the time in milliseconds for which the indicators shown by the
                   1745: .Ic display-panes
                   1746: command appear.
1.21      nicm     1747: .It Ic display-time Ar time
1.78      nicm     1748: Set the amount of time for which status line messages and other on-screen
                   1749: indicators are displayed.
1.21      nicm     1750: .Ar time
                   1751: is in milliseconds.
1.1       nicm     1752: .It Ic history-limit Ar lines
                   1753: Set the maximum number of lines held in window history.
                   1754: This setting applies only to new windows - existing window histories are not
                   1755: resized and retain the limit at the point they were created.
                   1756: .It Ic lock-after-time Ar number
1.100     nicm     1757: Lock the session (like the
                   1758: .Ic lock-session
1.90      nicm     1759: command) after
1.1       nicm     1760: .Ar number
1.100     nicm     1761: seconds of inactivity, or the entire server (all sessions) if the
                   1762: .Ic lock-server
                   1763: option is set.
                   1764: The default is not to lock (set to 0).
1.153     nicm     1765: .It Ic lock-command Ar shell-command
1.90      nicm     1766: Command to run when locking each client.
                   1767: The default is to run
                   1768: .Xr lock 1
                   1769: with
                   1770: .Fl np .
1.100     nicm     1771: .It Xo Ic lock-server
                   1772: .Op Ic on | off
                   1773: .Xc
                   1774: If this option is
1.102     nicm     1775: .Ic on
1.100     nicm     1776: (the default),
                   1777: instead of each session locking individually as each has been
                   1778: idle for
1.108     jmc      1779: .Ic lock-after-time ,
                   1780: the entire server will lock after
1.100     nicm     1781: .Em all
                   1782: sessions would have locked.
                   1783: This has no effect as a session option; it must be set as a global option.
1.1       nicm     1784: .It Ic message-attr Ar attributes
                   1785: Set status line message attributes, where
                   1786: .Ar attributes
                   1787: is either
1.168     nicm     1788: .Ic none
1.1       nicm     1789: or a comma-delimited list of one or more of:
                   1790: .Ic bright
                   1791: (or
                   1792: .Ic bold ) ,
                   1793: .Ic dim ,
                   1794: .Ic underscore ,
                   1795: .Ic blink ,
                   1796: .Ic reverse ,
                   1797: .Ic hidden ,
                   1798: or
                   1799: .Ic italics .
                   1800: .It Ic message-bg Ar colour
                   1801: Set status line message background colour, where
                   1802: .Ar colour
                   1803: is one of:
                   1804: .Ic black ,
                   1805: .Ic red ,
                   1806: .Ic green ,
                   1807: .Ic yellow ,
                   1808: .Ic blue ,
                   1809: .Ic magenta ,
                   1810: .Ic cyan ,
1.85      nicm     1811: .Ic white ,
                   1812: .Ic colour0
                   1813: to
                   1814: .Ic colour255
1.205     nicm     1815: from the 256-colour set,
                   1816: .Ic default ,
                   1817: or a hexadecimal RGB string such as
                   1818: .Ql #ffffff ,
                   1819: which chooses the closest match from the default 256-colour set.
1.1       nicm     1820: .It Ic message-fg Ar colour
                   1821: Set status line message foreground colour.
1.120     nicm     1822: .It Ic message-limit Ar number
                   1823: Set the number of error or information messages to save in the message log for
                   1824: each client.
                   1825: The default is 20.
1.102     nicm     1826: .It Xo Ic mouse-select-pane
                   1827: .Op Ic on | off
                   1828: .Xc
                   1829: If on,
                   1830: .Nm
                   1831: captures the mouse and when a window is split into multiple panes the mouse may
                   1832: be used to select the current pane.
                   1833: The mouse click is also passed through to the application as normal.
1.196     nicm     1834: .It Ic pane-active-border-bg Ar colour
                   1835: .It Ic pane-active-border-fg Ar colour
                   1836: Set the pane border colour for the currently active pane.
                   1837: .It Ic pane-border-bg Ar colour
1.135     nicm     1838: .It Ic pane-border-fg Ar colour
                   1839: Set the pane border colour for panes aside from the active pane.
1.89      nicm     1840: .It Ic prefix Ar keys
                   1841: Set the keys accepted as a prefix key.
                   1842: .Ar keys
                   1843: is a comma-separated list of key names, each of which individually behave as
                   1844: the prefix key.
1.21      nicm     1845: .It Ic repeat-time Ar time
1.1       nicm     1846: Allow multiple commands to be entered without pressing the prefix-key again
                   1847: in the specified
1.21      nicm     1848: .Ar time
1.1       nicm     1849: milliseconds (the default is 500).
                   1850: Whether a key repeats may be set when it is bound using the
                   1851: .Fl r
                   1852: flag to
                   1853: .Ic bind-key .
1.52      nicm     1854: Repeat is enabled for the default keys bound to the
                   1855: .Ic resize-pane
                   1856: command.
1.203     nicm     1857: .It Xo Ic mouse-utf8
                   1858: .Op Ic on | off
                   1859: .Xc
                   1860: If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1.1       nicm     1861: .It Xo Ic set-remain-on-exit
1.56      jmc      1862: .Op Ic on | off
1.1       nicm     1863: .Xc
                   1864: Set the
                   1865: .Ic remain-on-exit
                   1866: window option for any windows first created in this session.
1.153     nicm     1867: When this option is true, windows in which the running program has
                   1868: exited do not close, instead remaining open but inactivate.
                   1869: Use the
                   1870: .Ic respawn-window
                   1871: command to reactivate such a window, or the
                   1872: .Ic kill-window
                   1873: command to destroy it.
1.1       nicm     1874: .It Xo Ic set-titles
1.56      jmc      1875: .Op Ic on | off
1.1       nicm     1876: .Xc
1.77      stsp     1877: Attempt to set the window title using the \ee]2;...\e007 xterm code if
1.1       nicm     1878: the terminal appears to be an xterm.
1.11      nicm     1879: This option is off by default.
1.6       jmc      1880: Note that elinks
1.1       nicm     1881: will only attempt to set the window title if the STY environment
                   1882: variable is set.
1.86      nicm     1883: .It Ic set-titles-string Ar string
                   1884: String used to set the window title if
                   1885: .Ic set-titles
                   1886: is on.
                   1887: Character sequences are replaced as for the
                   1888: .Ic status-left
                   1889: option.
1.1       nicm     1890: .It Xo Ic status
1.56      jmc      1891: .Op Ic on | off
1.1       nicm     1892: .Xc
                   1893: Show or hide the status line.
                   1894: .It Ic status-attr Ar attributes
                   1895: Set status line attributes.
                   1896: .It Ic status-bg Ar colour
                   1897: Set status line background colour.
                   1898: .It Ic status-fg Ar colour
                   1899: Set status line foreground colour.
                   1900: .It Ic status-interval Ar interval
                   1901: Update the status bar every
                   1902: .Ar interval
                   1903: seconds.
                   1904: By default, updates will occur every 15 seconds.
                   1905: A setting of zero disables redrawing at interval.
1.41      nicm     1906: .It Xo Ic status-justify
1.56      jmc      1907: .Op Ic left | centre | right
1.41      nicm     1908: .Xc
                   1909: Set the position of the window list component of the status line: left, centre
                   1910: or right justified.
1.1       nicm     1911: .It Xo Ic status-keys
1.56      jmc      1912: .Op Ic vi | emacs
1.1       nicm     1913: .Xc
1.6       jmc      1914: Use vi or emacs-style
1.1       nicm     1915: key bindings in the status line, for example at the command prompt.
1.191     nicm     1916: The default is emacs, unless the
                   1917: .Ev VISUAL
                   1918: or
                   1919: .Ev EDITOR
                   1920: environment variables are set and contain the string
                   1921: .Ql vi .
1.1       nicm     1922: .It Ic status-left Ar string
                   1923: Display
                   1924: .Ar string
                   1925: to the left of the status bar.
                   1926: .Ar string
                   1927: will be passed through
                   1928: .Xr strftime 3
                   1929: before being used.
                   1930: By default, the session name is shown.
                   1931: .Ar string
1.83      nicm     1932: may contain any of the following special character sequences:
1.1       nicm     1933: .Bl -column "Character pair" "Replaced with" -offset indent
                   1934: .It Sy "Character pair" Ta Sy "Replaced with"
1.153     nicm     1935: .It Li "#(shell-command)" Ta "First line of the command's output"
1.83      nicm     1936: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1       nicm     1937: .It Li "#H" Ta "Hostname of local host"
1.125     nicm     1938: .It Li "#F" Ta "Current window flag"
1.35      nicm     1939: .It Li "#I" Ta "Current window index"
                   1940: .It Li "#P" Ta "Current pane index"
1.1       nicm     1941: .It Li "#S" Ta "Session name"
                   1942: .It Li "#T" Ta "Current window title"
1.35      nicm     1943: .It Li "#W" Ta "Current window name"
1.1       nicm     1944: .It Li "##" Ta "A literal" Ql #
                   1945: .El
1.83      nicm     1946: .Pp
1.153     nicm     1947: The #(shell-command) form executes
                   1948: .Ql shell-command
                   1949: and inserts the first line of its output.
1.103     nicm     1950: Note that shell commands are only executed once at the interval specified by
                   1951: the
                   1952: .Ic status-interval
                   1953: option: if the status line is redrawn in the meantime, the previous result is
                   1954: used.
1.161     nicm     1955: Shell commands are executed with the
                   1956: .Nm
                   1957: global environment set (see the
1.162     jmc      1958: .Sx ENVIRONMENT
                   1959: section).
1.163     nicm     1960: .Pp
                   1961: The window title (#T) is the title set by the program running within the window
                   1962: using the OSC title setting sequence, for example:
                   1963: .Bd -literal -offset indent
                   1964: $ printf '\e033]2;My Title\e033\e\e'
                   1965: .Ed
                   1966: .Pp
                   1967: When a window is first created, its title is the hostname.
1.109     nicm     1968: .Pp
1.83      nicm     1969: #[attributes] allows a comma-separated list of attributes to be specified,
                   1970: these may be
                   1971: .Ql fg=colour
                   1972: to set the foreground colour,
                   1973: .Ql bg=colour
1.131     nicm     1974: to set the background colour, the name of one of the attributes (listed under
                   1975: the
1.83      nicm     1976: .Ic message-attr
1.109     nicm     1977: option) to turn an attribute on, or an attribute prefixed with
                   1978: .Ql no
                   1979: to turn one off, for example
                   1980: .Ic nobright .
1.83      nicm     1981: Examples are:
                   1982: .Bd -literal -offset indent
                   1983: #(sysctl vm.loadavg)
                   1984: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
                   1985: .Ed
1.1       nicm     1986: .Pp
1.109     nicm     1987: Where appropriate, special character sequences may be prefixed with a number to
                   1988: specify the maximum length, for example
1.1       nicm     1989: .Ql #24T .
1.10      nicm     1990: .Pp
1.12      jmc      1991: By default, UTF-8 in
1.10      nicm     1992: .Ar string
                   1993: is not interpreted, to enable UTF-8, use the
                   1994: .Ic status-utf8
                   1995: option.
1.62      nicm     1996: .It Ic status-left-attr Ar attributes
1.66      jmc      1997: Set the attribute of the left part of the status line.
1.196     nicm     1998: .It Ic status-left-bg Ar colour
                   1999: Set the background colour of the left part of the status line.
1.62      nicm     2000: .It Ic status-left-fg Ar colour
                   2001: Set the foreground colour of the left part of the status line.
1.1       nicm     2002: .It Ic status-left-length Ar length
                   2003: Set the maximum
                   2004: .Ar length
                   2005: of the left component of the status bar.
                   2006: The default is 10.
                   2007: .It Ic status-right Ar string
                   2008: Display
                   2009: .Ar string
                   2010: to the right of the status bar.
1.151     nicm     2011: By default, the current window title in double quotes, the date and the time
                   2012: are shown.
1.1       nicm     2013: As with
                   2014: .Ic status-left ,
                   2015: .Ar string
                   2016: will be passed to
1.10      nicm     2017: .Xr strftime 3 ,
                   2018: character pairs are replaced, and UTF-8 is dependent on the
                   2019: .Ic status-utf8
                   2020: option.
1.62      nicm     2021: .It Ic status-right-attr Ar attributes
1.66      jmc      2022: Set the attribute of the right part of the status line.
1.196     nicm     2023: .It Ic status-right-bg Ar colour
                   2024: Set the background colour of the right part of the status line.
1.62      nicm     2025: .It Ic status-right-fg Ar colour
                   2026: Set the foreground colour of the right part of the status line.
1.1       nicm     2027: .It Ic status-right-length Ar length
                   2028: Set the maximum
                   2029: .Ar length
                   2030: of the right component of the status bar.
                   2031: The default is 40.
1.10      nicm     2032: .It Xo Ic status-utf8
1.56      jmc      2033: .Op Ic on | off
1.10      nicm     2034: .Xc
                   2035: Instruct
                   2036: .Nm
                   2037: to treat top-bit-set characters in the
                   2038: .Ic status-left
                   2039: and
                   2040: .Ic status-right
                   2041: strings as UTF-8; notably, this is important for wide characters.
                   2042: This option defaults to off.
1.55      jmc      2043: .It Ic terminal-overrides Ar string
1.54      nicm     2044: Contains a list of entries which override terminal descriptions read using
                   2045: .Xr terminfo 5 .
                   2046: .Ar string
                   2047: is a comma-separated list of items each a colon-separated string made up of a
                   2048: terminal type pattern (matched using
                   2049: .Xr fnmatch 3 )
                   2050: and a set of
                   2051: .Em name=value
                   2052: entries.
                   2053: .Pp
                   2054: For example, to set the
                   2055: .Ql clear
                   2056: .Xr terminfo 5
                   2057: entry to
                   2058: .Ql \ee[H\ee[2J
                   2059: for all terminal types and the
                   2060: .Ql dch1
                   2061: entry to
                   2062: .Ql \ee[P
1.55      jmc      2063: for the
1.54      nicm     2064: .Ql rxvt
                   2065: terminal type, the option could be set to the string:
                   2066: .Bd -literal -offset indent
                   2067: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
                   2068: .Ed
                   2069: .Pp
                   2070: The terminal entry value is passed through
                   2071: .Xr strunvis 3
                   2072: before interpretation.
                   2073: The default value forcibly corrects the
                   2074: .Ql colors
                   2075: entry for terminals which support 88 or 256 colours:
                   2076: .Bd -literal -offset indent
                   2077: "*88col*:colors=88,*256col*:colors=256"
                   2078: .Ed
1.63      nicm     2079: .It Ic update-environment Ar variables
                   2080: Set a space-separated string containing a list of environment variables to be
                   2081: copied into the session environment when a new session is created or an
                   2082: existing session is attached.
                   2083: Any variables that do not exist in the source environment are set to be
                   2084: removed from the session environment (as if
                   2085: .Fl r
                   2086: was given to the
                   2087: .Ic set-environment
                   2088: command).
                   2089: The default is
1.190     nicm     2090: "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
                   2091: XAUTHORITY".
1.37      nicm     2092: .It Xo Ic visual-activity
1.56      jmc      2093: .Op Ic on | off
1.37      nicm     2094: .Xc
                   2095: If on, display a status line message when activity occurs in a window
1.39      jmc      2096: for which the
1.37      nicm     2097: .Ic monitor-activity
                   2098: window option is enabled.
                   2099: .It Xo Ic visual-bell
1.56      jmc      2100: .Op Ic on | off
1.37      nicm     2101: .Xc
                   2102: If this option is on, a message is shown on a bell instead of it being passed
                   2103: through to the terminal (which normally makes a sound).
                   2104: Also see the
                   2105: .Ic bell-action
                   2106: option.
                   2107: .It Xo Ic visual-content
1.56      jmc      2108: .Op Ic on | off
1.37      nicm     2109: .Xc
                   2110: Like
                   2111: .Ic visual-activity ,
                   2112: display a message when content is present in a window
1.39      jmc      2113: for which the
1.37      nicm     2114: .Ic monitor-content
                   2115: window option is enabled.
1.192     nicm     2116: .It Xo Ic visual-silence
                   2117: .Op Ic on | off
                   2118: .Xc
                   2119: If
                   2120: .Ic monitor-silence
                   2121: is enabled, prints a message after the interval has expired on a given window.
1.1       nicm     2122: .El
                   2123: .It Xo Ic set-window-option
1.58      nicm     2124: .Op Fl agu
1.1       nicm     2125: .Op Fl t Ar target-window
                   2126: .Ar option Ar value
                   2127: .Xc
                   2128: .D1 (alias: Ic setw )
1.18      nicm     2129: Set a window option.
1.1       nicm     2130: The
1.58      nicm     2131: .Fl a ,
1.1       nicm     2132: .Fl g
                   2133: and
                   2134: .Fl u
                   2135: flags work similarly to the
                   2136: .Ic set-option
                   2137: command.
                   2138: .Pp
1.18      nicm     2139: Supported window options are:
1.56      jmc      2140: .Pp
                   2141: .Bl -tag -width Ds -compact
1.1       nicm     2142: .It Xo Ic aggressive-resize
1.56      jmc      2143: .Op Ic on | off
1.1       nicm     2144: .Xc
                   2145: Aggressively resize the chosen window.
                   2146: This means that
                   2147: .Nm
                   2148: will resize the window to the size of the smallest session for which it is the
                   2149: current window, rather than the smallest session to which it is attached.
                   2150: The window may resize when the current window is changed on another sessions;
1.6       jmc      2151: this option is good for full-screen programs which support
                   2152: .Dv SIGWINCH
                   2153: and poor for interactive programs such as shells.
1.56      jmc      2154: .Pp
1.196     nicm     2155: .It Xo Ic alternate-screen
                   2156: .Op Ic on | off
                   2157: .Xc
                   2158: This option configures whether programs running inside
                   2159: .Nm
                   2160: may use the terminal alternate screen feature, which allows the
                   2161: .Em smcup
                   2162: and
                   2163: .Em rmcup
                   2164: .Xr terminfo 5
1.209     nicm     2165: capabilities.
                   2166: The alternate screen feature preserves the contents of the window when an
                   2167: interactive application starts and restores it on exit, so that any output
                   2168: visible before the application starts reappears unchanged after it exits.
                   2169: The default is on.
1.196     nicm     2170: .Pp
1.1       nicm     2171: .It Xo Ic automatic-rename
1.56      jmc      2172: .Op Ic on | off
1.1       nicm     2173: .Xc
                   2174: Control automatic window renaming.
                   2175: When this setting is enabled,
                   2176: .Nm
                   2177: will attempt - on supported platforms - to rename the window to reflect the
                   2178: command currently running in it.
                   2179: This flag is automatically disabled for an individual window when a name
                   2180: is specified at creation with
1.186     nicm     2181: .Ic new-window
                   2182: or
1.1       nicm     2183: .Ic new-session ,
                   2184: or later with
                   2185: .Ic rename-window .
                   2186: It may be switched off globally with:
                   2187: .Bd -literal -offset indent
                   2188: set-window-option -g automatic-rename off
                   2189: .Ed
1.56      jmc      2190: .Pp
1.1       nicm     2191: .It Ic clock-mode-colour Ar colour
                   2192: Set clock colour.
1.56      jmc      2193: .Pp
1.1       nicm     2194: .It Xo Ic clock-mode-style
1.56      jmc      2195: .Op Ic 12 | 24
1.1       nicm     2196: .Xc
                   2197: Set clock hour format.
1.56      jmc      2198: .Pp
1.1       nicm     2199: .It Ic force-height Ar height
                   2200: .It Ic force-width Ar width
                   2201: Prevent
                   2202: .Nm
                   2203: from resizing a window to greater than
                   2204: .Ar width
                   2205: or
                   2206: .Ar height .
                   2207: A value of zero restores the default unlimited setting.
1.56      jmc      2208: .Pp
1.196     nicm     2209: .It Ic main-pane-height Ar height
1.2       nicm     2210: .It Ic main-pane-width Ar width
                   2211: Set the width or height of the main (left or top) pane in the
                   2212: .Ic main-horizontal
                   2213: or
                   2214: .Ic main-vertical
                   2215: layouts.
1.56      jmc      2216: .Pp
1.1       nicm     2217: .It Ic mode-attr Ar attributes
                   2218: Set window modes attributes.
1.56      jmc      2219: .Pp
1.1       nicm     2220: .It Ic mode-bg Ar colour
                   2221: Set window modes background colour.
1.56      jmc      2222: .Pp
1.1       nicm     2223: .It Ic mode-fg Ar colour
                   2224: Set window modes foreground colour.
1.56      jmc      2225: .Pp
1.1       nicm     2226: .It Xo Ic mode-keys
1.56      jmc      2227: .Op Ic vi | emacs
1.1       nicm     2228: .Xc
1.105     nicm     2229: Use vi or emacs-style key bindings in copy and choice modes.
1.191     nicm     2230: As with the
                   2231: .Ic status-keys
                   2232: option, the default is emacs, unless
                   2233: .Ev VISUAL
                   2234: or
                   2235: .Ev EDITOR
                   2236: contains
                   2237: .Ql vi .
1.56      jmc      2238: .Pp
1.50      nicm     2239: .It Xo Ic mode-mouse
1.56      jmc      2240: .Op Ic on | off
1.50      nicm     2241: .Xc
1.51      jmc      2242: Mouse state in modes.
1.173     nicm     2243: If on, the mouse may be used to copy a selection by dragging in copy mode, or
                   2244: to select an option in choice mode.
1.56      jmc      2245: .Pp
1.1       nicm     2246: .It Xo Ic monitor-activity
1.56      jmc      2247: .Op Ic on | off
1.1       nicm     2248: .Xc
                   2249: Monitor for activity in the window.
                   2250: Windows with activity are highlighted in the status line.
1.56      jmc      2251: .Pp
                   2252: .It Ic monitor-content Ar match-string
1.6       jmc      2253: Monitor content in the window.
                   2254: When
1.16      nicm     2255: .Xr fnmatch 3
                   2256: pattern
1.1       nicm     2257: .Ar match-string
                   2258: appears in the window, it is highlighted in the status line.
1.56      jmc      2259: .Pp
1.192     nicm     2260: .It Xo Ic monitor-silence
                   2261: .Op Ic interval
                   2262: .Xc
                   2263: Monitor for silence (no activity) in the window within
                   2264: .Ic interval
                   2265: seconds.
                   2266: Windows that have been silent for the interval are highlighted in the
                   2267: status line.
                   2268: An interval of zero disables the monitoring.
1.195     nicm     2269: .Pp
                   2270: .It Ic other-pane-height Ar height
                   2271: Set the height of the other panes (not the main pane) in the
                   2272: .Ic main-horizontal
                   2273: layout.
                   2274: If this option is set to 0 (the default), it will have no effect.
                   2275: If both the
                   2276: .Ic main-pane-height
                   2277: and
                   2278: .Ic other-pane-height
                   2279: options are set, the main pane will grow taller to make the other panes the
                   2280: specified height, but will never shrink to do so.
                   2281: .Pp
                   2282: .It Ic other-pane-width Ar width
                   2283: Like
                   2284: .Ic other-pane-height ,
                   2285: but set the width of other panes in the
                   2286: .Ic main-vertical
                   2287: layout.
1.192     nicm     2288: .Pp
1.1       nicm     2289: .It Xo Ic remain-on-exit
1.56      jmc      2290: .Op Ic on | off
1.1       nicm     2291: .Xc
                   2292: A window with this flag set is not destroyed when the program running in it
                   2293: exits.
                   2294: The window may be reactivated with the
                   2295: .Ic respawn-window
                   2296: command.
1.56      jmc      2297: .Pp
1.99      nicm     2298: .It Xo Ic synchronize-panes
                   2299: .Op Ic on | off
                   2300: .Xc
1.164     nicm     2301: Duplicate input to any pane to all other panes in the same window (only
                   2302: for panes that are not in any special mode).
1.139     nicm     2303: .Pp
1.1       nicm     2304: .It Xo Ic utf8
1.56      jmc      2305: .Op Ic on | off
1.1       nicm     2306: .Xc
                   2307: Instructs
                   2308: .Nm
                   2309: to expect UTF-8 sequences to appear in this window.
1.56      jmc      2310: .Pp
1.1       nicm     2311: .It Ic window-status-attr Ar attributes
                   2312: Set status line attributes for a single window.
1.56      jmc      2313: .Pp
1.1       nicm     2314: .It Ic window-status-bg Ar colour
                   2315: Set status line background colour for a single window.
1.56      jmc      2316: .Pp
1.1       nicm     2317: .It Ic window-status-fg Ar colour
                   2318: Set status line foreground colour for a single window.
1.56      jmc      2319: .Pp
1.125     nicm     2320: .It Ic window-status-format Ar string
                   2321: Set the format in which the window is displayed in the status line window list.
                   2322: See the
                   2323: .Ar status-left
                   2324: option for details of special character sequences available.
                   2325: The default is
                   2326: .Ql #I:#W#F .
1.169     nicm     2327: .Pp
                   2328: .It Ic window-status-alert-attr Ar attributes
                   2329: Set status line attributes for windows which have an alert (bell, activity
                   2330: or content).
                   2331: .Pp
                   2332: .It Ic window-status-alert-bg Ar colour
                   2333: Set status line background colour for windows with an alert.
                   2334: .Pp
                   2335: .It Ic window-status-alert-fg Ar colour
                   2336: Set status line foreground colour for windows with an alert.
1.125     nicm     2337: .Pp
1.40      nicm     2338: .It Ic window-status-current-attr Ar attributes
                   2339: Set status line attributes for the currently active window.
1.56      jmc      2340: .Pp
1.40      nicm     2341: .It Ic window-status-current-bg Ar colour
                   2342: Set status line background colour for the currently active window.
1.56      jmc      2343: .Pp
1.40      nicm     2344: .It Ic window-status-current-fg Ar colour
                   2345: Set status line foreground colour for the currently active window.
1.56      jmc      2346: .Pp
1.125     nicm     2347: .It Ic window-status-current-format Ar string
                   2348: Like
                   2349: .Ar window-status-format ,
                   2350: but is the format used when the window is the current window.
1.154     nicm     2351: .Pp
                   2352: .It Ic word-separators Ar string
                   2353: Sets the window's conception of what characters are considered word
                   2354: separators, for the purposes of the next and previous word commands in
                   2355: copy mode.
                   2356: The default is
                   2357: .Ql \ -_@ .
1.125     nicm     2358: .Pp
1.1       nicm     2359: .It Xo Ic xterm-keys
1.56      jmc      2360: .Op Ic on | off
1.1       nicm     2361: .Xc
                   2362: If this option is set,
                   2363: .Nm
                   2364: will generate
1.57      jmc      2365: .Xr xterm 1 -style
                   2366: function key sequences; these have a number included to indicate modifiers such
                   2367: as Shift, Alt or Ctrl.
1.123     nicm     2368: The default is off.
1.57      jmc      2369: .El
                   2370: .It Xo Ic show-options
1.133     nicm     2371: .Op Fl gsw
1.129     nicm     2372: .Op Fl t Ar target-session | Ar target-window
1.57      jmc      2373: .Xc
                   2374: .D1 (alias: Ic show )
1.133     nicm     2375: Show the window options with
1.129     nicm     2376: .Fl w
1.133     nicm     2377: (equivalent to
1.134     nicm     2378: .Ic show-window-options ) ,
1.133     nicm     2379: the server options with
                   2380: .Fl s ,
                   2381: otherwise the session options for
                   2382: .Ar target session .
                   2383: Global session or window options are listed if
                   2384: .Fl g
                   2385: is used.
1.57      jmc      2386: .It Xo Ic show-window-options
                   2387: .Op Fl g
                   2388: .Op Fl t Ar target-window
                   2389: .Xc
                   2390: .D1 (alias: Ic showw )
                   2391: List the window options for
                   2392: .Ar target-window ,
                   2393: or the global window options if
                   2394: .Fl g
                   2395: is used.
1.63      nicm     2396: .El
                   2397: .Sh ENVIRONMENT
                   2398: When the server is started,
                   2399: .Nm
                   2400: copies the environment into the
                   2401: .Em global environment ;
                   2402: in addition, each session has a
                   2403: .Em session environment .
1.193     nicm     2404: When a window is created, the session and global environments are merged.
                   2405: If a variable exists in both, the value from the session environment is used.
                   2406: The result is the initial environment passed to the new process.
1.63      nicm     2407: .Pp
                   2408: The
                   2409: .Ic update-environment
                   2410: session option may be used to update the session environment from the client
                   2411: when a new session is created or an old reattached.
                   2412: .Nm
                   2413: also initialises the
                   2414: .Ev TMUX
                   2415: variable with some internal information to allow commands to be executed
                   2416: from inside, and the
                   2417: .Ev TERM
                   2418: variable with the correct terminal setting of
                   2419: .Ql screen .
                   2420: .Pp
                   2421: Commands to alter and view the environment are:
                   2422: .Bl -tag -width Ds
                   2423: .It Xo Ic set-environment
                   2424: .Op Fl gru
                   2425: .Op Fl t Ar target-session
                   2426: .Ar name Op Ar value
                   2427: .Xc
1.115     nicm     2428: .D1 (alias: Ic setenv )
1.63      nicm     2429: Set or unset an environment variable.
                   2430: If
                   2431: .Fl g
                   2432: is used, the change is made in the global environment; otherwise, it is applied
                   2433: to the session environment for
                   2434: .Ar target-session .
                   2435: The
                   2436: .Fl u
                   2437: flag unsets a variable.
                   2438: .Fl r
                   2439: indicates the variable is to be removed from the environment before starting a
                   2440: new process.
                   2441: .It Xo Ic show-environment
                   2442: .Op Fl g
                   2443: .Op Fl t Ar target-session
                   2444: .Xc
1.115     nicm     2445: .D1 (alias: Ic showenv )
1.63      nicm     2446: Display the environment for
                   2447: .Ar target-session
                   2448: or the global environment with
                   2449: .Fl g .
                   2450: Variables removed from the environment are prefixed with
                   2451: .Ql - .
1.57      jmc      2452: .El
                   2453: .Sh STATUS LINE
                   2454: .Nm
                   2455: includes an optional status line which is displayed in the bottom line of each
                   2456: terminal.
                   2457: By default, the status line is enabled (it may be disabled with the
                   2458: .Ic status
                   2459: session option) and contains, from left-to-right: the name of the current
                   2460: session in square brackets; the window list; the current window title in double
                   2461: quotes; and the time and date.
                   2462: .Pp
                   2463: The status line is made of three parts: configurable left and right sections
                   2464: (which may contain dynamic content such as the time or output from a shell
                   2465: command, see the
                   2466: .Ic status-left ,
                   2467: .Ic status-left-length ,
                   2468: .Ic status-right ,
                   2469: and
                   2470: .Ic status-right-length
                   2471: options below), and a central window list.
1.125     nicm     2472: By default, the window list shows the index, name and (if any) flag of the
                   2473: windows present in the current session in ascending numerical order.
                   2474: It may be customised with the
                   2475: .Ar window-status-format
                   2476: and
                   2477: .Ar window-status-current-format
                   2478: options.
1.57      jmc      2479: The flag is one of the following symbols appended to the window name:
                   2480: .Bl -column "Symbol" "Meaning" -offset indent
                   2481: .It Sy "Symbol" Ta Sy "Meaning"
                   2482: .It Li "*" Ta "Denotes the current window."
                   2483: .It Li "-" Ta "Marks the last window (previously selected)."
                   2484: .It Li "#" Ta "Window is monitored and activity has been detected."
                   2485: .It Li "!" Ta "A bell has occurred in the window."
                   2486: .It Li "+" Ta "Window is monitored for content and it has appeared."
1.192     nicm     2487: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.57      jmc      2488: .El
                   2489: .Pp
                   2490: The # symbol relates to the
                   2491: .Ic monitor-activity
                   2492: and + to the
                   2493: .Ic monitor-content
                   2494: window options.
                   2495: The window name is printed in inverted colours if an alert (bell, activity or
                   2496: content) is present.
                   2497: .Pp
1.131     nicm     2498: The colour and attributes of the status line may be configured, the entire
                   2499: status line using the
1.57      jmc      2500: .Ic status-attr ,
                   2501: .Ic status-fg
                   2502: and
                   2503: .Ic status-bg
                   2504: session options and individual windows using the
                   2505: .Ic window-status-attr ,
                   2506: .Ic window-status-fg
                   2507: and
                   2508: .Ic window-status-bg
                   2509: window options.
                   2510: .Pp
1.131     nicm     2511: The status line is automatically refreshed at interval if it has changed, the
                   2512: interval may be controlled with the
1.57      jmc      2513: .Ic status-interval
                   2514: session option.
                   2515: .Pp
                   2516: Commands related to the status line are as follows:
                   2517: .Bl -tag -width Ds
                   2518: .It Xo Ic command-prompt
1.73      nicm     2519: .Op Fl p Ar prompts
1.57      jmc      2520: .Op Fl t Ar target-client
                   2521: .Op Ar template
                   2522: .Xc
                   2523: Open the command prompt in a client.
                   2524: This may be used from inside
                   2525: .Nm
                   2526: to execute commands interactively.
                   2527: If
                   2528: .Ar template
1.73      nicm     2529: is specified, it is used as the command.
                   2530: If
                   2531: .Fl p
                   2532: is given,
                   2533: .Ar prompts
                   2534: is a comma-separated list of prompts which are displayed in order; otherwise
                   2535: a single prompt is displayed, constructed from
                   2536: .Ar template
                   2537: if it is present, or
                   2538: .Ql \&:
                   2539: if not.
                   2540: Before the command is executed, the first occurrence of the string
                   2541: .Ql %%
1.74      jmc      2542: and all occurrences of
1.73      nicm     2543: .Ql %1
                   2544: are replaced by the response to the first prompt, the second
                   2545: .Ql %%
                   2546: and all
                   2547: .Ql %2
                   2548: are replaced with the response to the second prompt, and so on for further
1.74      jmc      2549: prompts.
                   2550: Up to nine prompt responses may be replaced
                   2551: .Po
                   2552: .Ql %1
1.73      nicm     2553: to
1.74      jmc      2554: .Ql %9
                   2555: .Pc .
1.57      jmc      2556: .It Xo Ic confirm-before
                   2557: .Op Fl t Ar target-client
                   2558: .Ar command
                   2559: .Xc
                   2560: .D1 (alias: Ic confirm )
                   2561: Ask for confirmation before executing
                   2562: .Ar command .
                   2563: This command works only from inside
                   2564: .Nm .
                   2565: .It Xo Ic display-message
1.127     nicm     2566: .Op Fl p
1.57      jmc      2567: .Op Fl t Ar target-client
                   2568: .Op Ar message
                   2569: .Xc
                   2570: .D1 (alias: Ic display )
1.127     nicm     2571: Display a message.
                   2572: If
                   2573: .Fl p
                   2574: is given, the output is printed to stdout, otherwise it is displayed in the
                   2575: .Ar target-client
                   2576: status line.
1.122     nicm     2577: The format of
1.124     jmc      2578: .Ar message
                   2579: is as for
1.122     nicm     2580: .Ic status-left ,
                   2581: with the exception that #() are not handled.
1.57      jmc      2582: .El
                   2583: .Sh BUFFERS
                   2584: .Nm
                   2585: maintains a stack of
1.199     nicm     2586: .Em paste buffers .
1.57      jmc      2587: Up to the value of the
                   2588: .Ic buffer-limit
                   2589: option are kept; when a new buffer is added, the buffer at the bottom of the
                   2590: stack is removed.
                   2591: Buffers may be added using
                   2592: .Ic copy-mode
                   2593: or the
                   2594: .Ic set-buffer
                   2595: command, and pasted into a window using the
                   2596: .Ic paste-buffer
                   2597: command.
                   2598: .Pp
                   2599: A configurable history buffer is also maintained for each window.
                   2600: By default, up to 2000 lines are kept; this can be altered with the
                   2601: .Ic history-limit
                   2602: option (see the
                   2603: .Ic set-option
                   2604: command above).
                   2605: .Pp
                   2606: The buffer commands are as follows:
                   2607: .Bl -tag -width Ds
1.178     nicm     2608: .It Xo
                   2609: .Ic choose-buffer
                   2610: .Op Fl t Ar target-window
                   2611: .Op Ar template
                   2612: .Xc
                   2613: Put a window into buffer choice mode, where a buffer may be chosen
                   2614: interactively from a list.
                   2615: After a buffer is selected,
                   2616: .Ql %%
                   2617: is replaced by the buffer index in
                   2618: .Ar template
                   2619: and the result executed as a command.
                   2620: If
                   2621: .Ar template
                   2622: is not given, "paste-buffer -b '%%'" is used.
                   2623: This command works only from inside
                   2624: .Nm .
1.57      jmc      2625: .It Ic clear-history Op Fl t Ar target-pane
                   2626: .D1 (alias: Ic clearhist )
                   2627: Remove and free the history for the specified pane.
1.198     nicm     2628: .It Ic delete-buffer Op Fl b Ar buffer-index
1.57      jmc      2629: .D1 (alias: Ic deleteb )
                   2630: Delete the buffer at
                   2631: .Ar buffer-index ,
                   2632: or the top buffer if not specified.
1.198     nicm     2633: .It Ic list-buffers
1.57      jmc      2634: .D1 (alias: Ic lsb )
1.198     nicm     2635: List the global buffers.
1.200     jmc      2636: .It Xo Ic load-buffer
1.57      jmc      2637: .Op Fl b Ar buffer-index
                   2638: .Ar path
                   2639: .Xc
                   2640: .D1 (alias: Ic loadb )
                   2641: Load the contents of the specified paste buffer from
                   2642: .Ar path .
                   2643: .It Xo Ic paste-buffer
                   2644: .Op Fl dr
                   2645: .Op Fl b Ar buffer-index
1.170     nicm     2646: .Op Fl s Ar separator
1.158     nicm     2647: .Op Fl t Ar target-pane
1.57      jmc      2648: .Xc
                   2649: .D1 (alias: Ic pasteb )
1.158     nicm     2650: Insert the contents of a paste buffer into the specified pane.
                   2651: If not specified, paste into the current one.
1.57      jmc      2652: With
                   2653: .Fl d ,
                   2654: also delete the paste buffer from the stack.
                   2655: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170     nicm     2656: a separator, by default carriage return (CR).
                   2657: A custom separator may be specified using the
                   2658: .Fl s
                   2659: flag.
                   2660: The
1.57      jmc      2661: .Fl r
1.170     nicm     2662: flag means to do no replacement (equivalent to a separator of LF).
1.57      jmc      2663: .It Xo Ic save-buffer
                   2664: .Op Fl a
                   2665: .Op Fl b Ar buffer-index
                   2666: .Ar path
                   2667: .Xc
                   2668: .D1 (alias: Ic saveb )
                   2669: Save the contents of the specified paste buffer to
                   2670: .Ar path .
                   2671: The
                   2672: .Fl a
                   2673: option appends to rather than overwriting the file.
                   2674: .It Xo Ic set-buffer
                   2675: .Op Fl b Ar buffer-index
                   2676: .Ar data
                   2677: .Xc
                   2678: .D1 (alias: Ic setb )
                   2679: Set the contents of the specified buffer to
                   2680: .Ar data .
1.1       nicm     2681: .It Xo Ic show-buffer
                   2682: .Op Fl b Ar buffer-index
                   2683: .Xc
                   2684: .D1 (alias: Ic showb )
                   2685: Display the contents of the specified buffer.
1.57      jmc      2686: .El
                   2687: .Sh MISCELLANEOUS
                   2688: Miscellaneous commands are as follows:
                   2689: .Bl -tag -width Ds
1.72      nicm     2690: .It Ic clock-mode Op Fl t Ar target-pane
1.57      jmc      2691: Display a large clock.
                   2692: .It Ic if-shell Ar shell-command command
                   2693: .D1 (alias: Ic if )
                   2694: Execute
                   2695: .Ar command
                   2696: if
                   2697: .Ar shell-command
                   2698: returns success.
                   2699: .It Ic lock-server
                   2700: .D1 (alias: Ic lock )
1.90      nicm     2701: Lock each client individually by running the command specified by the
                   2702: .Ic lock-command
                   2703: option.
1.153     nicm     2704: .It Ic run-shell Ar shell-command
1.87      nicm     2705: .D1 (alias: Ic run )
                   2706: Execute
1.153     nicm     2707: .Ar shell-command
1.106     nicm     2708: in the background without creating a window.
1.164     nicm     2709: After it finishes, any output to stdout is displayed in copy mode.
1.153     nicm     2710: If the command doesn't return success, the exit status is also displayed.
1.57      jmc      2711: .It Ic server-info
                   2712: .D1 (alias: Ic info )
                   2713: Show server information and terminal details.
1.1       nicm     2714: .El
                   2715: .Sh FILES
1.26      nicm     2716: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1       nicm     2717: .It Pa ~/.tmux.conf
1.6       jmc      2718: Default
1.1       nicm     2719: .Nm
1.6       jmc      2720: configuration file.
1.26      nicm     2721: .It Pa /etc/tmux.conf
                   2722: System-wide configuration file.
1.1       nicm     2723: .El
1.57      jmc      2724: .Sh EXAMPLES
                   2725: To create a new
                   2726: .Nm
                   2727: session running
                   2728: .Xr vi 1 :
                   2729: .Pp
                   2730: .Dl $ tmux new-session vi
                   2731: .Pp
                   2732: Most commands have a shorter form, known as an alias.
                   2733: For new-session, this is
                   2734: .Ic new :
                   2735: .Pp
                   2736: .Dl $ tmux new vi
                   2737: .Pp
                   2738: Alternatively, the shortest unambiguous form of a command is accepted.
                   2739: If there are several options, they are listed:
                   2740: .Bd -literal -offset indent
                   2741: $ tmux n
                   2742: ambiguous command: n, could be: new-session, new-window, next-window
                   2743: .Ed
                   2744: .Pp
                   2745: Within an active session, a new window may be created by typing
                   2746: .Ql C-b c
                   2747: (Ctrl
                   2748: followed by the
                   2749: .Ql b
                   2750: key
                   2751: followed by the
                   2752: .Ql c
                   2753: key).
                   2754: .Pp
                   2755: Windows may be navigated with:
                   2756: .Ql C-b 0
                   2757: (to select window 0),
                   2758: .Ql C-b 1
                   2759: (to select window 1), and so on;
                   2760: .Ql C-b n
                   2761: to select the next window; and
                   2762: .Ql C-b p
                   2763: to select the previous window.
                   2764: .Pp
                   2765: A session may be detached using
                   2766: .Ql C-b d
1.64      nicm     2767: (or by an external event such as
                   2768: .Xr ssh 1
                   2769: disconnection) and reattached with:
1.57      jmc      2770: .Pp
                   2771: .Dl $ tmux attach-session
                   2772: .Pp
                   2773: Typing
                   2774: .Ql C-b \&?
                   2775: lists the current key bindings in the current window; up and down may be used
                   2776: to navigate the list or
                   2777: .Ql q
                   2778: to exit from it.
                   2779: .Pp
                   2780: Commands to be run when the
                   2781: .Nm
                   2782: server is started may be placed in the
                   2783: .Pa ~/.tmux.conf
                   2784: configuration file.
                   2785: Common examples include:
                   2786: .Pp
                   2787: Changing the default prefix key:
                   2788: .Bd -literal -offset indent
                   2789: set-option -g prefix C-a
                   2790: unbind-key C-b
                   2791: bind-key C-a send-prefix
                   2792: .Ed
                   2793: .Pp
                   2794: Turning the status line off, or changing its colour:
                   2795: .Bd -literal -offset indent
                   2796: set-option -g status off
                   2797: set-option -g status-bg blue
                   2798: .Ed
                   2799: .Pp
                   2800: Setting other options, such as the default command,
                   2801: or locking after 30 minutes of inactivity:
                   2802: .Bd -literal -offset indent
                   2803: set-option -g default-command "exec /bin/ksh"
                   2804: set-option -g lock-after-time 1800
                   2805: .Ed
                   2806: .Pp
                   2807: Creating new key bindings:
                   2808: .Bd -literal -offset indent
                   2809: bind-key b set-option status
                   2810: bind-key / command-prompt "split-window 'exec man %%'"
1.73      nicm     2811: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57      jmc      2812: .Ed
1.1       nicm     2813: .Sh SEE ALSO
                   2814: .Xr pty 4
                   2815: .Sh AUTHORS
                   2816: .An Nicholas Marriott Aq nicm@users.sourceforge.net