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

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