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

1.297   ! nicm        1: .\" $OpenBSD: tmux.1,v 1.296 2012/06/18 09:15:22 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.296     nicm       17: .Dd $Mdocdate: June 18 2012 $
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.
1.236     nicm      236: .It $
                    237: Rename the current session.
1.171     nicm      238: .It %
                    239: Split the current pane into two, left and right.
                    240: .It &
                    241: Kill the current window.
                    242: .It '
                    243: Prompt for a window index to select.
                    244: .It ,
                    245: Rename the current window.
                    246: .It -
                    247: Delete the most recently copied buffer of text.
                    248: .It .
                    249: Prompt for an index to move the current window.
                    250: .It 0 to 9
                    251: Select windows 0 to 9.
                    252: .It :
                    253: Enter the
                    254: .Nm
                    255: command prompt.
1.187     nicm      256: .It ;
                    257: Move to the previously active pane.
1.178     nicm      258: .It =
                    259: Choose which buffer to paste interactively from a list.
1.171     nicm      260: .It \&?
                    261: List all key bindings.
                    262: .It D
                    263: Choose a client to detach.
1.182     jmc       264: .It \&[
1.171     nicm      265: Enter copy mode to copy text or view the history.
1.182     jmc       266: .It \&]
1.171     nicm      267: Paste the most recently copied buffer of text.
1.64      nicm      268: .It c
1.65      nicm      269: Create a new window.
1.64      nicm      270: .It d
1.65      nicm      271: Detach the current client.
1.171     nicm      272: .It f
                    273: Prompt to search for text in open windows.
                    274: .It i
                    275: Display some information about the current window.
1.64      nicm      276: .It l
1.65      nicm      277: Move to the previously selected window.
1.64      nicm      278: .It n
1.65      nicm      279: Change to the next window.
1.171     nicm      280: .It o
                    281: Select the next pane in the current window.
1.64      nicm      282: .It p
1.65      nicm      283: Change to the previous window.
1.171     nicm      284: .It q
                    285: Briefly display pane indexes.
                    286: .It r
                    287: Force redraw of the attached client.
                    288: .It s
                    289: Select a new session for the attached client interactively.
1.194     nicm      290: .It L
                    291: Switch the attached client back to the last session.
1.171     nicm      292: .It t
                    293: Show the time.
                    294: .It w
                    295: Choose the current window interactively.
                    296: .It x
                    297: Kill the current pane.
                    298: .It {
                    299: Swap the current pane with the previous pane.
                    300: .It }
                    301: Swap the current pane with the next pane.
                    302: .It ~
                    303: Show previous messages from
                    304: .Nm ,
                    305: if any.
                    306: .It Page Up
                    307: Enter copy mode and scroll one page up.
                    308: .It Up, Down
                    309: .It Left, Right
                    310: Change to the pane above, below, to the left, or to the right of the current
                    311: pane.
                    312: .It M-1 to M-5
                    313: Arrange panes in one of the five preset layouts: even-horizontal,
                    314: even-vertical, main-horizontal, main-vertical, or tiled.
                    315: .It M-n
                    316: Move to the next window with a bell or activity marker.
                    317: .It M-o
                    318: Rotate the panes in the current window backwards.
                    319: .It M-p
                    320: Move to the previous window with a bell or activity marker.
                    321: .It C-Up, C-Down
                    322: .It C-Left, C-Right
                    323: Resize the current pane in steps of one cell.
                    324: .It M-Up, M-Down
                    325: .It M-Left, M-Right
                    326: Resize the current pane in steps of five cells.
1.64      nicm      327: .El
                    328: .Pp
                    329: Key bindings may be changed with the
                    330: .Ic bind-key
                    331: and
                    332: .Ic unbind-key
                    333: commands.
1.57      jmc       334: .Sh COMMANDS
                    335: This section contains a list of the commands supported by
                    336: .Nm .
                    337: Most commands accept the optional
                    338: .Fl t
                    339: argument with one of
                    340: .Ar target-client ,
                    341: .Ar target-session
                    342: .Ar target-window ,
                    343: or
                    344: .Ar target-pane .
                    345: These specify the client, session, window or pane which a command should affect.
                    346: .Ar target-client
                    347: is the name of the
                    348: .Xr pty 4
                    349: file to which the client is connected, for example either of
                    350: .Pa /dev/ttyp1
                    351: or
                    352: .Pa ttyp1
                    353: for the client attached to
                    354: .Pa /dev/ttyp1 .
                    355: If no client is specified, the current client is chosen, if possible, or an
                    356: error is reported.
                    357: Clients may be listed with the
                    358: .Ic list-clients
                    359: command.
1.1       nicm      360: .Pp
1.57      jmc       361: .Ar target-session
                    362: is either the name of a session (as listed by the
                    363: .Ic list-sessions
                    364: command) or the name of a client with the same syntax as
                    365: .Ar target-client ,
                    366: in which case the session attached to the client is used.
                    367: When looking for the session name,
                    368: .Nm
                    369: initially searches for an exact match; if none is found, the session names
                    370: are checked for any for which
                    371: .Ar target-session
                    372: is a prefix or for which it matches as an
                    373: .Xr fnmatch 3
                    374: pattern.
                    375: If a single match is found, it is used as the target session; multiple matches
                    376: produce an error.
                    377: If a session is omitted, the current session is used if available; if no
1.117     nicm      378: current session is available, the most recently used is chosen.
1.1       nicm      379: .Pp
1.57      jmc       380: .Ar target-window
                    381: specifies a window in the form
                    382: .Em session Ns \&: Ns Em window .
                    383: .Em session
                    384: follows the same rules as for
                    385: .Ar target-session ,
                    386: and
                    387: .Em window
1.270     nicm      388: is looked for in order: as a window index, for example mysession:1;
1.271     jmc       389: as a window ID, such as @1;
1.270     nicm      390: as an exact window name, such as mysession:mywindow; then as an
1.57      jmc       391: .Xr fnmatch 3
                    392: pattern or the start of a window name, such as mysession:mywin* or
                    393: mysession:mywin.
                    394: An empty window name specifies the next unused index if appropriate (for
                    395: example the
                    396: .Ic new-window
                    397: and
                    398: .Ic link-window
                    399: commands)
                    400: otherwise the current window in
                    401: .Em session
                    402: is chosen.
1.140     nicm      403: The special character
                    404: .Ql \&!
                    405: uses the last (previously current) window, or
                    406: .Ql +
                    407: and
                    408: .Ql -
                    409: are the next window or the previous window by number.
1.57      jmc       410: When the argument does not contain a colon,
                    411: .Nm
                    412: first attempts to parse it as window; if that fails, an attempt is made to
                    413: match a session.
1.1       nicm      414: .Pp
1.57      jmc       415: .Ar target-pane
                    416: takes a similar form to
                    417: .Ar target-window
                    418: but with the optional addition of a period followed by a pane index, for
                    419: example: mysession:mywindow.1.
                    420: If the pane index is omitted, the currently active pane in the specified
                    421: window is used.
                    422: If neither a colon nor period appears,
1.13      nicm      423: .Nm
1.57      jmc       424: first attempts to use the argument as a pane index; if that fails, it is looked
                    425: up as for
                    426: .Ar target-window .
1.156     nicm      427: A
                    428: .Ql +
                    429: or
                    430: .Ql -
                    431: indicate the next or previous pane index, respectively.
1.132     nicm      432: One of the strings
                    433: .Em top ,
                    434: .Em bottom ,
                    435: .Em left ,
                    436: .Em right ,
                    437: .Em top-left ,
                    438: .Em top-right ,
1.216     nicm      439: .Em bottom-left
                    440: or
1.132     nicm      441: .Em bottom-right
                    442: may be used instead of a pane index.
1.177     nicm      443: .Pp
                    444: The special characters
                    445: .Ql +
                    446: and
                    447: .Ql -
                    448: may be followed by an offset, for example:
                    449: .Bd -literal -offset indent
                    450: select-window -t:+2
                    451: .Ed
                    452: .Pp
                    453: When dealing with a session that doesn't contain sequential window indexes,
                    454: they will be correctly skipped.
1.212     nicm      455: .Pp
                    456: .Nm
                    457: also gives each pane created in a server an identifier consisting of a
                    458: .Ql %
                    459: and a number, starting from zero.
                    460: A pane's identifier is unique for the life of the
                    461: .Nm
                    462: server and is passed to the child process of the pane in the
                    463: .Ev TMUX_PANE
                    464: environment variable.
                    465: It may be used alone to target a pane or the window containing it.
1.15      jmc       466: .Pp
1.153     nicm      467: .Ar shell-command
                    468: arguments are
                    469: .Xr sh 1
                    470: commands.
                    471: These must be passed as a single item, which typically means quoting them, for
                    472: example:
                    473: .Bd -literal -offset indent
                    474: new-window 'vi /etc/passwd'
                    475: .Ed
                    476: .Pp
                    477: .Ar command
                    478: .Op Ar arguments
                    479: refers to a
                    480: .Nm
                    481: command, passed with the command and arguments separately, for example:
                    482: .Bd -literal -offset indent
                    483: bind-key F1 set-window-option force-width 81
                    484: .Ed
                    485: .Pp
                    486: Or if using
                    487: .Xr sh 1 :
                    488: .Bd -literal -offset indent
                    489: $ tmux bind-key F1 set-window-option force-width 81
                    490: .Ed
                    491: .Pp
1.57      jmc       492: Multiple commands may be specified together as part of a
                    493: .Em command sequence .
                    494: Each command should be separated by spaces and a semicolon;
1.244     nicm      495: commands are executed sequentially from left to right and
1.293     nicm      496: lines ending with a backslash continue on to the next line,
                    497: except when escaped by another backslash.
1.57      jmc       498: A literal semicolon may be included by escaping it with a backslash (for
                    499: example, when specifying a command sequence to
                    500: .Ic bind-key ) .
1.13      nicm      501: .Pp
1.153     nicm      502: Example
                    503: .Nm
                    504: commands include:
1.13      nicm      505: .Bd -literal -offset indent
1.57      jmc       506: refresh-client -t/dev/ttyp2
                    507:
                    508: rename-session -tfirst newname
                    509:
                    510: set-window-option -t:0 monitor-activity on
                    511:
                    512: new-window ; split-window -d
1.244     nicm      513:
                    514: bind-key R source-file ~/.tmux.conf \e; \e
                    515:        display-message "source-file done"
1.13      nicm      516: .Ed
1.153     nicm      517: .Pp
                    518: Or from
                    519: .Xr sh 1 :
                    520: .Bd -literal -offset indent
                    521: $ tmux kill-window -t :1
                    522:
1.159     jmc       523: $ tmux new-window \e; split-window -d
1.153     nicm      524:
1.159     jmc       525: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153     nicm      526: .Ed
1.57      jmc       527: .Sh CLIENTS AND SESSIONS
1.153     nicm      528: The
                    529: .Nm
                    530: server manages clients, sessions, windows and panes.
                    531: Clients are attached to sessions to interact with them, either
                    532: when they are created with the
                    533: .Ic new-session
                    534: command, or later with the
                    535: .Ic attach-session
                    536: command.
1.188     nicm      537: Each session has one or more windows
1.153     nicm      538: .Em linked
                    539: into it.
                    540: Windows may be linked to multiple sessions and are made up of one or
                    541: more panes,
                    542: each of which contains a pseudo terminal.
                    543: Commands for creating, linking and otherwise manipulating windows
                    544: are covered
                    545: in the
                    546: .Sx WINDOWS AND PANES
                    547: section.
                    548: .Pp
                    549: The following commands are available to manage clients and sessions:
1.57      jmc       550: .Bl -tag -width Ds
                    551: .It Xo Ic attach-session
1.148     nicm      552: .Op Fl dr
1.57      jmc       553: .Op Fl t Ar target-session
                    554: .Xc
                    555: .D1 (alias: Ic attach )
                    556: If run from outside
                    557: .Nm ,
                    558: create a new client in the current terminal and attach it to
                    559: .Ar target-session .
                    560: If used from inside, switch the current client.
                    561: If
                    562: .Fl d
                    563: is specified, any other clients attached to the session are detached.
1.148     nicm      564: .Fl r
                    565: signifies the client is read-only (only keys bound to the
                    566: .Ic detach-client
1.242     nicm      567: or
                    568: .Ic switch-client
                    569: commands have any effect)
1.13      nicm      570: .Pp
1.57      jmc       571: If no server is started,
                    572: .Ic attach-session
                    573: will attempt to start it; this will fail unless sessions are created in the
                    574: configuration file.
1.217     nicm      575: .Pp
                    576: The
                    577: .Ar target-session
                    578: rules for
                    579: .Ic attach-session
                    580: are slightly adjusted: if
                    581: .Nm
                    582: needs to select the most recently used session, it will prefer the most
                    583: recently used
                    584: .Em unattached
                    585: session.
1.211     nicm      586: .It Xo Ic detach-client
                    587: .Op Fl P
1.296     nicm      588: .Op Fl a
1.219     nicm      589: .Op Fl s Ar target-session
1.211     nicm      590: .Op Fl t Ar target-client
                    591: .Xc
1.57      jmc       592: .D1 (alias: Ic detach )
1.218     nicm      593: Detach the current client if bound to a key, the client specified with
                    594: .Fl t ,
1.258     jmc       595: or all clients currently attached to the session specified by
1.218     nicm      596: .Fl s .
1.296     nicm      597: The
                    598: .Fl a
                    599: option kills all but the client given with
                    600: .Fl t .
1.211     nicm      601: If
                    602: .Fl P
                    603: is given, send SIGHUP to the parent process of the client, typically causing it
                    604: to exit.
1.57      jmc       605: .It Ic has-session Op Fl t Ar target-session
                    606: .D1 (alias: Ic has )
                    607: Report an error and exit with 1 if the specified session does not exist.
                    608: If it does exist, exit with 0.
                    609: .It Ic kill-server
                    610: Kill the
1.1       nicm      611: .Nm
1.57      jmc       612: server and clients and destroy all sessions.
1.297   ! nicm      613: .It Ic kill-session
        !           614: .Op Fl a
        !           615: .Op Fl t Ar target-session
1.57      jmc       616: Destroy the given session, closing any windows linked to it and no other
                    617: sessions, and detaching all clients attached to it.
1.297   ! nicm      618: If
        !           619: .Fl a
        !           620: is given, all sessions but the specified one is killed.
1.250     nicm      621: .It Xo Ic list-clients
                    622: .Op Fl F Ar format
                    623: .Op Fl t Ar target-session
                    624: .Xc
1.57      jmc       625: .D1 (alias: Ic lsc )
1.221     jmc       626: List all clients attached to the server.
1.250     nicm      627: For the meaning of the
                    628: .Fl F
                    629: flag, see the
1.252     jmc       630: .Sx FORMATS
                    631: section.
1.221     jmc       632: If
1.220     nicm      633: .Ar target-session
                    634: is specified, list only clients connected to that session.
1.57      jmc       635: .It Ic list-commands
                    636: .D1 (alias: Ic lscm )
                    637: List the syntax of all commands supported by
                    638: .Nm .
1.247     nicm      639: .It Ic list-sessions Op Fl F Ar format
1.57      jmc       640: .D1 (alias: Ic ls )
                    641: List all sessions managed by the server.
1.247     nicm      642: For the meaning of the
                    643: .Fl F
                    644: flag, see the
                    645: .Sx FORMATS
                    646: section.
1.175     nicm      647: .It Ic lock-client Op Fl t Ar target-client
                    648: .D1 (alias: Ic lockc )
1.92      nicm      649: Lock
                    650: .Ar target-client ,
                    651: see the
                    652: .Ic lock-server
                    653: command.
1.175     nicm      654: .It Ic lock-session Op Fl t Ar target-session
                    655: .D1 (alias: Ic locks )
1.92      nicm      656: Lock all clients attached to
                    657: .Ar target-session .
1.57      jmc       658: .It Xo Ic new-session
                    659: .Op Fl d
                    660: .Op Fl n Ar window-name
                    661: .Op Fl s Ar session-name
1.101     nicm      662: .Op Fl t Ar target-session
1.210     nicm      663: .Op Fl x Ar width
                    664: .Op Fl y Ar height
1.153     nicm      665: .Op Ar shell-command
1.57      jmc       666: .Xc
                    667: .D1 (alias: Ic new )
                    668: Create a new session with name
                    669: .Ar session-name .
1.153     nicm      670: .Pp
1.57      jmc       671: The new session is attached to the current terminal unless
                    672: .Fl d
                    673: is given.
                    674: .Ar window-name
1.1       nicm      675: and
1.153     nicm      676: .Ar shell-command
                    677: are the name of and shell command to execute in the initial window.
1.210     nicm      678: If
                    679: .Fl d
                    680: is used,
                    681: .Fl x
                    682: and
                    683: .Fl y
                    684: specify the size of the initial window (80 by 24 if not given).
1.68      nicm      685: .Pp
                    686: If run from a terminal, any
                    687: .Xr termios 4
                    688: special characters are saved and used for new windows in the new session.
1.101     nicm      689: .Pp
                    690: If
                    691: .Fl t
                    692: is given, the new session is
                    693: .Em grouped
                    694: with
                    695: .Ar target-session .
                    696: This means they share the same set of windows - all windows from
                    697: .Ar target-session
                    698: are linked to the new session and any subsequent new windows or windows being
                    699: closed are applied to both sessions.
                    700: The current and previous window and any session options remain independent and
                    701: either session may be killed without affecting the other.
                    702: Giving
                    703: .Fl n
                    704: or
1.153     nicm      705: .Ar shell-command
1.101     nicm      706: are invalid if
                    707: .Fl t
                    708: is used.
1.248     nicm      709: .It Xo Ic refresh-client
                    710: .Op Fl S
                    711: .Op Fl t Ar target-client
                    712: .Xc
1.57      jmc       713: .D1 (alias: Ic refresh )
                    714: Refresh the current client if bound to a key, or a single client if one is given
                    715: with
                    716: .Fl t .
1.248     nicm      717: If
                    718: .Fl S
                    719: is specified, only update the client's status bar.
1.57      jmc       720: .It Xo Ic rename-session
                    721: .Op Fl t Ar target-session
                    722: .Ar new-name
                    723: .Xc
                    724: .D1 (alias: Ic rename )
                    725: Rename the session to
                    726: .Ar new-name .
1.121     nicm      727: .It Xo Ic show-messages
1.120     nicm      728: .Op Fl t Ar target-client
                    729: .Xc
                    730: .D1 (alias: Ic showmsgs )
                    731: Any messages displayed on the status line are saved in a per-client message
                    732: log, up to a maximum of the limit set by the
                    733: .Ar message-limit
                    734: session option for the session attached to that client.
                    735: This command displays the log for
                    736: .Ar target-client .
1.57      jmc       737: .It Ic source-file Ar path
                    738: .D1 (alias: Ic source )
                    739: Execute commands from
                    740: .Ar path .
                    741: .It Ic start-server
                    742: .D1 (alias: Ic start )
                    743: Start the
1.1       nicm      744: .Nm
1.57      jmc       745: server, if not already running, without creating any sessions.
                    746: .It Xo Ic suspend-client
1.202     nicm      747: .Op Fl t Ar target-client
1.57      jmc       748: .Xc
                    749: .D1 (alias: Ic suspendc )
                    750: Suspend a client by sending
                    751: .Dv SIGTSTP
                    752: (tty stop).
                    753: .It Xo Ic switch-client
1.242     nicm      754: .Op Fl lnpr
1.57      jmc       755: .Op Fl c Ar target-client
                    756: .Op Fl t Ar target-session
                    757: .Xc
                    758: .D1 (alias: Ic switchc )
                    759: Switch the current session for client
                    760: .Ar target-client
                    761: to
                    762: .Ar target-session .
1.183     nicm      763: If
1.197     jmc       764: .Fl l ,
1.183     nicm      765: .Fl n
                    766: or
                    767: .Fl p
1.194     nicm      768: is used, the client is moved to the last, next or previous session
                    769: respectively.
1.242     nicm      770: .Fl r
                    771: toggles whether a client is read-only (see the
                    772: .Ic attach-session
                    773: command).
1.57      jmc       774: .El
                    775: .Sh WINDOWS AND PANES
1.1       nicm      776: A
                    777: .Nm
                    778: window may be in one of several modes.
                    779: The default permits direct access to the terminal attached to the window.
1.164     nicm      780: The other is copy mode, which permits a section of a window or its
                    781: history to be copied to a
1.1       nicm      782: .Em paste buffer
                    783: for later insertion into another window.
                    784: This mode is entered with the
                    785: .Ic copy-mode
                    786: command, bound to
1.113     nicm      787: .Ql \&[
1.1       nicm      788: by default.
1.164     nicm      789: It is also entered when a command that produces output, such as
                    790: .Ic list-keys ,
                    791: is executed from a key binding.
1.1       nicm      792: .Pp
1.6       jmc       793: The keys available depend on whether emacs or vi mode is selected
                    794: (see the
1.1       nicm      795: .Ic mode-keys
                    796: option).
                    797: The following keys are supported as appropriate for the mode:
1.157     nicm      798: .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.1       nicm      799: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27      nicm      800: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.142     nicm      801: .It Li "Bottom of history" Ta "G" Ta "M-<"
1.1       nicm      802: .It Li "Clear selection" Ta "Escape" Ta "C-g"
                    803: .It Li "Copy selection" Ta "Enter" Ta "M-w"
                    804: .It Li "Cursor down" Ta "j" Ta "Down"
1.70      nicm      805: .It Li "Cursor left" Ta "h" Ta "Left"
                    806: .It Li "Cursor right" Ta "l" Ta "Right"
1.116     nicm      807: .It Li "Cursor to bottom line" Ta "L" Ta ""
                    808: .It Li "Cursor to middle line" Ta "M" Ta "M-r"
                    809: .It Li "Cursor to top line" Ta "H" Ta "M-R"
1.70      nicm      810: .It Li "Cursor up" Ta "k" Ta "Up"
1.71      nicm      811: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.227     nicm      812: .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
1.1       nicm      813: .It Li "End of line" Ta "$" Ta "C-e"
1.142     nicm      814: .It Li "Go to line" Ta ":" Ta "g"
1.116     nicm      815: .It Li "Half page down" Ta "C-d" Ta "M-Down"
                    816: .It Li "Half page up" Ta "C-u" Ta "M-Up"
1.157     nicm      817: .It Li "Jump forward" Ta "f" Ta "f"
1.256     nicm      818: .It Li "Jump to forward" Ta "t" Ta ""
1.157     nicm      819: .It Li "Jump backward" Ta "F" Ta "F"
1.256     nicm      820: .It Li "Jump to backward" Ta "T" Ta ""
1.157     nicm      821: .It Li "Jump again" Ta ";" Ta ";"
                    822: .It Li "Jump again in reverse" Ta "," Ta ","
1.1       nicm      823: .It Li "Next page" Ta "C-f" Ta "Page down"
1.146     nicm      824: .It Li "Next space" Ta "W" Ta ""
                    825: .It Li "Next space, end of word" Ta "E" Ta ""
1.143     nicm      826: .It Li "Next word" Ta "w" Ta ""
                    827: .It Li "Next word end" Ta "e" Ta "M-f"
1.70      nicm      828: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.116     nicm      829: .It Li "Previous page" Ta "C-b" Ta "Page up"
1.1       nicm      830: .It Li "Previous word" Ta "b" Ta "M-b"
1.146     nicm      831: .It Li "Previous space" Ta "B" Ta ""
1.1       nicm      832: .It Li "Quit mode" Ta "q" Ta "Escape"
1.147     nicm      833: .It Li "Rectangle toggle" Ta "v" Ta "R"
1.141     nicm      834: .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
                    835: .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
1.70      nicm      836: .It Li "Search again" Ta "n" Ta "n"
1.152     nicm      837: .It Li "Search again in reverse" Ta "N" Ta "N"
1.70      nicm      838: .It Li "Search backward" Ta "?" Ta "C-r"
                    839: .It Li "Search forward" Ta "/" Ta "C-s"
                    840: .It Li "Start of line" Ta "0" Ta "C-a"
1.1       nicm      841: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.142     nicm      842: .It Li "Top of history" Ta "g" Ta "M->"
1.80      nicm      843: .It Li "Transpose chars" Ta "" Ta "C-t"
1.1       nicm      844: .El
1.146     nicm      845: .Pp
                    846: The next and previous word keys use space and the
                    847: .Ql - ,
1.154     nicm      848: .Ql _
1.146     nicm      849: and
                    850: .Ql @
1.154     nicm      851: characters as word delimiters by default, but this can be adjusted by
                    852: setting the
                    853: .Em word-separators
1.255     nicm      854: session option.
1.146     nicm      855: Next word moves to the start of the next word, next word end to the end of the
                    856: next word and previous word to the start of the previous word.
                    857: The three next and previous space keys work similarly but use a space alone as
                    858: the word separator.
1.157     nicm      859: .Pp
                    860: The jump commands enable quick movement within a line.
                    861: For instance, typing
                    862: .Ql f
                    863: followed by
                    864: .Ql /
                    865: will move the cursor to the next
                    866: .Ql /
                    867: character on the current line.
                    868: A
                    869: .Ql \&;
                    870: will then jump to the next occurrence.
1.1       nicm      871: .Pp
1.155     nicm      872: Commands in copy mode may be prefaced by an optional repeat count.
                    873: With vi key bindings, a prefix is entered using the number keys; with
                    874: emacs, the Alt (meta) key and a number begins prefix entry.
                    875: For example, to move the cursor forward by ten words, use
                    876: .Ql M-1 0 M-f
                    877: in emacs mode, and
                    878: .Ql 10w
                    879: in vi.
                    880: .Pp
1.254     nicm      881: When copying the selection, the repeat count indicates the buffer index to
                    882: replace, if used.
                    883: .Pp
1.155     nicm      884: Mode key bindings are defined in a set of named tables:
1.48      nicm      885: .Em vi-edit
                    886: and
                    887: .Em emacs-edit
                    888: for keys used when line editing at the command prompt;
                    889: .Em vi-choice
                    890: and
                    891: .Em emacs-choice
                    892: for keys used when choosing from lists (such as produced by the
1.144     nicm      893: .Ic choose-window
1.164     nicm      894: command); and
1.48      nicm      895: .Em vi-copy
                    896: and
                    897: .Em emacs-copy
1.97      nicm      898: used in copy mode.
1.48      nicm      899: The tables may be viewed with the
                    900: .Ic list-keys
1.49      nicm      901: command and keys modified or removed with
                    902: .Ic bind-key
                    903: and
                    904: .Ic unbind-key .
1.48      nicm      905: .Pp
1.2       nicm      906: The paste buffer key pastes the first line from the top paste buffer on the
                    907: stack.
1.57      jmc       908: .Pp
1.164     nicm      909: The synopsis for the
                    910: .Ic copy-mode
                    911: command is:
1.57      jmc       912: .Bl -tag -width Ds
                    913: .It Xo Ic copy-mode
                    914: .Op Fl u
1.72      nicm      915: .Op Fl t Ar target-pane
1.57      jmc       916: .Xc
                    917: Enter copy mode.
                    918: The
                    919: .Fl u
                    920: option scrolls one page up.
                    921: .El
1.18      nicm      922: .Pp
1.1       nicm      923: Each window displayed by
                    924: .Nm
                    925: may be split into one or more
                    926: .Em panes ;
                    927: each pane takes up a certain area of the display and is a separate terminal.
                    928: A window may be split into panes using the
                    929: .Ic split-window
                    930: command.
1.38      nicm      931: Windows may be split horizontally (with the
                    932: .Fl h
                    933: flag) or vertically.
                    934: Panes may be resized with the
                    935: .Ic resize-pane
1.1       nicm      936: command (bound to
1.38      nicm      937: .Ql C-up ,
                    938: .Ql C-down
                    939: .Ql C-left
                    940: and
                    941: .Ql C-right
1.1       nicm      942: by default), the current pane may be changed with the
1.156     nicm      943: .Ic select-pane
                    944: command and the
1.1       nicm      945: .Ic rotate-window
                    946: and
                    947: .Ic swap-pane
1.38      nicm      948: commands may be used to swap panes without changing their position.
                    949: Panes are numbered beginning from zero in the order they are created.
                    950: .Pp
                    951: A number of preset
                    952: .Em layouts
                    953: are available.
                    954: These may be selected with the
                    955: .Ic select-layout
                    956: command or cycled with
                    957: .Ic next-layout
                    958: (bound to
1.149     nicm      959: .Ql Space
1.131     nicm      960: by default); once a layout is chosen, panes within it may be moved and resized
                    961: as normal.
1.1       nicm      962: .Pp
                    963: The following layouts are supported:
                    964: .Bl -tag -width Ds
                    965: .It Ic even-horizontal
                    966: Panes are spread out evenly from left to right across the window.
                    967: .It Ic even-vertical
                    968: Panes are spread evenly from top to bottom.
1.2       nicm      969: .It Ic main-horizontal
1.131     nicm      970: A large (main) pane is shown at the top of the window and the remaining panes
                    971: are spread from left to right in the leftover space at the bottom.
1.2       nicm      972: Use the
                    973: .Em main-pane-height
                    974: window option to specify the height of the top pane.
1.1       nicm      975: .It Ic main-vertical
1.2       nicm      976: Similar to
                    977: .Ic main-horizontal
                    978: but the large pane is placed on the left and the others spread from top to
                    979: bottom along the right.
                    980: See the
                    981: .Em main-pane-width
                    982: window option.
1.165     nicm      983: .It Ic tiled
                    984: Panes are spread out as evenly as possible over the window in both rows and
                    985: columns.
1.1       nicm      986: .El
1.8       nicm      987: .Pp
1.181     nicm      988: In addition,
                    989: .Ic select-layout
                    990: may be used to apply a previously used layout - the
                    991: .Ic list-windows
                    992: command displays the layout of each window in a form suitable for use with
                    993: .Ic select-layout .
                    994: For example:
                    995: .Bd -literal -offset indent
                    996: $ tmux list-windows
                    997: 0: ksh [159x48]
                    998:     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                    999: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                   1000: .Ed
1.196     nicm     1001: .Pp
1.181     nicm     1002: .Nm
                   1003: automatically adjusts the size of the layout for the current window size.
                   1004: Note that a layout cannot be applied to a window with more panes than that
                   1005: from which the layout was originally defined.
                   1006: .Pp
1.57      jmc      1007: Commands related to windows and panes are as follows:
                   1008: .Bl -tag -width Ds
                   1009: .It Xo Ic break-pane
1.280     nicm     1010: .Op Fl dP
                   1011: .Op Fl F Ar format
1.57      jmc      1012: .Op Fl t Ar target-pane
                   1013: .Xc
                   1014: .D1 (alias: Ic breakp )
                   1015: Break
                   1016: .Ar target-pane
                   1017: off from its containing window to make it the only pane in a new window.
                   1018: If
                   1019: .Fl d
                   1020: is given, the new window does not become the current window.
1.280     nicm     1021: The
                   1022: .Fl P
                   1023: option prints information about the new window after it has been created.
                   1024: By default, it uses the format
                   1025: .Ql #{session_name}:#{window_index}
                   1026: but a different format may be specified with
                   1027: .Fl F .
1.128     nicm     1028: .It Xo Ic capture-pane
                   1029: .Op Fl b Ar buffer-index
1.213     nicm     1030: .Op Fl E Ar end-line
                   1031: .Op Fl S Ar start-line
1.128     nicm     1032: .Op Fl t Ar target-pane
                   1033: .Xc
                   1034: .D1 (alias: Ic capturep )
                   1035: Capture the contents of a pane to the specified buffer, or a new buffer if none
                   1036: is specified.
1.213     nicm     1037: .Pp
                   1038: .Fl S
                   1039: and
                   1040: .Fl E
                   1041: specify the starting and ending line numbers, zero is the first line of the
                   1042: visible pane and negative numbers are lines in the history.
                   1043: The default is to capture only the visible contents of the pane.
1.76      nicm     1044: .It Xo
                   1045: .Ic choose-client
1.294     nicm     1046: .Op Fl F Ar format
1.76      nicm     1047: .Op Fl t Ar target-window
                   1048: .Op Ar template
                   1049: .Xc
                   1050: Put a window into client choice mode, allowing a client to be selected
                   1051: interactively from a list.
                   1052: After a client is chosen,
                   1053: .Ql %%
                   1054: is replaced by the client
                   1055: .Xr pty 4
                   1056: path in
                   1057: .Ar template
                   1058: and the result executed as a command.
                   1059: If
                   1060: .Ar template
                   1061: is not given, "detach-client -t '%%'" is used.
1.294     nicm     1062: For the meaning of the
                   1063: .Fl F
                   1064: flag, see the
                   1065: .Sx FORMATS
                   1066: section.
1.57      jmc      1067: This command works only from inside
                   1068: .Nm .
1.76      nicm     1069: .It Xo
                   1070: .Ic choose-session
1.294     nicm     1071: .Op Fl F Ar format
1.76      nicm     1072: .Op Fl t Ar target-window
                   1073: .Op Ar template
                   1074: .Xc
                   1075: Put a window into session choice mode, where a session may be selected
                   1076: interactively from a list.
                   1077: When one is chosen,
                   1078: .Ql %%
                   1079: is replaced by the session name in
                   1080: .Ar template
                   1081: and the result executed as a command.
                   1082: If
                   1083: .Ar template
                   1084: is not given, "switch-client -t '%%'" is used.
1.294     nicm     1085: For the meaning of the
                   1086: .Fl F
                   1087: flag, see the
                   1088: .Sx FORMATS
                   1089: section.
1.76      nicm     1090: This command works only from inside
                   1091: .Nm .
                   1092: .It Xo
                   1093: .Ic choose-window
1.294     nicm     1094: .Op Fl F Ar format
1.76      nicm     1095: .Op Fl t Ar target-window
                   1096: .Op Ar template
                   1097: .Xc
                   1098: Put a window into window choice mode, where a window may be chosen
                   1099: interactively from a list.
                   1100: After a window is selected,
                   1101: .Ql %%
                   1102: is replaced by the session name and window index in
                   1103: .Ar template
                   1104: and the result executed as a command.
                   1105: If
                   1106: .Ar template
                   1107: is not given, "select-window -t '%%'" is used.
1.294     nicm     1108: For the meaning of the
                   1109: .Fl F
                   1110: flag, see the
                   1111: .Sx FORMATS
                   1112: section.
1.57      jmc      1113: This command works only from inside
                   1114: .Nm .
1.78      nicm     1115: .It Ic display-panes Op Fl t Ar target-client
                   1116: .D1 (alias: Ic displayp)
                   1117: Display a visible indicator of each pane shown by
                   1118: .Ar target-client .
                   1119: See the
1.145     nicm     1120: .Ic display-panes-time ,
                   1121: .Ic display-panes-colour ,
1.78      nicm     1122: and
1.145     nicm     1123: .Ic display-panes-active-colour
1.78      nicm     1124: session options.
1.84      nicm     1125: While the indicator is on screen, a pane may be selected with the
                   1126: .Ql 0
                   1127: to
                   1128: .Ql 9
                   1129: keys.
1.57      jmc      1130: .It Xo Ic find-window
1.285     nicm     1131: .Op Fl CNT
1.294     nicm     1132: .Op Fl F Ar format
1.57      jmc      1133: .Op Fl t Ar target-window
                   1134: .Ar match-string
                   1135: .Xc
                   1136: .D1 (alias: Ic findw )
                   1137: Search for the
                   1138: .Xr fnmatch 3
                   1139: pattern
                   1140: .Ar match-string
                   1141: in window names, titles, and visible content (but not history).
1.285     nicm     1142: The flags control matching behavior:
                   1143: .Fl C
                   1144: matches only visible window contents,
                   1145: .Fl N
                   1146: matches only the window name and
                   1147: .Fl T
                   1148: matches only the window title.
                   1149: The default is
                   1150: .Fl CNT .
                   1151: If only one window is matched, it'll be automatically selected,
                   1152: otherwise a choice list is shown.
1.294     nicm     1153: For the meaning of the
                   1154: .Fl F
                   1155: flag, see the
                   1156: .Sx FORMATS
                   1157: section.
1.57      jmc      1158: This command only works from inside
1.1       nicm     1159: .Nm .
1.137     nicm     1160: .It Xo Ic join-pane
1.277     nicm     1161: .Op Fl bdhv
1.137     nicm     1162: .Oo Fl l
                   1163: .Ar size |
                   1164: .Fl p Ar percentage Oc
                   1165: .Op Fl s Ar src-pane
                   1166: .Op Fl t Ar dst-pane
                   1167: .Xc
                   1168: .D1 (alias: Ic joinp )
                   1169: Like
                   1170: .Ic split-window ,
                   1171: but instead of splitting
                   1172: .Ar dst-pane
                   1173: and creating a new pane, split it and move
                   1174: .Ar src-pane
                   1175: into the space.
                   1176: This can be used to reverse
                   1177: .Ic break-pane .
1.277     nicm     1178: The
                   1179: .Fl b
                   1180: option causes
                   1181: .Ar src-pane
                   1182: to be joined to left of or above
                   1183: .Ar dst-pane .
1.112     nicm     1184: .It Xo Ic kill-pane
                   1185: .Op Fl a
                   1186: .Op Fl t Ar target-pane
                   1187: .Xc
1.57      jmc      1188: .D1 (alias: Ic killp )
                   1189: Destroy the given pane.
                   1190: If no panes remain in the containing window, it is also destroyed.
1.112     nicm     1191: The
                   1192: .Fl a
                   1193: option kills all but the pane given with
                   1194: .Fl t .
1.289     nicm     1195: .It Xo Ic kill-window
                   1196: .Op Fl a
                   1197: .Op Fl t Ar target-window
                   1198: .Xc
1.57      jmc      1199: .D1 (alias: Ic killw )
                   1200: Kill the current window or the window at
                   1201: .Ar target-window ,
1.1       nicm     1202: removing it from any sessions to which it is linked.
1.289     nicm     1203: The
                   1204: .Fl a
                   1205: option kills all but the window given with
                   1206: .Fl t .
1.187     nicm     1207: .It Ic last-pane Op Fl t Ar target-window
                   1208: .D1 (alias: Ic lastp )
                   1209: Select the last (previously selected) pane.
1.56      jmc      1210: .It Ic last-window Op Fl t Ar target-session
1.1       nicm     1211: .D1 (alias: Ic last )
                   1212: Select the last (previously selected) window.
                   1213: If no
                   1214: .Ar target-session
                   1215: is specified, select the last window of the current session.
                   1216: .It Xo Ic link-window
                   1217: .Op Fl dk
                   1218: .Op Fl s Ar src-window
                   1219: .Op Fl t Ar dst-window
                   1220: .Xc
                   1221: .D1 (alias: Ic linkw )
                   1222: Link the window at
                   1223: .Ar src-window
                   1224: to the specified
                   1225: .Ar dst-window .
                   1226: If
                   1227: .Ar dst-window
                   1228: is specified and no such window exists, the
                   1229: .Ar src-window
                   1230: is linked there.
                   1231: If
                   1232: .Fl k
                   1233: is given and
                   1234: .Ar dst-window
                   1235: exists, it is killed, otherwise an error is generated.
                   1236: If
                   1237: .Fl d
                   1238: is given, the newly linked window is not selected.
1.214     nicm     1239: .It Xo Ic list-panes
                   1240: .Op Fl as
1.245     nicm     1241: .Op Fl F Ar format
1.214     nicm     1242: .Op Fl t Ar target
                   1243: .Xc
1.104     nicm     1244: .D1 (alias: Ic lsp )
1.214     nicm     1245: If
                   1246: .Fl a
                   1247: is given,
                   1248: .Ar target
                   1249: is ignored and all panes on the server are listed.
                   1250: If
                   1251: .Fl s
                   1252: is given,
                   1253: .Ar target
                   1254: is a session (or the current session).
                   1255: If neither is given,
                   1256: .Ar target
                   1257: is a window (or the current window).
1.247     nicm     1258: For the meaning of the
                   1259: .Fl F
                   1260: flag, see the
                   1261: .Sx FORMATS
                   1262: section.
1.214     nicm     1263: .It Xo Ic list-windows
                   1264: .Op Fl a
1.245     nicm     1265: .Op Fl F Ar format
1.214     nicm     1266: .Op Fl t Ar target-session
                   1267: .Xc
1.1       nicm     1268: .D1 (alias: Ic lsw )
1.214     nicm     1269: If
                   1270: .Fl a
                   1271: is given, list all windows on the server.
                   1272: Otherwise, list windows in the current session or in
1.1       nicm     1273: .Ar target-session .
1.245     nicm     1274: For the meaning of the
                   1275: .Fl F
                   1276: flag, see the
                   1277: .Sx FORMATS
                   1278: section.
1.277     nicm     1279: .It Xo Ic move-pane
                   1280: .Op Fl bdhv
                   1281: .Oo Fl l
                   1282: .Ar size |
                   1283: .Fl p Ar percentage Oc
                   1284: .Op Fl s Ar src-pane
                   1285: .Op Fl t Ar dst-pane
                   1286: .Xc
                   1287: .D1 (alias: Ic movep )
                   1288: Like
                   1289: .Ic join-pane ,
                   1290: but
                   1291: .Ar src-pane
                   1292: and
                   1293: .Ar dst-pane
                   1294: may belong to the same window.
1.1       nicm     1295: .It Xo Ic move-window
1.291     nicm     1296: .Op Fl rdk
1.1       nicm     1297: .Op Fl s Ar src-window
                   1298: .Op Fl t Ar dst-window
                   1299: .Xc
                   1300: .D1 (alias: Ic movew )
                   1301: This is similar to
                   1302: .Ic link-window ,
                   1303: except the window at
                   1304: .Ar src-window
                   1305: is moved to
                   1306: .Ar dst-window .
1.291     nicm     1307: With
                   1308: .Fl r ,
                   1309: all windows in the session are renumbered in sequential order, respecting
                   1310: the
                   1311: .Ic base-index
                   1312: option.
1.1       nicm     1313: .It Xo Ic new-window
1.201     nicm     1314: .Op Fl adkP
1.272     nicm     1315: .Op Fl c Ar start-directory
1.1       nicm     1316: .Op Fl n Ar window-name
                   1317: .Op Fl t Ar target-window
1.279     nicm     1318: .Op Fl F Ar format
1.153     nicm     1319: .Op Ar shell-command
1.1       nicm     1320: .Xc
                   1321: .D1 (alias: Ic neww )
                   1322: Create a new window.
1.160     nicm     1323: With
                   1324: .Fl a ,
                   1325: the new window is inserted at the next index up from the specified
                   1326: .Ar target-window ,
                   1327: moving windows up if necessary,
                   1328: otherwise
                   1329: .Ar target-window
                   1330: is the new window location.
                   1331: .Pp
1.1       nicm     1332: If
                   1333: .Fl d
                   1334: is given, the session does not make the new window the current window.
                   1335: .Ar target-window
1.28      nicm     1336: represents the window to be created; if the target already exists an error is
                   1337: shown, unless the
                   1338: .Fl k
                   1339: flag is used, in which case it is destroyed.
1.153     nicm     1340: .Ar shell-command
1.1       nicm     1341: is the command to execute.
                   1342: If
1.153     nicm     1343: .Ar shell-command
                   1344: is not specified, the value of the
                   1345: .Ic default-command
                   1346: option is used.
1.272     nicm     1347: .Fl c
                   1348: specifies the working directory in which the new window is created.
                   1349: It may have an absolute path or one of the following values (or a subdirectory):
                   1350: .Bl -column "XXXXXXXXXXXX" "XXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
                   1351: .It Li "Empty string" Ta "Current pane's directory"
                   1352: .It Li "~" Ta "User's home directory"
                   1353: .It Li "-" Ta "Where session was started"
                   1354: .It Li "." Ta "Where server was started"
                   1355: .El
1.153     nicm     1356: .Pp
                   1357: When the shell command completes, the window closes.
                   1358: See the
                   1359: .Ic remain-on-exit
                   1360: option to change this behaviour.
1.1       nicm     1361: .Pp
                   1362: The
                   1363: .Ev TERM
                   1364: environment variable must be set to
                   1365: .Dq screen
                   1366: for all programs running
                   1367: .Em inside
                   1368: .Nm .
                   1369: New windows will automatically have
                   1370: .Dq TERM=screen
                   1371: added to their environment, but care must be taken not to reset this in shell
                   1372: start-up files.
1.201     nicm     1373: .Pp
                   1374: The
                   1375: .Fl P
1.279     nicm     1376: option prints information about the new window after it has been created.
                   1377: By default, it uses the format
                   1378: .Ql #{session_name}:#{window_index}
                   1379: but a different format may be specified with
                   1380: .Fl F .
1.56      jmc      1381: .It Ic next-layout Op Fl t Ar target-window
1.1       nicm     1382: .D1 (alias: Ic nextl )
                   1383: Move a window to the next layout and rearrange the panes to fit.
                   1384: .It Xo Ic next-window
1.9       nicm     1385: .Op Fl a
1.1       nicm     1386: .Op Fl t Ar target-session
                   1387: .Xc
                   1388: .D1 (alias: Ic next )
                   1389: Move to the next window in the session.
1.9       nicm     1390: If
1.12      jmc      1391: .Fl a
1.295     nicm     1392: is used, move to the next window with an alert.
1.107     nicm     1393: .It Xo Ic pipe-pane
                   1394: .Op Fl o
                   1395: .Op Fl t Ar target-pane
1.153     nicm     1396: .Op Ar shell-command
1.107     nicm     1397: .Xc
                   1398: .D1 (alias: Ic pipep )
                   1399: Pipe any output sent by the program in
                   1400: .Ar target-pane
                   1401: to a shell command.
                   1402: A pane may only be piped to one command at a time, any existing pipe is
                   1403: closed before
1.153     nicm     1404: .Ar shell-command
1.107     nicm     1405: is executed.
1.174     nicm     1406: The
                   1407: .Ar shell-command
                   1408: string may contain the special character sequences supported by the
                   1409: .Ic status-left
1.231     nicm     1410: option.
1.107     nicm     1411: If no
1.153     nicm     1412: .Ar shell-command
1.107     nicm     1413: is given, the current pipe (if any) is closed.
                   1414: .Pp
                   1415: The
                   1416: .Fl o
                   1417: option only opens a new pipe if no previous pipe exists, allowing a pipe to
                   1418: be toggled with a single key, for example:
                   1419: .Bd -literal -offset indent
1.174     nicm     1420: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107     nicm     1421: .Ed
1.176     nicm     1422: .It Xo Ic previous-layout
                   1423: .Op Fl t Ar target-window
                   1424: .Xc
                   1425: .D1 (alias: Ic prevl )
                   1426: Move to the previous layout in the session.
1.1       nicm     1427: .It Xo Ic previous-window
1.9       nicm     1428: .Op Fl a
1.1       nicm     1429: .Op Fl t Ar target-session
                   1430: .Xc
                   1431: .D1 (alias: Ic prev )
                   1432: Move to the previous window in the session.
1.9       nicm     1433: With
                   1434: .Fl a ,
1.295     nicm     1435: move to the previous window with an alert.
1.1       nicm     1436: .It Xo Ic rename-window
                   1437: .Op Fl t Ar target-window
                   1438: .Ar new-name
                   1439: .Xc
                   1440: .D1 (alias: Ic renamew )
                   1441: Rename the current window, or the window at
                   1442: .Ar target-window
                   1443: if specified, to
                   1444: .Ar new-name .
                   1445: .It Xo Ic resize-pane
1.39      jmc      1446: .Op Fl DLRU
1.52      nicm     1447: .Op Fl t Ar target-pane
1.1       nicm     1448: .Op Ar adjustment
                   1449: .Xc
                   1450: .D1 (alias: Ic resizep )
1.57      jmc      1451: Resize a pane, upward with
                   1452: .Fl U
                   1453: (the default), downward with
                   1454: .Fl D ,
                   1455: to the left with
                   1456: .Fl L
                   1457: and to the right with
                   1458: .Fl R .
                   1459: The
                   1460: .Ar adjustment
                   1461: is given in lines or cells (the default is 1).
1.234     nicm     1462: .It Xo Ic respawn-pane
                   1463: .Op Fl k
                   1464: .Op Fl t Ar target-pane
                   1465: .Op Ar shell-command
                   1466: .Xc
                   1467: .D1 (alias: Ic respawnp )
                   1468: Reactivate a pane in which the command has exited (see the
                   1469: .Ic remain-on-exit
                   1470: window option).
                   1471: If
                   1472: .Ar shell-command
                   1473: is not given, the command used when the pane was created is executed.
                   1474: The pane must be already inactive, unless
                   1475: .Fl k
                   1476: is given, in which case any existing command is killed.
1.57      jmc      1477: .It Xo Ic respawn-window
                   1478: .Op Fl k
                   1479: .Op Fl t Ar target-window
1.153     nicm     1480: .Op Ar shell-command
1.57      jmc      1481: .Xc
                   1482: .D1 (alias: Ic respawnw )
1.153     nicm     1483: Reactivate a window in which the command has exited (see the
1.57      jmc      1484: .Ic remain-on-exit
                   1485: window option).
                   1486: If
1.153     nicm     1487: .Ar shell-command
1.57      jmc      1488: is not given, the command used when the window was created is executed.
                   1489: The window must be already inactive, unless
                   1490: .Fl k
                   1491: is given, in which case any existing command is killed.
                   1492: .It Xo Ic rotate-window
                   1493: .Op Fl DU
                   1494: .Op Fl t Ar target-window
                   1495: .Xc
                   1496: .D1 (alias: Ic rotatew )
                   1497: Rotate the positions of the panes within a window, either upward (numerically
                   1498: lower) with
                   1499: .Fl U
                   1500: or downward (numerically higher).
                   1501: .It Xo Ic select-layout
1.288     nicm     1502: .Op Fl npUu
1.57      jmc      1503: .Op Fl t Ar target-window
                   1504: .Op Ar layout-name
                   1505: .Xc
1.176     nicm     1506: .D1 (alias: Ic selectl )
1.57      jmc      1507: Choose a specific layout for a window.
                   1508: If
                   1509: .Ar layout-name
1.181     nicm     1510: is not given, the last preset layout used (if any) is reapplied.
1.204     nicm     1511: .Fl n
                   1512: and
                   1513: .Fl p
                   1514: are equivalent to the
                   1515: .Ic next-layout
                   1516: and
                   1517: .Ic previous-layout
                   1518: commands.
1.288     nicm     1519: .Pp
                   1520: .Fl U
                   1521: and
                   1522: .Fl u
                   1523: step forward and back through previous layouts, up to the maximum set by the
                   1524: .Ic layout-history-limit
                   1525: option.
1.156     nicm     1526: .It Xo Ic select-pane
1.204     nicm     1527: .Op Fl lDLRU
1.156     nicm     1528: .Op Fl t Ar target-pane
                   1529: .Xc
1.57      jmc      1530: .D1 (alias: Ic selectp )
                   1531: Make pane
                   1532: .Ar target-pane
                   1533: the active pane in window
                   1534: .Ar target-window .
1.156     nicm     1535: If one of
                   1536: .Fl D ,
                   1537: .Fl L ,
                   1538: .Fl R ,
                   1539: or
                   1540: .Fl U
                   1541: is used, respectively the pane below, to the left, to the right, or above the
                   1542: target pane is used.
1.204     nicm     1543: .Fl l
                   1544: is the same as using the
                   1545: .Ic last-pane
                   1546: command.
                   1547: .It Xo Ic select-window
                   1548: .Op Fl lnp
                   1549: .Op Fl t Ar target-window
                   1550: .Xc
1.57      jmc      1551: .D1 (alias: Ic selectw )
                   1552: Select the window at
                   1553: .Ar target-window .
1.204     nicm     1554: .Fl l ,
                   1555: .Fl n
                   1556: and
                   1557: .Fl p
                   1558: are equivalent to the
                   1559: .Ic last-window ,
                   1560: .Ic next-window
                   1561: and
                   1562: .Ic previous-window
                   1563: commands.
1.57      jmc      1564: .It Xo Ic split-window
1.201     nicm     1565: .Op Fl dhvP
1.272     nicm     1566: .Op Fl c Ar start-directory
1.57      jmc      1567: .Oo Fl l
                   1568: .Ar size |
                   1569: .Fl p Ar percentage Oc
1.136     nicm     1570: .Op Fl t Ar target-pane
1.153     nicm     1571: .Op Ar shell-command
1.279     nicm     1572: .Op Fl F Ar format
1.57      jmc      1573: .Xc
1.176     nicm     1574: .D1 (alias: Ic splitw )
1.136     nicm     1575: Create a new pane by splitting
                   1576: .Ar target-pane :
1.57      jmc      1577: .Fl h
                   1578: does a horizontal split and
                   1579: .Fl v
                   1580: a vertical split; if neither is specified,
                   1581: .Fl v
                   1582: is assumed.
                   1583: The
                   1584: .Fl l
                   1585: and
                   1586: .Fl p
1.136     nicm     1587: options specify the size of the new pane in lines (for vertical split) or in
1.57      jmc      1588: cells (for horizontal split), or as a percentage, respectively.
1.136     nicm     1589: All other options have the same meaning as for the
1.57      jmc      1590: .Ic new-window
                   1591: command.
                   1592: .It Xo Ic swap-pane
                   1593: .Op Fl dDU
                   1594: .Op Fl s Ar src-pane
                   1595: .Op Fl t Ar dst-pane
                   1596: .Xc
                   1597: .D1 (alias: Ic swapp )
                   1598: Swap two panes.
                   1599: If
                   1600: .Fl U
                   1601: is used and no source pane is specified with
                   1602: .Fl s ,
                   1603: .Ar dst-pane
                   1604: is swapped with the previous pane (before it numerically);
                   1605: .Fl D
                   1606: swaps with the next pane (after it numerically).
1.138     nicm     1607: .Fl d
                   1608: instructs
                   1609: .Nm
                   1610: not to change the active pane.
1.57      jmc      1611: .It Xo Ic swap-window
                   1612: .Op Fl d
                   1613: .Op Fl s Ar src-window
                   1614: .Op Fl t Ar dst-window
                   1615: .Xc
                   1616: .D1 (alias: Ic swapw )
                   1617: This is similar to
                   1618: .Ic link-window ,
                   1619: except the source and destination windows are swapped.
                   1620: It is an error if no window exists at
                   1621: .Ar src-window .
                   1622: .It Xo Ic unlink-window
1.1       nicm     1623: .Op Fl k
                   1624: .Op Fl t Ar target-window
                   1625: .Xc
1.57      jmc      1626: .D1 (alias: Ic unlinkw )
                   1627: Unlink
                   1628: .Ar target-window .
                   1629: Unless
                   1630: .Fl k
                   1631: is given, a window may be unlinked only if it is linked to multiple sessions -
                   1632: windows may not be linked to no sessions;
                   1633: if
1.1       nicm     1634: .Fl k
1.57      jmc      1635: is specified and the window is linked to only one session, it is unlinked and
                   1636: destroyed.
                   1637: .El
                   1638: .Sh KEY BINDINGS
1.93      nicm     1639: .Nm
                   1640: allows a command to be bound to most keys, with or without a prefix key.
                   1641: When specifying keys, most represent themselves (for example
                   1642: .Ql A
                   1643: to
1.95      jmc      1644: .Ql Z ) .
1.93      nicm     1645: Ctrl keys may be prefixed with
                   1646: .Ql C-
                   1647: or
1.95      jmc      1648: .Ql ^ ,
                   1649: and Alt (meta) with
1.93      nicm     1650: .Ql M- .
                   1651: In addition, the following special key names are accepted:
1.126     nicm     1652: .Em Up ,
                   1653: .Em Down ,
                   1654: .Em Left ,
                   1655: .Em Right ,
1.93      nicm     1656: .Em BSpace ,
                   1657: .Em BTab ,
                   1658: .Em DC
                   1659: (Delete),
                   1660: .Em End ,
                   1661: .Em Enter ,
                   1662: .Em Escape ,
                   1663: .Em F1
                   1664: to
                   1665: .Em F20 ,
                   1666: .Em Home ,
                   1667: .Em IC
                   1668: (Insert),
1.254     nicm     1669: .Em NPage/PageDown/PgDn ,
                   1670: .Em PPage/PageUp/PgUp ,
1.93      nicm     1671: .Em Space ,
                   1672: and
                   1673: .Em Tab .
                   1674: Note that to bind the
                   1675: .Ql \&"
                   1676: or
                   1677: .Ql '
                   1678: keys, quotation marks are necessary, for example:
                   1679: .Bd -literal -offset indent
                   1680: bind-key '"' split-window
1.167     nicm     1681: bind-key "'" new-window
1.93      nicm     1682: .Ed
                   1683: .Pp
1.57      jmc      1684: Commands related to key bindings are as follows:
                   1685: .Bl -tag -width Ds
                   1686: .It Xo Ic bind-key
                   1687: .Op Fl cnr
                   1688: .Op Fl t Ar key-table
                   1689: .Ar key Ar command Op Ar arguments
1.1       nicm     1690: .Xc
1.57      jmc      1691: .D1 (alias: Ic bind )
                   1692: Bind key
                   1693: .Ar key
                   1694: to
                   1695: .Ar command .
                   1696: By default (without
                   1697: .Fl t )
                   1698: the primary key bindings are modified (those normally activated with the prefix
                   1699: key); in this case, if
                   1700: .Fl n
                   1701: is specified, it is not necessary to use the prefix key,
                   1702: .Ar command
                   1703: is bound to
                   1704: .Ar key
                   1705: alone.
1.1       nicm     1706: The
1.57      jmc      1707: .Fl r
                   1708: flag indicates this key may repeat, see the
                   1709: .Ic repeat-time
                   1710: option.
                   1711: .Pp
                   1712: If
                   1713: .Fl t
                   1714: is present,
                   1715: .Ar key
                   1716: is bound in
                   1717: .Ar key-table :
                   1718: the binding for command mode with
                   1719: .Fl c
                   1720: or for normal mode without.
                   1721: To view the default bindings and possible commands, see the
                   1722: .Ic list-keys
                   1723: command.
                   1724: .It Ic list-keys Op Fl t Ar key-table
                   1725: .D1 (alias: Ic lsk )
                   1726: List all key bindings.
                   1727: Without
                   1728: .Fl t
                   1729: the primary key bindings - those executed when preceded by the prefix key -
                   1730: are printed.
                   1731: Keys bound without the prefix key (see
                   1732: .Ic bind-key
                   1733: .Fl n )
1.119     nicm     1734: are marked with
                   1735: .Ql (no prefix) .
1.57      jmc      1736: .Pp
                   1737: With
                   1738: .Fl t ,
                   1739: the key bindings in
                   1740: .Ar key-table
                   1741: are listed; this may be one of:
                   1742: .Em vi-edit ,
                   1743: .Em emacs-edit ,
                   1744: .Em vi-choice ,
                   1745: .Em emacs-choice ,
                   1746: .Em vi-copy
                   1747: or
                   1748: .Em emacs-copy .
                   1749: .It Xo Ic send-keys
1.273     nicm     1750: .Op Fl lR
1.72      nicm     1751: .Op Fl t Ar target-pane
1.57      jmc      1752: .Ar key Ar ...
1.1       nicm     1753: .Xc
1.57      jmc      1754: .D1 (alias: Ic send )
                   1755: Send a key or keys to a window.
                   1756: Each argument
                   1757: .Ar key
                   1758: is the name of the key (such as
                   1759: .Ql C-a
                   1760: or
                   1761: .Ql npage
                   1762: ) to send; if the string is not recognised as a key, it is sent as a series of
                   1763: characters.
1.273     nicm     1764: The
                   1765: .Fl l
                   1766: flag disables key name lookup and sends the keys literally.
1.57      jmc      1767: All arguments are sent sequentially from first to last.
1.265     nicm     1768: The
                   1769: .Fl R
                   1770: flag causes the terminal state to be reset.
1.267     nicm     1771: .It Xo Ic send-prefix
                   1772: .Op Fl 2
                   1773: .Op Fl t Ar target-pane
                   1774: .Xc
                   1775: Send the prefix key, or with
                   1776: .Fl 2
                   1777: the secondary prefix key, to a window as if it was pressed.
1.57      jmc      1778: .It Xo Ic unbind-key
1.189     nicm     1779: .Op Fl acn
1.57      jmc      1780: .Op Fl t Ar key-table
                   1781: .Ar key
1.2       nicm     1782: .Xc
1.57      jmc      1783: .D1 (alias: Ic unbind )
                   1784: Unbind the command bound to
                   1785: .Ar key .
                   1786: Without
                   1787: .Fl t
                   1788: the primary key bindings are modified; in this case, if
                   1789: .Fl n
                   1790: is specified, the command bound to
                   1791: .Ar key
                   1792: without a prefix (if any) is removed.
1.189     nicm     1793: If
                   1794: .Fl a
                   1795: is present, all key bindings are removed.
1.57      jmc      1796: .Pp
1.47      nicm     1797: If
1.57      jmc      1798: .Fl t
                   1799: is present,
                   1800: .Ar key
                   1801: in
                   1802: .Ar key-table
                   1803: is unbound: the binding for command mode with
                   1804: .Fl c
                   1805: or for normal mode without.
                   1806: .El
                   1807: .Sh OPTIONS
                   1808: The appearance and behaviour of
                   1809: .Nm
                   1810: may be modified by changing the value of various options.
1.133     nicm     1811: There are three types of option:
                   1812: .Em server options ,
1.57      jmc      1813: .Em session options
                   1814: and
                   1815: .Em window options .
                   1816: .Pp
1.133     nicm     1817: The
                   1818: .Nm
                   1819: server has a set of global options which do not apply to any particular
                   1820: window or session.
                   1821: These are altered with the
                   1822: .Ic set-option
                   1823: .Fl s
                   1824: command, or displayed with the
                   1825: .Ic show-options
                   1826: .Fl s
                   1827: command.
                   1828: .Pp
                   1829: In addition, each individual session may have a set of session options, and
                   1830: there is a separate set of global session options.
1.57      jmc      1831: Sessions which do not have a particular option configured inherit the value
                   1832: from the global session options.
                   1833: Session options are set or unset with the
                   1834: .Ic set-option
                   1835: command and may be listed with the
                   1836: .Ic show-options
                   1837: command.
1.133     nicm     1838: The available server and session options are listed under the
1.57      jmc      1839: .Ic set-option
                   1840: command.
                   1841: .Pp
                   1842: Similarly, a set of window options is attached to each window, and there is
                   1843: a set of global window options from which any unset options are inherited.
                   1844: Window options are altered with the
                   1845: .Ic set-window-option
                   1846: command and can be listed with the
                   1847: .Ic show-window-options
                   1848: command.
                   1849: All window options are documented with the
                   1850: .Ic set-window-option
                   1851: command.
                   1852: .Pp
                   1853: Commands which set options are as follows:
                   1854: .Bl -tag -width Ds
1.1       nicm     1855: .It Xo Ic set-option
1.281     nicm     1856: .Op Fl agqsuw
1.129     nicm     1857: .Op Fl t Ar target-session | Ar target-window
1.1       nicm     1858: .Ar option Ar value
                   1859: .Xc
                   1860: .D1 (alias: Ic set )
1.133     nicm     1861: Set a window option with
                   1862: .Fl w
                   1863: (equivalent to the
                   1864: .Ic set-window-option
                   1865: command),
                   1866: a server option with
                   1867: .Fl s ,
                   1868: otherwise a session option.
                   1869: .Pp
                   1870: If
                   1871: .Fl g
                   1872: is specified, the global session or window option is set.
1.58      nicm     1873: With
                   1874: .Fl a ,
                   1875: and if the option expects a string,
                   1876: .Ar value
                   1877: is appended to the existing setting.
1.1       nicm     1878: The
                   1879: .Fl u
                   1880: flag unsets an option, so a session inherits the option from the global
1.133     nicm     1881: options.
                   1882: It is not possible to unset a global option.
1.1       nicm     1883: .Pp
1.281     nicm     1884: The
                   1885: .Fl q
                   1886: flag suppresses the informational message (as if the
                   1887: .Ic quiet
                   1888: server option was set).
                   1889: .Pp
1.133     nicm     1890: Available window options are listed under
                   1891: .Ic set-window-option .
1.274     nicm     1892: .Pp
                   1893: .Ar value
                   1894: depends on the option and may be a number, a string, or a flag (on, off, or
                   1895: omitted to toggle).
1.133     nicm     1896: .Pp
                   1897: Available server options are:
                   1898: .Bl -tag -width Ds
1.198     nicm     1899: .It Ic buffer-limit Ar number
                   1900: Set the number of buffers; as new buffers are added to the top of the stack,
                   1901: old ones are removed from the bottom if necessary to maintain this maximum
                   1902: length.
1.239     nicm     1903: .It Ic escape-time Ar time
                   1904: Set the time in milliseconds for which
                   1905: .Nm
                   1906: waits after an escape is input to determine if it is part of a function or meta
                   1907: key sequences.
                   1908: The default is 500 milliseconds.
                   1909: .It Xo Ic exit-unattached
                   1910: .Op Ic on | off
                   1911: .Xc
                   1912: If enabled, the server will exit when there are no attached clients.
                   1913: .It Xo Ic quiet
                   1914: .Op Ic on | off
                   1915: .Xc
                   1916: Enable or disable the display of various informational messages (see also the
                   1917: .Fl q
                   1918: command line flag).
1.228     nicm     1919: .It Xo Ic set-clipboard
                   1920: .Op Ic on | off
                   1921: .Xc
                   1922: Attempt to set the terminal clipboard content using the
                   1923: \ee]52;...\e007
                   1924: .Xr xterm 1
                   1925: escape sequences.
                   1926: This option is on by default if there is an
                   1927: .Em \&Ms
                   1928: entry in the
                   1929: .Xr terminfo 5
                   1930: description for the client terminal.
                   1931: Note that this feature needs to be enabled in
                   1932: .Xr xterm 1
                   1933: by setting the resource:
                   1934: .Bd -literal -offset indent
                   1935: disallowedWindowOps: 20,21,SetXprop
                   1936: .Ed
                   1937: .Pp
                   1938: Or changing this property from the
                   1939: .Xr xterm 1
                   1940: interactive menu when required.
1.133     nicm     1941: .El
1.129     nicm     1942: .Pp
1.18      nicm     1943: Available session options are:
1.1       nicm     1944: .Bl -tag -width Ds
1.69      nicm     1945: .It Ic base-index Ar index
                   1946: Set the base index from which an unused index should be searched when a new
                   1947: window is created.
                   1948: The default is zero.
1.1       nicm     1949: .It Xo Ic bell-action
1.56      jmc      1950: .Op Ic any | none | current
1.1       nicm     1951: .Xc
                   1952: Set action on window bell.
                   1953: .Ic any
                   1954: means a bell in any window linked to a session causes a bell in the current
                   1955: window of that session,
                   1956: .Ic none
                   1957: means all bells are ignored and
                   1958: .Ic current
                   1959: means only bell in windows other than the current window are ignored.
1.237     nicm     1960: .It Xo Ic bell-on-alert
                   1961: .Op Ic on | off
                   1962: .Xc
1.295     nicm     1963: If on, ring the terminal bell when an alert
1.237     nicm     1964: occurs.
1.153     nicm     1965: .It Ic default-command Ar shell-command
1.1       nicm     1966: Set the command used for new windows (if not specified when the window is
                   1967: created) to
1.153     nicm     1968: .Ar shell-command ,
1.79      nicm     1969: which may be any
                   1970: .Xr sh 1
                   1971: command.
1.19      nicm     1972: The default is an empty string, which instructs
                   1973: .Nm
1.79      nicm     1974: to create a login shell using the value of the
                   1975: .Ic default-shell
                   1976: option.
1.196     nicm     1977: .It Ic default-path Ar path
1.257     nicm     1978: Set the default working directory for new panes.
                   1979: If empty (the default), the working directory is determined from the process
                   1980: running in the active pane, from the command line environment or from the
                   1981: working directory where the session was created.
1.292     nicm     1982: Otherwise the same options are available as for the
                   1983: .Fl c
                   1984: flag to
                   1985: .Ic new-window .
1.79      nicm     1986: .It Ic default-shell Ar path
                   1987: Specify the default shell.
                   1988: This is used as the login shell for new windows when the
                   1989: .Ic default-command
                   1990: option is set to empty, and must be the full path of the executable.
                   1991: When started
                   1992: .Nm
                   1993: tries to set a default value from the first suitable of the
1.19      nicm     1994: .Ev SHELL
1.79      nicm     1995: environment variable, the shell returned by
                   1996: .Xr getpwuid 3 ,
                   1997: or
                   1998: .Pa /bin/sh .
                   1999: This option should be configured when
                   2000: .Nm
                   2001: is used as a login shell.
1.22      nicm     2002: .It Ic default-terminal Ar terminal
                   2003: Set the default terminal for new windows created in this session - the
                   2004: default value of the
                   2005: .Ev TERM
                   2006: environment variable.
                   2007: For
                   2008: .Nm
                   2009: to work correctly, this
                   2010: .Em must
                   2011: be set to
                   2012: .Ql screen
                   2013: or a derivative of it.
1.206     nicm     2014: .It Xo Ic destroy-unattached
                   2015: .Op Ic on | off
                   2016: .Xc
1.185     nicm     2017: If enabled and the session is no longer attached to any clients, it is
                   2018: destroyed.
1.206     nicm     2019: .It Xo Ic detach-on-destroy
                   2020: .Op Ic on | off
                   2021: .Xc
1.184     nicm     2022: If on (the default), the client is detached when the session it is attached to
                   2023: is destroyed.
                   2024: If off, the client is switched to the most recently active of the remaining
                   2025: sessions.
1.145     nicm     2026: .It Ic display-panes-active-colour Ar colour
                   2027: Set the colour used by the
                   2028: .Ic display-panes
                   2029: command to show the indicator for the active pane.
1.78      nicm     2030: .It Ic display-panes-colour Ar colour
1.145     nicm     2031: Set the colour used by the
1.78      nicm     2032: .Ic display-panes
1.145     nicm     2033: command to show the indicators for inactive panes.
1.78      nicm     2034: .It Ic display-panes-time Ar time
                   2035: Set the time in milliseconds for which the indicators shown by the
                   2036: .Ic display-panes
                   2037: command appear.
1.21      nicm     2038: .It Ic display-time Ar time
1.78      nicm     2039: Set the amount of time for which status line messages and other on-screen
                   2040: indicators are displayed.
1.21      nicm     2041: .Ar time
                   2042: is in milliseconds.
1.1       nicm     2043: .It Ic history-limit Ar lines
                   2044: Set the maximum number of lines held in window history.
                   2045: This setting applies only to new windows - existing window histories are not
                   2046: resized and retain the limit at the point they were created.
                   2047: .It Ic lock-after-time Ar number
1.100     nicm     2048: Lock the session (like the
                   2049: .Ic lock-session
1.90      nicm     2050: command) after
1.1       nicm     2051: .Ar number
1.100     nicm     2052: seconds of inactivity, or the entire server (all sessions) if the
                   2053: .Ic lock-server
                   2054: option is set.
                   2055: The default is not to lock (set to 0).
1.153     nicm     2056: .It Ic lock-command Ar shell-command
1.90      nicm     2057: Command to run when locking each client.
                   2058: The default is to run
                   2059: .Xr lock 1
                   2060: with
                   2061: .Fl np .
1.100     nicm     2062: .It Xo Ic lock-server
                   2063: .Op Ic on | off
                   2064: .Xc
                   2065: If this option is
1.102     nicm     2066: .Ic on
1.100     nicm     2067: (the default),
                   2068: instead of each session locking individually as each has been
                   2069: idle for
1.108     jmc      2070: .Ic lock-after-time ,
                   2071: the entire server will lock after
1.100     nicm     2072: .Em all
                   2073: sessions would have locked.
                   2074: This has no effect as a session option; it must be set as a global option.
1.1       nicm     2075: .It Ic message-attr Ar attributes
                   2076: Set status line message attributes, where
                   2077: .Ar attributes
                   2078: is either
1.168     nicm     2079: .Ic none
1.1       nicm     2080: or a comma-delimited list of one or more of:
                   2081: .Ic bright
                   2082: (or
                   2083: .Ic bold ) ,
                   2084: .Ic dim ,
                   2085: .Ic underscore ,
                   2086: .Ic blink ,
                   2087: .Ic reverse ,
                   2088: .Ic hidden ,
                   2089: or
                   2090: .Ic italics .
                   2091: .It Ic message-bg Ar colour
                   2092: Set status line message background colour, where
                   2093: .Ar colour
                   2094: is one of:
                   2095: .Ic black ,
                   2096: .Ic red ,
                   2097: .Ic green ,
                   2098: .Ic yellow ,
                   2099: .Ic blue ,
                   2100: .Ic magenta ,
                   2101: .Ic cyan ,
1.85      nicm     2102: .Ic white ,
1.266     nicm     2103: aixterm bright variants (if supported:
                   2104: .Ic brightred ,
                   2105: .Ic brightgreen ,
                   2106: and so on),
1.85      nicm     2107: .Ic colour0
                   2108: to
                   2109: .Ic colour255
1.205     nicm     2110: from the 256-colour set,
                   2111: .Ic default ,
                   2112: or a hexadecimal RGB string such as
                   2113: .Ql #ffffff ,
                   2114: which chooses the closest match from the default 256-colour set.
1.253     nicm     2115: .It Ic message-command-attr Ar attributes
                   2116: Set status line message attributes when in command mode.
                   2117: .It Ic message-command-bg Ar colour
                   2118: Set status line message background colour when in command mode.
                   2119: .It Ic message-command-fg Ar colour
                   2120: Set status line message foreground colour when in command mode.
1.1       nicm     2121: .It Ic message-fg Ar colour
                   2122: Set status line message foreground colour.
1.120     nicm     2123: .It Ic message-limit Ar number
                   2124: Set the number of error or information messages to save in the message log for
                   2125: each client.
                   2126: The default is 20.
1.226     nicm     2127: .It Xo Ic mouse-resize-pane
                   2128: .Op Ic on | off
                   2129: .Xc
                   2130: If on,
                   2131: .Nm
                   2132: captures the mouse and allows panes to be resized by dragging on their borders.
1.102     nicm     2133: .It Xo Ic mouse-select-pane
                   2134: .Op Ic on | off
                   2135: .Xc
                   2136: If on,
                   2137: .Nm
                   2138: captures the mouse and when a window is split into multiple panes the mouse may
                   2139: be used to select the current pane.
                   2140: The mouse click is also passed through to the application as normal.
1.222     nicm     2141: .It Xo Ic mouse-select-window
                   2142: .Op Ic on | off
                   2143: .Xc
                   2144: If on, clicking the mouse on a window name in the status line will select that
                   2145: window.
1.239     nicm     2146: .It Xo Ic mouse-utf8
                   2147: .Op Ic on | off
                   2148: .Xc
                   2149: If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1.196     nicm     2150: .It Ic pane-active-border-bg Ar colour
                   2151: .It Ic pane-active-border-fg Ar colour
                   2152: Set the pane border colour for the currently active pane.
                   2153: .It Ic pane-border-bg Ar colour
1.135     nicm     2154: .It Ic pane-border-fg Ar colour
                   2155: Set the pane border colour for panes aside from the active pane.
1.267     nicm     2156: .It Ic prefix Ar key
                   2157: Set the key accepted as a prefix key.
                   2158: .It Ic prefix2 Ar key
                   2159: Set a secondary key accepted as a prefix key.
1.291     nicm     2160: .It Xo Ic renumber-windows
                   2161: .Op Ic on | off
                   2162: .Xc
                   2163: If on, when a window is closed in a session, automatically renumber the other
                   2164: windows in numerical order.
                   2165: This respects the
                   2166: .Ic base-index
                   2167: option if it has been set.
                   2168: If off, do not renumber the windows.
1.21      nicm     2169: .It Ic repeat-time Ar time
1.1       nicm     2170: Allow multiple commands to be entered without pressing the prefix-key again
                   2171: in the specified
1.21      nicm     2172: .Ar time
1.1       nicm     2173: milliseconds (the default is 500).
                   2174: Whether a key repeats may be set when it is bound using the
                   2175: .Fl r
                   2176: flag to
                   2177: .Ic bind-key .
1.52      nicm     2178: Repeat is enabled for the default keys bound to the
                   2179: .Ic resize-pane
                   2180: command.
1.1       nicm     2181: .It Xo Ic set-remain-on-exit
1.56      jmc      2182: .Op Ic on | off
1.1       nicm     2183: .Xc
                   2184: Set the
                   2185: .Ic remain-on-exit
                   2186: window option for any windows first created in this session.
1.153     nicm     2187: When this option is true, windows in which the running program has
                   2188: exited do not close, instead remaining open but inactivate.
                   2189: Use the
                   2190: .Ic respawn-window
                   2191: command to reactivate such a window, or the
                   2192: .Ic kill-window
                   2193: command to destroy it.
1.1       nicm     2194: .It Xo Ic set-titles
1.56      jmc      2195: .Op Ic on | off
1.1       nicm     2196: .Xc
1.261     nicm     2197: Attempt to set the client terminal title using the
                   2198: .Em tsl
                   2199: and
                   2200: .Em fsl
                   2201: .Xr terminfo 5
                   2202: entries if they exist.
                   2203: .Nm
                   2204: automatically sets these to the \ee]2;...\e007 sequence if
1.1       nicm     2205: the terminal appears to be an xterm.
1.11      nicm     2206: This option is off by default.
1.6       jmc      2207: Note that elinks
1.1       nicm     2208: will only attempt to set the window title if the STY environment
                   2209: variable is set.
1.86      nicm     2210: .It Ic set-titles-string Ar string
                   2211: String used to set the window title if
                   2212: .Ic set-titles
                   2213: is on.
                   2214: Character sequences are replaced as for the
                   2215: .Ic status-left
                   2216: option.
1.1       nicm     2217: .It Xo Ic status
1.56      jmc      2218: .Op Ic on | off
1.1       nicm     2219: .Xc
                   2220: Show or hide the status line.
                   2221: .It Ic status-attr Ar attributes
                   2222: Set status line attributes.
                   2223: .It Ic status-bg Ar colour
                   2224: Set status line background colour.
                   2225: .It Ic status-fg Ar colour
                   2226: Set status line foreground colour.
                   2227: .It Ic status-interval Ar interval
                   2228: Update the status bar every
                   2229: .Ar interval
                   2230: seconds.
                   2231: By default, updates will occur every 15 seconds.
                   2232: A setting of zero disables redrawing at interval.
1.41      nicm     2233: .It Xo Ic status-justify
1.56      jmc      2234: .Op Ic left | centre | right
1.41      nicm     2235: .Xc
                   2236: Set the position of the window list component of the status line: left, centre
                   2237: or right justified.
1.1       nicm     2238: .It Xo Ic status-keys
1.56      jmc      2239: .Op Ic vi | emacs
1.1       nicm     2240: .Xc
1.6       jmc      2241: Use vi or emacs-style
1.1       nicm     2242: key bindings in the status line, for example at the command prompt.
1.191     nicm     2243: The default is emacs, unless the
                   2244: .Ev VISUAL
                   2245: or
                   2246: .Ev EDITOR
                   2247: environment variables are set and contain the string
                   2248: .Ql vi .
1.1       nicm     2249: .It Ic status-left Ar string
                   2250: Display
                   2251: .Ar string
                   2252: to the left of the status bar.
                   2253: .Ar string
                   2254: will be passed through
                   2255: .Xr strftime 3
                   2256: before being used.
                   2257: By default, the session name is shown.
                   2258: .Ar string
1.83      nicm     2259: may contain any of the following special character sequences:
1.1       nicm     2260: .Bl -column "Character pair" "Replaced with" -offset indent
                   2261: .It Sy "Character pair" Ta Sy "Replaced with"
1.153     nicm     2262: .It Li "#(shell-command)" Ta "First line of the command's output"
1.83      nicm     2263: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1       nicm     2264: .It Li "#H" Ta "Hostname of local host"
1.224     nicm     2265: .It Li "#h" Ta "Hostname of local host without the domain name"
1.125     nicm     2266: .It Li "#F" Ta "Current window flag"
1.35      nicm     2267: .It Li "#I" Ta "Current window index"
                   2268: .It Li "#P" Ta "Current pane index"
1.1       nicm     2269: .It Li "#S" Ta "Session name"
1.261     nicm     2270: .It Li "#T" Ta "Current pane title"
1.35      nicm     2271: .It Li "#W" Ta "Current window name"
1.1       nicm     2272: .It Li "##" Ta "A literal" Ql #
                   2273: .El
1.83      nicm     2274: .Pp
1.153     nicm     2275: The #(shell-command) form executes
                   2276: .Ql shell-command
                   2277: and inserts the first line of its output.
1.103     nicm     2278: Note that shell commands are only executed once at the interval specified by
                   2279: the
                   2280: .Ic status-interval
                   2281: option: if the status line is redrawn in the meantime, the previous result is
                   2282: used.
1.161     nicm     2283: Shell commands are executed with the
                   2284: .Nm
                   2285: global environment set (see the
1.162     jmc      2286: .Sx ENVIRONMENT
                   2287: section).
1.163     nicm     2288: .Pp
1.263     nicm     2289: For details on how the names and titles can be set see the
1.261     nicm     2290: .Sx "NAMES AND TITLES"
                   2291: section.
1.109     nicm     2292: .Pp
1.83      nicm     2293: #[attributes] allows a comma-separated list of attributes to be specified,
                   2294: these may be
                   2295: .Ql fg=colour
                   2296: to set the foreground colour,
                   2297: .Ql bg=colour
1.131     nicm     2298: to set the background colour, the name of one of the attributes (listed under
                   2299: the
1.83      nicm     2300: .Ic message-attr
1.109     nicm     2301: option) to turn an attribute on, or an attribute prefixed with
                   2302: .Ql no
                   2303: to turn one off, for example
                   2304: .Ic nobright .
1.83      nicm     2305: Examples are:
                   2306: .Bd -literal -offset indent
                   2307: #(sysctl vm.loadavg)
                   2308: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
                   2309: .Ed
1.1       nicm     2310: .Pp
1.109     nicm     2311: Where appropriate, special character sequences may be prefixed with a number to
                   2312: specify the maximum length, for example
1.1       nicm     2313: .Ql #24T .
1.10      nicm     2314: .Pp
1.12      jmc      2315: By default, UTF-8 in
1.10      nicm     2316: .Ar string
                   2317: is not interpreted, to enable UTF-8, use the
                   2318: .Ic status-utf8
                   2319: option.
1.62      nicm     2320: .It Ic status-left-attr Ar attributes
1.66      jmc      2321: Set the attribute of the left part of the status line.
1.196     nicm     2322: .It Ic status-left-bg Ar colour
                   2323: Set the background colour of the left part of the status line.
1.62      nicm     2324: .It Ic status-left-fg Ar colour
                   2325: Set the foreground colour of the left part of the status line.
1.1       nicm     2326: .It Ic status-left-length Ar length
                   2327: Set the maximum
                   2328: .Ar length
                   2329: of the left component of the status bar.
                   2330: The default is 10.
1.269     nicm     2331: .It Xo Ic status-position
                   2332: .Op Ic top | bottom
                   2333: .Xc
                   2334: Set the position of the status line.
1.1       nicm     2335: .It Ic status-right Ar string
                   2336: Display
                   2337: .Ar string
                   2338: to the right of the status bar.
1.151     nicm     2339: By default, the current window title in double quotes, the date and the time
                   2340: are shown.
1.1       nicm     2341: As with
                   2342: .Ic status-left ,
                   2343: .Ar string
                   2344: will be passed to
1.10      nicm     2345: .Xr strftime 3 ,
                   2346: character pairs are replaced, and UTF-8 is dependent on the
                   2347: .Ic status-utf8
                   2348: option.
1.62      nicm     2349: .It Ic status-right-attr Ar attributes
1.66      jmc      2350: Set the attribute of the right part of the status line.
1.196     nicm     2351: .It Ic status-right-bg Ar colour
                   2352: Set the background colour of the right part of the status line.
1.62      nicm     2353: .It Ic status-right-fg Ar colour
                   2354: Set the foreground colour of the right part of the status line.
1.1       nicm     2355: .It Ic status-right-length Ar length
                   2356: Set the maximum
                   2357: .Ar length
                   2358: of the right component of the status bar.
                   2359: The default is 40.
1.10      nicm     2360: .It Xo Ic status-utf8
1.56      jmc      2361: .Op Ic on | off
1.10      nicm     2362: .Xc
                   2363: Instruct
                   2364: .Nm
                   2365: to treat top-bit-set characters in the
                   2366: .Ic status-left
                   2367: and
                   2368: .Ic status-right
                   2369: strings as UTF-8; notably, this is important for wide characters.
                   2370: This option defaults to off.
1.55      jmc      2371: .It Ic terminal-overrides Ar string
1.54      nicm     2372: Contains a list of entries which override terminal descriptions read using
                   2373: .Xr terminfo 5 .
                   2374: .Ar string
                   2375: is a comma-separated list of items each a colon-separated string made up of a
                   2376: terminal type pattern (matched using
                   2377: .Xr fnmatch 3 )
                   2378: and a set of
                   2379: .Em name=value
                   2380: entries.
                   2381: .Pp
                   2382: For example, to set the
                   2383: .Ql clear
                   2384: .Xr terminfo 5
                   2385: entry to
                   2386: .Ql \ee[H\ee[2J
                   2387: for all terminal types and the
                   2388: .Ql dch1
                   2389: entry to
                   2390: .Ql \ee[P
1.55      jmc      2391: for the
1.54      nicm     2392: .Ql rxvt
                   2393: terminal type, the option could be set to the string:
                   2394: .Bd -literal -offset indent
                   2395: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
                   2396: .Ed
                   2397: .Pp
                   2398: The terminal entry value is passed through
                   2399: .Xr strunvis 3
                   2400: before interpretation.
                   2401: The default value forcibly corrects the
                   2402: .Ql colors
                   2403: entry for terminals which support 88 or 256 colours:
                   2404: .Bd -literal -offset indent
1.225     nicm     2405: "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
1.54      nicm     2406: .Ed
1.63      nicm     2407: .It Ic update-environment Ar variables
                   2408: Set a space-separated string containing a list of environment variables to be
                   2409: copied into the session environment when a new session is created or an
                   2410: existing session is attached.
                   2411: Any variables that do not exist in the source environment are set to be
                   2412: removed from the session environment (as if
                   2413: .Fl r
                   2414: was given to the
                   2415: .Ic set-environment
                   2416: command).
                   2417: The default is
1.190     nicm     2418: "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
                   2419: XAUTHORITY".
1.37      nicm     2420: .It Xo Ic visual-activity
1.56      jmc      2421: .Op Ic on | off
1.37      nicm     2422: .Xc
                   2423: If on, display a status line message when activity occurs in a window
1.39      jmc      2424: for which the
1.37      nicm     2425: .Ic monitor-activity
                   2426: window option is enabled.
                   2427: .It Xo Ic visual-bell
1.56      jmc      2428: .Op Ic on | off
1.37      nicm     2429: .Xc
                   2430: If this option is on, a message is shown on a bell instead of it being passed
                   2431: through to the terminal (which normally makes a sound).
                   2432: Also see the
                   2433: .Ic bell-action
                   2434: option.
                   2435: .It Xo Ic visual-content
1.56      jmc      2436: .Op Ic on | off
1.37      nicm     2437: .Xc
                   2438: Like
                   2439: .Ic visual-activity ,
                   2440: display a message when content is present in a window
1.39      jmc      2441: for which the
1.37      nicm     2442: .Ic monitor-content
                   2443: window option is enabled.
1.192     nicm     2444: .It Xo Ic visual-silence
                   2445: .Op Ic on | off
                   2446: .Xc
                   2447: If
                   2448: .Ic monitor-silence
                   2449: is enabled, prints a message after the interval has expired on a given window.
1.255     nicm     2450: .It Ic word-separators Ar string
                   2451: Sets the session's conception of what characters are considered word
                   2452: separators, for the purposes of the next and previous word commands in
                   2453: copy mode.
                   2454: The default is
                   2455: .Ql \ -_@ .
1.1       nicm     2456: .El
                   2457: .It Xo Ic set-window-option
1.281     nicm     2458: .Op Fl agqu
1.1       nicm     2459: .Op Fl t Ar target-window
                   2460: .Ar option Ar value
                   2461: .Xc
                   2462: .D1 (alias: Ic setw )
1.18      nicm     2463: Set a window option.
1.1       nicm     2464: The
1.58      nicm     2465: .Fl a ,
1.281     nicm     2466: .Fl g ,
                   2467: .Fl q
1.1       nicm     2468: and
                   2469: .Fl u
                   2470: flags work similarly to the
                   2471: .Ic set-option
                   2472: command.
                   2473: .Pp
1.18      nicm     2474: Supported window options are:
1.56      jmc      2475: .Pp
                   2476: .Bl -tag -width Ds -compact
1.1       nicm     2477: .It Xo Ic aggressive-resize
1.56      jmc      2478: .Op Ic on | off
1.1       nicm     2479: .Xc
                   2480: Aggressively resize the chosen window.
                   2481: This means that
                   2482: .Nm
                   2483: will resize the window to the size of the smallest session for which it is the
                   2484: current window, rather than the smallest session to which it is attached.
                   2485: The window may resize when the current window is changed on another sessions;
1.6       jmc      2486: this option is good for full-screen programs which support
                   2487: .Dv SIGWINCH
                   2488: and poor for interactive programs such as shells.
1.262     nicm     2489: .Pp
                   2490: .It Xo Ic allow-rename
                   2491: .Op Ic on | off
                   2492: .Xc
                   2493: Allow programs to change the window name using a terminal escape
                   2494: sequence (\\033k...\\033\\\\).
                   2495: The default is on.
1.56      jmc      2496: .Pp
1.196     nicm     2497: .It Xo Ic alternate-screen
                   2498: .Op Ic on | off
                   2499: .Xc
                   2500: This option configures whether programs running inside
                   2501: .Nm
                   2502: may use the terminal alternate screen feature, which allows the
                   2503: .Em smcup
                   2504: and
                   2505: .Em rmcup
                   2506: .Xr terminfo 5
1.209     nicm     2507: capabilities.
                   2508: The alternate screen feature preserves the contents of the window when an
                   2509: interactive application starts and restores it on exit, so that any output
                   2510: visible before the application starts reappears unchanged after it exits.
                   2511: The default is on.
1.196     nicm     2512: .Pp
1.1       nicm     2513: .It Xo Ic automatic-rename
1.56      jmc      2514: .Op Ic on | off
1.1       nicm     2515: .Xc
                   2516: Control automatic window renaming.
                   2517: When this setting is enabled,
                   2518: .Nm
                   2519: will attempt - on supported platforms - to rename the window to reflect the
                   2520: command currently running in it.
                   2521: This flag is automatically disabled for an individual window when a name
                   2522: is specified at creation with
1.186     nicm     2523: .Ic new-window
                   2524: or
1.1       nicm     2525: .Ic new-session ,
                   2526: or later with
1.261     nicm     2527: .Ic rename-window ,
                   2528: or with a terminal escape sequence.
1.1       nicm     2529: It may be switched off globally with:
                   2530: .Bd -literal -offset indent
                   2531: set-window-option -g automatic-rename off
                   2532: .Ed
1.283     nicm     2533: .Pp
                   2534: .It Ic c0-change-interval Ar interval
                   2535: .It Ic c0-change-trigger Ar trigger
                   2536: These two options configure a simple form of rate limiting for a pane.
                   2537: If
                   2538: .Nm
                   2539: sees more than
                   2540: .Ar trigger
                   2541: C0 sequences that modify the screen (for example, carriage returns, linefeeds
                   2542: or backspaces) in one millisecond, it will stop updating the pane immediately and
                   2543: instead redraw it entirely every
                   2544: .Ar interval
                   2545: milliseconds.
                   2546: This helps to prevent fast output (such as
                   2547: .Xr yes 1
                   2548: overwhelming the terminal).
1.284     nicm     2549: The default is a trigger of 250 and an interval of 100.
1.283     nicm     2550: A trigger of zero disables the rate limiting.
1.56      jmc      2551: .Pp
1.1       nicm     2552: .It Ic clock-mode-colour Ar colour
                   2553: Set clock colour.
1.56      jmc      2554: .Pp
1.1       nicm     2555: .It Xo Ic clock-mode-style
1.56      jmc      2556: .Op Ic 12 | 24
1.1       nicm     2557: .Xc
                   2558: Set clock hour format.
1.56      jmc      2559: .Pp
1.1       nicm     2560: .It Ic force-height Ar height
                   2561: .It Ic force-width Ar width
                   2562: Prevent
                   2563: .Nm
                   2564: from resizing a window to greater than
                   2565: .Ar width
                   2566: or
                   2567: .Ar height .
                   2568: A value of zero restores the default unlimited setting.
1.288     nicm     2569: .Pp
                   2570: .It Ic layout-history-limit Ar limit
                   2571: Set the number of previous layouts stored for recovery with
                   2572: .Ic select-layout
                   2573: .Fl U
                   2574: and
                   2575: .Fl u .
1.56      jmc      2576: .Pp
1.196     nicm     2577: .It Ic main-pane-height Ar height
1.2       nicm     2578: .It Ic main-pane-width Ar width
                   2579: Set the width or height of the main (left or top) pane in the
                   2580: .Ic main-horizontal
                   2581: or
                   2582: .Ic main-vertical
                   2583: layouts.
1.56      jmc      2584: .Pp
1.1       nicm     2585: .It Ic mode-attr Ar attributes
                   2586: Set window modes attributes.
1.56      jmc      2587: .Pp
1.1       nicm     2588: .It Ic mode-bg Ar colour
                   2589: Set window modes background colour.
1.56      jmc      2590: .Pp
1.1       nicm     2591: .It Ic mode-fg Ar colour
                   2592: Set window modes foreground colour.
1.56      jmc      2593: .Pp
1.1       nicm     2594: .It Xo Ic mode-keys
1.56      jmc      2595: .Op Ic vi | emacs
1.1       nicm     2596: .Xc
1.105     nicm     2597: Use vi or emacs-style key bindings in copy and choice modes.
1.191     nicm     2598: As with the
                   2599: .Ic status-keys
                   2600: option, the default is emacs, unless
                   2601: .Ev VISUAL
                   2602: or
                   2603: .Ev EDITOR
                   2604: contains
                   2605: .Ql vi .
1.56      jmc      2606: .Pp
1.50      nicm     2607: .It Xo Ic mode-mouse
1.240     nicm     2608: .Op Ic on | off | copy-mode
1.50      nicm     2609: .Xc
1.51      jmc      2610: Mouse state in modes.
1.223     nicm     2611: If on, the mouse may be used to enter copy mode and copy a selection by
                   2612: dragging, to enter copy mode and scroll with the mouse wheel, or to select an
                   2613: option in choice mode.
1.240     nicm     2614: If set to
1.241     jmc      2615: .Em copy-mode ,
1.240     nicm     2616: the mouse behaves as set to on, but cannot be used to enter copy
                   2617: mode.
1.56      jmc      2618: .Pp
1.1       nicm     2619: .It Xo Ic monitor-activity
1.56      jmc      2620: .Op Ic on | off
1.1       nicm     2621: .Xc
                   2622: Monitor for activity in the window.
                   2623: Windows with activity are highlighted in the status line.
1.56      jmc      2624: .Pp
                   2625: .It Ic monitor-content Ar match-string
1.6       jmc      2626: Monitor content in the window.
                   2627: When
1.16      nicm     2628: .Xr fnmatch 3
                   2629: pattern
1.1       nicm     2630: .Ar match-string
                   2631: appears in the window, it is highlighted in the status line.
1.56      jmc      2632: .Pp
1.192     nicm     2633: .It Xo Ic monitor-silence
                   2634: .Op Ic interval
                   2635: .Xc
                   2636: Monitor for silence (no activity) in the window within
                   2637: .Ic interval
                   2638: seconds.
                   2639: Windows that have been silent for the interval are highlighted in the
                   2640: status line.
                   2641: An interval of zero disables the monitoring.
1.195     nicm     2642: .Pp
                   2643: .It Ic other-pane-height Ar height
                   2644: Set the height of the other panes (not the main pane) in the
                   2645: .Ic main-horizontal
                   2646: layout.
                   2647: If this option is set to 0 (the default), it will have no effect.
                   2648: If both the
                   2649: .Ic main-pane-height
                   2650: and
                   2651: .Ic other-pane-height
                   2652: options are set, the main pane will grow taller to make the other panes the
                   2653: specified height, but will never shrink to do so.
                   2654: .Pp
                   2655: .It Ic other-pane-width Ar width
                   2656: Like
                   2657: .Ic other-pane-height ,
                   2658: but set the width of other panes in the
                   2659: .Ic main-vertical
                   2660: layout.
1.243     nicm     2661: .Pp
                   2662: .It Ic pane-base-index Ar index
                   2663: Like
                   2664: .Ic base-index ,
                   2665: but set the starting index for pane numbers.
1.192     nicm     2666: .Pp
1.1       nicm     2667: .It Xo Ic remain-on-exit
1.56      jmc      2668: .Op Ic on | off
1.1       nicm     2669: .Xc
                   2670: A window with this flag set is not destroyed when the program running in it
                   2671: exits.
                   2672: The window may be reactivated with the
                   2673: .Ic respawn-window
                   2674: command.
1.56      jmc      2675: .Pp
1.99      nicm     2676: .It Xo Ic synchronize-panes
                   2677: .Op Ic on | off
                   2678: .Xc
1.164     nicm     2679: Duplicate input to any pane to all other panes in the same window (only
                   2680: for panes that are not in any special mode).
1.139     nicm     2681: .Pp
1.1       nicm     2682: .It Xo Ic utf8
1.56      jmc      2683: .Op Ic on | off
1.1       nicm     2684: .Xc
                   2685: Instructs
                   2686: .Nm
                   2687: to expect UTF-8 sequences to appear in this window.
1.56      jmc      2688: .Pp
1.264     nicm     2689: .It Ic window-status-bell-attr Ar attributes
                   2690: Set status line attributes for windows which have a bell alert.
1.169     nicm     2691: .Pp
1.264     nicm     2692: .It Ic window-status-bell-bg Ar colour
                   2693: Set status line background colour for windows with a bell alert.
1.169     nicm     2694: .Pp
1.264     nicm     2695: .It Ic window-status-bell-fg Ar colour
                   2696: Set status line foreground colour for windows with a bell alert.
                   2697: .Pp
                   2698: .It Ic window-status-content-attr Ar attributes
                   2699: Set status line attributes for windows which have a content alert.
                   2700: .Pp
                   2701: .It Ic window-status-content-bg Ar colour
                   2702: Set status line background colour for windows with a content alert.
                   2703: .Pp
                   2704: .It Ic window-status-content-fg Ar colour
                   2705: Set status line foreground colour for windows with a content alert.
                   2706: .Pp
                   2707: .It Ic window-status-activity-attr Ar attributes
                   2708: Set status line attributes for windows which have an activity (or silence) alert.
                   2709: .Pp
                   2710: .It Ic window-status-activity-bg Ar colour
                   2711: Set status line background colour for windows with an activity alert.
                   2712: .Pp
                   2713: .It Ic window-status-activity-fg Ar colour
                   2714: Set status line foreground colour for windows with an activity alert.
1.125     nicm     2715: .Pp
1.239     nicm     2716: .It Ic window-status-attr Ar attributes
                   2717: Set status line attributes for a single window.
                   2718: .Pp
                   2719: .It Ic window-status-bg Ar colour
                   2720: Set status line background colour for a single window.
                   2721: .Pp
1.40      nicm     2722: .It Ic window-status-current-attr Ar attributes
                   2723: Set status line attributes for the currently active window.
1.56      jmc      2724: .Pp
1.40      nicm     2725: .It Ic window-status-current-bg Ar colour
                   2726: Set status line background colour for the currently active window.
1.56      jmc      2727: .Pp
1.40      nicm     2728: .It Ic window-status-current-fg Ar colour
                   2729: Set status line foreground colour for the currently active window.
1.56      jmc      2730: .Pp
1.125     nicm     2731: .It Ic window-status-current-format Ar string
                   2732: Like
                   2733: .Ar window-status-format ,
                   2734: but is the format used when the window is the current window.
1.239     nicm     2735: .Pp
                   2736: .It Ic window-status-fg Ar colour
                   2737: Set status line foreground colour for a single window.
                   2738: .Pp
                   2739: .It Ic window-status-format Ar string
                   2740: Set the format in which the window is displayed in the status line window list.
                   2741: See the
                   2742: .Ar status-left
                   2743: option for details of special character sequences available.
                   2744: The default is
                   2745: .Ql #I:#W#F .
1.290     nicm     2746: .Pp
                   2747: .It Ic window-status-separator Ar string
                   2748: Sets the separator drawn between windows in the status line.
                   2749: The default is a single space character.
1.125     nicm     2750: .Pp
1.1       nicm     2751: .It Xo Ic xterm-keys
1.56      jmc      2752: .Op Ic on | off
1.1       nicm     2753: .Xc
                   2754: If this option is set,
                   2755: .Nm
                   2756: will generate
1.57      jmc      2757: .Xr xterm 1 -style
                   2758: function key sequences; these have a number included to indicate modifiers such
                   2759: as Shift, Alt or Ctrl.
1.123     nicm     2760: The default is off.
1.282     nicm     2761: .Pp
                   2762: .It Xo Ic wrap-search
                   2763: .Op Ic on | off
                   2764: .Xc
                   2765: If this option is set, searches will wrap around the end of the pane contents.
                   2766: The default is on.
1.57      jmc      2767: .El
                   2768: .It Xo Ic show-options
1.133     nicm     2769: .Op Fl gsw
1.129     nicm     2770: .Op Fl t Ar target-session | Ar target-window
1.276     nicm     2771: .Op Ar option
1.57      jmc      2772: .Xc
                   2773: .D1 (alias: Ic show )
1.276     nicm     2774: Show the window options (or a single window option if given) with
1.129     nicm     2775: .Fl w
1.133     nicm     2776: (equivalent to
1.134     nicm     2777: .Ic show-window-options ) ,
1.133     nicm     2778: the server options with
                   2779: .Fl s ,
                   2780: otherwise the session options for
                   2781: .Ar target session .
                   2782: Global session or window options are listed if
                   2783: .Fl g
                   2784: is used.
1.57      jmc      2785: .It Xo Ic show-window-options
                   2786: .Op Fl g
                   2787: .Op Fl t Ar target-window
1.276     nicm     2788: .Op Ar option
1.57      jmc      2789: .Xc
                   2790: .D1 (alias: Ic showw )
1.276     nicm     2791: List the window options or a single option for
1.57      jmc      2792: .Ar target-window ,
                   2793: or the global window options if
                   2794: .Fl g
                   2795: is used.
1.63      nicm     2796: .El
1.245     nicm     2797: .Sh FORMATS
1.294     nicm     2798: Certain commands accept the
1.245     nicm     2799: .Fl F
                   2800: flag with a
                   2801: .Ar format
                   2802: argument.
                   2803: This is a string which controls the output format of the command.
                   2804: Special character sequences are replaced as documented under the
                   2805: .Ic status-left
                   2806: option and an additional long form is accepted.
                   2807: Replacement variables are enclosed in
                   2808: .Ql #{
                   2809: and
                   2810: .Ql } ,
                   2811: for example
                   2812: .Ql #{session_name}
                   2813: is equivalent to
                   2814: .Ql #S .
                   2815: Conditionals are also accepted by prefixing with
1.246     jmc      2816: .Ql \&?
1.245     nicm     2817: and separating two alternatives with a comma;
                   2818: if the specified variable exists and is not zero, the first alternative
1.246     jmc      2819: is chosen, otherwise the second is used.
                   2820: For example
1.245     nicm     2821: .Ql #{?session_attached,attached,not attached}
                   2822: will include the string
                   2823: .Ql attached
                   2824: if the session is attached and the string
                   2825: .Ql not attached
                   2826: if it is unattached.
                   2827: .Pp
                   2828: The following variables are available, where appropriate:
                   2829: .Bl -column "session_created_string" "Replaced with" -offset indent
                   2830: .It Sy "Variable name" Ta Sy "Replaced with"
1.294     nicm     2831: .It Li "buffer_sample" Ta "First 50 characters from the specified buffer"
                   2832: .It Li "buffer_size" Ta "Size of the specified buffer in bytes"
1.250     nicm     2833: .It Li "client_activity" Ta "Integer time client last had activity"
                   2834: .It Li "client_activity_string" Ta "String time client last had activity"
                   2835: .It Li "client_created" Ta "Integer time client created"
                   2836: .It Li "client_created_string" Ta "String time client created"
                   2837: .It Li "client_cwd" Ta "Working directory of client"
                   2838: .It Li "client_height" Ta "Height of client"
                   2839: .It Li "client_readonly" Ta "1 if client is readonly"
                   2840: .It Li "client_termname" Ta "Terminal name of client"
                   2841: .It Li "client_tty" Ta "Pseudo terminal of client"
                   2842: .It Li "client_utf8" Ta "1 if client supports utf8"
                   2843: .It Li "client_width" Ta "Width of client"
1.245     nicm     2844: .It Li "host" Ta "Hostname of local host"
                   2845: .It Li "line" Ta "Line number in the list"
                   2846: .It Li "pane_active" Ta "1 if active pane"
1.287     nicm     2847: .It Li "pane_current_path" Ta "Current path if available"
1.245     nicm     2848: .It Li "pane_dead" Ta "1 if pane is dead"
                   2849: .It Li "pane_height" Ta "Height of pane"
1.271     jmc      2850: .It Li "pane_id" Ta "Unique pane ID"
1.249     nicm     2851: .It Li "pane_pid" Ta "PID of first process in pane"
                   2852: .It Li "pane_start_command" Ta "Command pane started with"
                   2853: .It Li "pane_start_path" Ta "Path pane started with"
1.245     nicm     2854: .It Li "pane_title" Ta "Title of pane"
1.249     nicm     2855: .It Li "pane_tty" Ta "Pseudo terminal of pane"
1.245     nicm     2856: .It Li "pane_width" Ta "Width of pane"
                   2857: .It Li "session_attached" Ta "1 if session attached"
                   2858: .It Li "session_created" Ta "Integer time session created"
                   2859: .It Li "session_created_string" Ta "String time session created"
                   2860: .It Li "session_group" Ta "Number of session group"
                   2861: .It Li "session_grouped" Ta "1 if session in a group"
                   2862: .It Li "session_height" Ta "Height of session"
                   2863: .It Li "session_name" Ta "Name of session"
                   2864: .It Li "session_width" Ta "Width of session"
                   2865: .It Li "session_windows" Ta "Number of windows in session"
                   2866: .It Li "window_active" Ta "1 if window active"
1.294     nicm     2867: .It Li "window_find_matches" Ta "Matched data from the find-window command if available"
1.245     nicm     2868: .It Li "window_flags" Ta "Window flags"
                   2869: .It Li "window_height" Ta "Height of window"
                   2870: .It Li "window_index" Ta "Index of window"
                   2871: .It Li "window_layout" Ta "Window layout description"
                   2872: .It Li "window_name" Ta "Name of window"
1.294     nicm     2873: .It Li "window_panes" Ta "Number of panes in window"
1.245     nicm     2874: .It Li "window_width" Ta "Width of window"
                   2875: .El
1.261     nicm     2876: .Sh NAMES AND TITLES
                   2877: .Nm
                   2878: distinguishes between names and titles.
                   2879: Windows and sessions have names, which may be used to specify them in targets
                   2880: and are displayed in the status line and various lists: the name is the
                   2881: .Nm
                   2882: identifier for a window or session.
                   2883: Only panes have titles.
                   2884: A pane's title is typically set by the program running inside the pane and
                   2885: is not modified by
                   2886: .Nm .
                   2887: It is the same mechanism used to set for example the
                   2888: .Xr xterm 1
                   2889: window title in an
                   2890: .Xr X 7
                   2891: window manager.
1.268     nicm     2892: Windows themselves do not have titles - a window's title is the title of its
1.261     nicm     2893: active pane.
                   2894: .Nm
                   2895: itself may set the title of the terminal in which the client is running, see
                   2896: the
                   2897: .Ic set-titles
                   2898: option.
                   2899: .Pp
                   2900: A session's name is set with the
                   2901: .Ic new-session
                   2902: and
                   2903: .Ic rename-session
                   2904: commands.
                   2905: A window's name is set with one of:
                   2906: .Bl -enum -width Ds
                   2907: .It
                   2908: A command argument (such as
                   2909: .Fl n
                   2910: for
                   2911: .Ic new-window
                   2912: or
                   2913: .Ic new-session ) .
                   2914: .It
                   2915: An escape sequence:
                   2916: .Bd -literal -offset indent
                   2917: $ printf '\e033kWINDOW_NAME\e033\e\e'
                   2918: .Ed
                   2919: .It
                   2920: Automatic renaming, which sets the name to the active command in the window's
                   2921: active pane.
                   2922: See the
                   2923: .Ic automatic-rename
                   2924: option.
                   2925: .El
                   2926: .Pp
                   2927: When a pane is first created, its title is the hostname.
                   2928: A pane's title can be set via the OSC title setting sequence, for example:
                   2929: .Bd -literal -offset indent
                   2930: $ printf '\e033]2;My Title\e033\e\e'
                   2931: .Ed
1.63      nicm     2932: .Sh ENVIRONMENT
                   2933: When the server is started,
                   2934: .Nm
                   2935: copies the environment into the
                   2936: .Em global environment ;
                   2937: in addition, each session has a
                   2938: .Em session environment .
1.193     nicm     2939: When a window is created, the session and global environments are merged.
                   2940: If a variable exists in both, the value from the session environment is used.
                   2941: The result is the initial environment passed to the new process.
1.63      nicm     2942: .Pp
                   2943: The
                   2944: .Ic update-environment
                   2945: session option may be used to update the session environment from the client
                   2946: when a new session is created or an old reattached.
                   2947: .Nm
                   2948: also initialises the
                   2949: .Ev TMUX
                   2950: variable with some internal information to allow commands to be executed
                   2951: from inside, and the
                   2952: .Ev TERM
                   2953: variable with the correct terminal setting of
                   2954: .Ql screen .
                   2955: .Pp
                   2956: Commands to alter and view the environment are:
                   2957: .Bl -tag -width Ds
                   2958: .It Xo Ic set-environment
                   2959: .Op Fl gru
                   2960: .Op Fl t Ar target-session
                   2961: .Ar name Op Ar value
                   2962: .Xc
1.115     nicm     2963: .D1 (alias: Ic setenv )
1.63      nicm     2964: Set or unset an environment variable.
                   2965: If
                   2966: .Fl g
                   2967: is used, the change is made in the global environment; otherwise, it is applied
                   2968: to the session environment for
                   2969: .Ar target-session .
                   2970: The
                   2971: .Fl u
                   2972: flag unsets a variable.
                   2973: .Fl r
                   2974: indicates the variable is to be removed from the environment before starting a
                   2975: new process.
                   2976: .It Xo Ic show-environment
                   2977: .Op Fl g
                   2978: .Op Fl t Ar target-session
1.286     nicm     2979: .Op Ar variable
1.63      nicm     2980: .Xc
1.115     nicm     2981: .D1 (alias: Ic showenv )
1.63      nicm     2982: Display the environment for
                   2983: .Ar target-session
                   2984: or the global environment with
                   2985: .Fl g .
1.286     nicm     2986: If
                   2987: .Ar variable
                   2988: is omitted, all variables are shown.
1.63      nicm     2989: Variables removed from the environment are prefixed with
                   2990: .Ql - .
1.57      jmc      2991: .El
                   2992: .Sh STATUS LINE
                   2993: .Nm
                   2994: includes an optional status line which is displayed in the bottom line of each
                   2995: terminal.
                   2996: By default, the status line is enabled (it may be disabled with the
                   2997: .Ic status
                   2998: session option) and contains, from left-to-right: the name of the current
1.261     nicm     2999: session in square brackets; the window list; the title of the active pane
                   3000: in double quotes; and the time and date.
1.57      jmc      3001: .Pp
                   3002: The status line is made of three parts: configurable left and right sections
                   3003: (which may contain dynamic content such as the time or output from a shell
                   3004: command, see the
                   3005: .Ic status-left ,
                   3006: .Ic status-left-length ,
                   3007: .Ic status-right ,
                   3008: and
                   3009: .Ic status-right-length
                   3010: options below), and a central window list.
1.125     nicm     3011: By default, the window list shows the index, name and (if any) flag of the
                   3012: windows present in the current session in ascending numerical order.
                   3013: It may be customised with the
                   3014: .Ar window-status-format
                   3015: and
                   3016: .Ar window-status-current-format
                   3017: options.
1.57      jmc      3018: The flag is one of the following symbols appended to the window name:
                   3019: .Bl -column "Symbol" "Meaning" -offset indent
                   3020: .It Sy "Symbol" Ta Sy "Meaning"
                   3021: .It Li "*" Ta "Denotes the current window."
                   3022: .It Li "-" Ta "Marks the last window (previously selected)."
                   3023: .It Li "#" Ta "Window is monitored and activity has been detected."
                   3024: .It Li "!" Ta "A bell has occurred in the window."
                   3025: .It Li "+" Ta "Window is monitored for content and it has appeared."
1.192     nicm     3026: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.57      jmc      3027: .El
                   3028: .Pp
                   3029: The # symbol relates to the
                   3030: .Ic monitor-activity
                   3031: and + to the
                   3032: .Ic monitor-content
                   3033: window options.
                   3034: The window name is printed in inverted colours if an alert (bell, activity or
                   3035: content) is present.
                   3036: .Pp
1.131     nicm     3037: The colour and attributes of the status line may be configured, the entire
                   3038: status line using the
1.57      jmc      3039: .Ic status-attr ,
                   3040: .Ic status-fg
                   3041: and
                   3042: .Ic status-bg
                   3043: session options and individual windows using the
                   3044: .Ic window-status-attr ,
                   3045: .Ic window-status-fg
                   3046: and
                   3047: .Ic window-status-bg
                   3048: window options.
                   3049: .Pp
1.131     nicm     3050: The status line is automatically refreshed at interval if it has changed, the
                   3051: interval may be controlled with the
1.57      jmc      3052: .Ic status-interval
                   3053: session option.
                   3054: .Pp
                   3055: Commands related to the status line are as follows:
                   3056: .Bl -tag -width Ds
                   3057: .It Xo Ic command-prompt
1.235     nicm     3058: .Op Fl I Ar inputs
1.73      nicm     3059: .Op Fl p Ar prompts
1.57      jmc      3060: .Op Fl t Ar target-client
                   3061: .Op Ar template
                   3062: .Xc
                   3063: Open the command prompt in a client.
                   3064: This may be used from inside
                   3065: .Nm
                   3066: to execute commands interactively.
1.231     nicm     3067: .Pp
1.57      jmc      3068: If
                   3069: .Ar template
1.73      nicm     3070: is specified, it is used as the command.
1.235     nicm     3071: If present,
                   3072: .Fl I
                   3073: is a comma-separated list of the initial text for each prompt.
1.73      nicm     3074: If
                   3075: .Fl p
                   3076: is given,
                   3077: .Ar prompts
                   3078: is a comma-separated list of prompts which are displayed in order; otherwise
                   3079: a single prompt is displayed, constructed from
                   3080: .Ar template
                   3081: if it is present, or
                   3082: .Ql \&:
                   3083: if not.
1.235     nicm     3084: .Pp
                   3085: Both
                   3086: .Ar inputs
                   3087: and
1.231     nicm     3088: .Ar prompts
                   3089: may contain the special character sequences supported by the
                   3090: .Ic status-left
                   3091: option.
                   3092: .Pp
1.73      nicm     3093: Before the command is executed, the first occurrence of the string
                   3094: .Ql %%
1.74      jmc      3095: and all occurrences of
1.73      nicm     3096: .Ql %1
                   3097: are replaced by the response to the first prompt, the second
                   3098: .Ql %%
                   3099: and all
                   3100: .Ql %2
                   3101: are replaced with the response to the second prompt, and so on for further
1.74      jmc      3102: prompts.
                   3103: Up to nine prompt responses may be replaced
                   3104: .Po
                   3105: .Ql %1
1.73      nicm     3106: to
1.74      jmc      3107: .Ql %9
                   3108: .Pc .
1.57      jmc      3109: .It Xo Ic confirm-before
1.238     nicm     3110: .Op Fl p Ar prompt
1.57      jmc      3111: .Op Fl t Ar target-client
                   3112: .Ar command
                   3113: .Xc
                   3114: .D1 (alias: Ic confirm )
                   3115: Ask for confirmation before executing
                   3116: .Ar command .
1.238     nicm     3117: If
                   3118: .Fl p
                   3119: is given,
                   3120: .Ar prompt
                   3121: is the prompt to display; otherwise a prompt is constructed from
                   3122: .Ar command .
                   3123: It may contain the special character sequences supported by the
                   3124: .Ic status-left
                   3125: option.
                   3126: .Pp
1.57      jmc      3127: This command works only from inside
                   3128: .Nm .
                   3129: .It Xo Ic display-message
1.127     nicm     3130: .Op Fl p
1.215     nicm     3131: .Op Fl c Ar target-client
                   3132: .Op Fl t Ar target-pane
1.57      jmc      3133: .Op Ar message
                   3134: .Xc
                   3135: .D1 (alias: Ic display )
1.127     nicm     3136: Display a message.
                   3137: If
                   3138: .Fl p
                   3139: is given, the output is printed to stdout, otherwise it is displayed in the
                   3140: .Ar target-client
                   3141: status line.
1.122     nicm     3142: The format of
1.124     jmc      3143: .Ar message
1.275     nicm     3144: is described in the
                   3145: .Sx FORMATS
                   3146: section; information is taken from
1.215     nicm     3147: .Ar target-pane
                   3148: if
                   3149: .Fl t
                   3150: is given, otherwise the active pane for the session attached to
                   3151: .Ar target-client .
1.57      jmc      3152: .El
                   3153: .Sh BUFFERS
                   3154: .Nm
                   3155: maintains a stack of
1.199     nicm     3156: .Em paste buffers .
1.57      jmc      3157: Up to the value of the
                   3158: .Ic buffer-limit
                   3159: option are kept; when a new buffer is added, the buffer at the bottom of the
                   3160: stack is removed.
                   3161: Buffers may be added using
                   3162: .Ic copy-mode
                   3163: or the
                   3164: .Ic set-buffer
                   3165: command, and pasted into a window using the
                   3166: .Ic paste-buffer
                   3167: command.
                   3168: .Pp
                   3169: A configurable history buffer is also maintained for each window.
                   3170: By default, up to 2000 lines are kept; this can be altered with the
                   3171: .Ic history-limit
                   3172: option (see the
                   3173: .Ic set-option
                   3174: command above).
                   3175: .Pp
                   3176: The buffer commands are as follows:
                   3177: .Bl -tag -width Ds
1.178     nicm     3178: .It Xo
                   3179: .Ic choose-buffer
1.294     nicm     3180: .Op Fl F Ar format
1.178     nicm     3181: .Op Fl t Ar target-window
                   3182: .Op Ar template
                   3183: .Xc
                   3184: Put a window into buffer choice mode, where a buffer may be chosen
                   3185: interactively from a list.
                   3186: After a buffer is selected,
                   3187: .Ql %%
                   3188: is replaced by the buffer index in
                   3189: .Ar template
                   3190: and the result executed as a command.
                   3191: If
                   3192: .Ar template
                   3193: is not given, "paste-buffer -b '%%'" is used.
1.294     nicm     3194: For the meaning of the
                   3195: .Fl F
                   3196: flag, see the
                   3197: .Sx FORMATS
                   3198: section.
1.178     nicm     3199: This command works only from inside
                   3200: .Nm .
1.57      jmc      3201: .It Ic clear-history Op Fl t Ar target-pane
                   3202: .D1 (alias: Ic clearhist )
                   3203: Remove and free the history for the specified pane.
1.198     nicm     3204: .It Ic delete-buffer Op Fl b Ar buffer-index
1.57      jmc      3205: .D1 (alias: Ic deleteb )
                   3206: Delete the buffer at
                   3207: .Ar buffer-index ,
                   3208: or the top buffer if not specified.
1.294     nicm     3209: .It Xo Ic list-buffers
                   3210: .Op Fl F Ar format
                   3211: .Xc
1.57      jmc      3212: .D1 (alias: Ic lsb )
1.198     nicm     3213: List the global buffers.
1.294     nicm     3214: For the meaning of the
                   3215: .Fl F
                   3216: flag, see the
                   3217: .Sx FORMATS
                   3218: section.
1.200     jmc      3219: .It Xo Ic load-buffer
1.57      jmc      3220: .Op Fl b Ar buffer-index
                   3221: .Ar path
                   3222: .Xc
                   3223: .D1 (alias: Ic loadb )
                   3224: Load the contents of the specified paste buffer from
                   3225: .Ar path .
                   3226: .It Xo Ic paste-buffer
1.278     nicm     3227: .Op Fl dpr
1.57      jmc      3228: .Op Fl b Ar buffer-index
1.170     nicm     3229: .Op Fl s Ar separator
1.158     nicm     3230: .Op Fl t Ar target-pane
1.57      jmc      3231: .Xc
                   3232: .D1 (alias: Ic pasteb )
1.158     nicm     3233: Insert the contents of a paste buffer into the specified pane.
                   3234: If not specified, paste into the current one.
1.57      jmc      3235: With
                   3236: .Fl d ,
                   3237: also delete the paste buffer from the stack.
                   3238: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170     nicm     3239: a separator, by default carriage return (CR).
                   3240: A custom separator may be specified using the
                   3241: .Fl s
                   3242: flag.
                   3243: The
1.57      jmc      3244: .Fl r
1.170     nicm     3245: flag means to do no replacement (equivalent to a separator of LF).
1.278     nicm     3246: If
                   3247: .Fl p
                   3248: is specified, paste bracket control codes are inserted around the
                   3249: buffer if the application has requested bracketed paste mode.
1.57      jmc      3250: .It Xo Ic save-buffer
                   3251: .Op Fl a
                   3252: .Op Fl b Ar buffer-index
                   3253: .Ar path
                   3254: .Xc
                   3255: .D1 (alias: Ic saveb )
                   3256: Save the contents of the specified paste buffer to
                   3257: .Ar path .
                   3258: The
                   3259: .Fl a
                   3260: option appends to rather than overwriting the file.
                   3261: .It Xo Ic set-buffer
                   3262: .Op Fl b Ar buffer-index
                   3263: .Ar data
                   3264: .Xc
                   3265: .D1 (alias: Ic setb )
                   3266: Set the contents of the specified buffer to
                   3267: .Ar data .
1.1       nicm     3268: .It Xo Ic show-buffer
                   3269: .Op Fl b Ar buffer-index
                   3270: .Xc
                   3271: .D1 (alias: Ic showb )
                   3272: Display the contents of the specified buffer.
1.57      jmc      3273: .El
                   3274: .Sh MISCELLANEOUS
                   3275: Miscellaneous commands are as follows:
                   3276: .Bl -tag -width Ds
1.72      nicm     3277: .It Ic clock-mode Op Fl t Ar target-pane
1.57      jmc      3278: Display a large clock.
1.251     nicm     3279: .It Ic if-shell Ar shell-command command Op Ar command
1.57      jmc      3280: .D1 (alias: Ic if )
1.251     nicm     3281: Execute the first
1.57      jmc      3282: .Ar command
                   3283: if
                   3284: .Ar shell-command
1.251     nicm     3285: returns success or the second
                   3286: .Ar command
                   3287: otherwise.
1.57      jmc      3288: .It Ic lock-server
                   3289: .D1 (alias: Ic lock )
1.90      nicm     3290: Lock each client individually by running the command specified by the
                   3291: .Ic lock-command
                   3292: option.
1.153     nicm     3293: .It Ic run-shell Ar shell-command
1.87      nicm     3294: .D1 (alias: Ic run )
                   3295: Execute
1.153     nicm     3296: .Ar shell-command
1.106     nicm     3297: in the background without creating a window.
1.164     nicm     3298: After it finishes, any output to stdout is displayed in copy mode.
1.153     nicm     3299: If the command doesn't return success, the exit status is also displayed.
1.57      jmc      3300: .It Ic server-info
                   3301: .D1 (alias: Ic info )
                   3302: Show server information and terminal details.
1.228     nicm     3303: .El
                   3304: .Sh TERMINFO EXTENSIONS
                   3305: .Nm
                   3306: understands some extensions to
                   3307: .Xr terminfo 5 :
                   3308: .Bl -tag -width Ds
1.232     jmc      3309: .It Em Cc , Cr
1.233     nicm     3310: Set the cursor colour.
1.232     jmc      3311: The first takes a single string argument and is used to set the colour;
                   3312: the second takes no arguments and restores the default cursor colour.
                   3313: If set, a sequence such as this may be used
                   3314: to change the cursor colour from inside
                   3315: .Nm :
                   3316: .Bd -literal -offset indent
                   3317: $ printf '\e033]12;red\e033\e\e'
                   3318: .Ed
                   3319: .It Em Cs , Csr
1.230     nicm     3320: Change the cursor style.
1.232     jmc      3321: If set, a sequence such as this may be used
                   3322: to change the cursor to an underline:
1.230     nicm     3323: .Bd -literal -offset indent
                   3324: $ printf '\e033[4 q'
                   3325: .Ed
                   3326: .Pp
                   3327: If
                   3328: .Em Csr
                   3329: is set, it will be used to reset the cursor style instead
                   3330: of
                   3331: .Em Cs .
1.232     jmc      3332: .It Em \&Ms
                   3333: This sequence can be used by
                   3334: .Nm
                   3335: to store the current buffer in the host terminal's selection (clipboard).
                   3336: See the
                   3337: .Em set-clipboard
                   3338: option above and the
                   3339: .Xr xterm 1
                   3340: man page.
1.1       nicm     3341: .El
                   3342: .Sh FILES
1.26      nicm     3343: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1       nicm     3344: .It Pa ~/.tmux.conf
1.6       jmc      3345: Default
1.1       nicm     3346: .Nm
1.6       jmc      3347: configuration file.
1.26      nicm     3348: .It Pa /etc/tmux.conf
                   3349: System-wide configuration file.
1.1       nicm     3350: .El
1.57      jmc      3351: .Sh EXAMPLES
                   3352: To create a new
                   3353: .Nm
                   3354: session running
                   3355: .Xr vi 1 :
                   3356: .Pp
                   3357: .Dl $ tmux new-session vi
                   3358: .Pp
                   3359: Most commands have a shorter form, known as an alias.
                   3360: For new-session, this is
                   3361: .Ic new :
                   3362: .Pp
                   3363: .Dl $ tmux new vi
                   3364: .Pp
                   3365: Alternatively, the shortest unambiguous form of a command is accepted.
                   3366: If there are several options, they are listed:
                   3367: .Bd -literal -offset indent
                   3368: $ tmux n
                   3369: ambiguous command: n, could be: new-session, new-window, next-window
                   3370: .Ed
                   3371: .Pp
                   3372: Within an active session, a new window may be created by typing
                   3373: .Ql C-b c
                   3374: (Ctrl
                   3375: followed by the
                   3376: .Ql b
                   3377: key
                   3378: followed by the
                   3379: .Ql c
                   3380: key).
                   3381: .Pp
                   3382: Windows may be navigated with:
                   3383: .Ql C-b 0
                   3384: (to select window 0),
                   3385: .Ql C-b 1
                   3386: (to select window 1), and so on;
                   3387: .Ql C-b n
                   3388: to select the next window; and
                   3389: .Ql C-b p
                   3390: to select the previous window.
                   3391: .Pp
                   3392: A session may be detached using
                   3393: .Ql C-b d
1.64      nicm     3394: (or by an external event such as
                   3395: .Xr ssh 1
                   3396: disconnection) and reattached with:
1.57      jmc      3397: .Pp
                   3398: .Dl $ tmux attach-session
                   3399: .Pp
                   3400: Typing
                   3401: .Ql C-b \&?
                   3402: lists the current key bindings in the current window; up and down may be used
                   3403: to navigate the list or
                   3404: .Ql q
                   3405: to exit from it.
                   3406: .Pp
                   3407: Commands to be run when the
                   3408: .Nm
                   3409: server is started may be placed in the
                   3410: .Pa ~/.tmux.conf
                   3411: configuration file.
                   3412: Common examples include:
                   3413: .Pp
                   3414: Changing the default prefix key:
                   3415: .Bd -literal -offset indent
                   3416: set-option -g prefix C-a
                   3417: unbind-key C-b
                   3418: bind-key C-a send-prefix
                   3419: .Ed
                   3420: .Pp
                   3421: Turning the status line off, or changing its colour:
                   3422: .Bd -literal -offset indent
                   3423: set-option -g status off
                   3424: set-option -g status-bg blue
                   3425: .Ed
                   3426: .Pp
                   3427: Setting other options, such as the default command,
                   3428: or locking after 30 minutes of inactivity:
                   3429: .Bd -literal -offset indent
                   3430: set-option -g default-command "exec /bin/ksh"
                   3431: set-option -g lock-after-time 1800
                   3432: .Ed
                   3433: .Pp
                   3434: Creating new key bindings:
                   3435: .Bd -literal -offset indent
                   3436: bind-key b set-option status
                   3437: bind-key / command-prompt "split-window 'exec man %%'"
1.73      nicm     3438: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57      jmc      3439: .Ed
1.1       nicm     3440: .Sh SEE ALSO
                   3441: .Xr pty 4
                   3442: .Sh AUTHORS
                   3443: .An Nicholas Marriott Aq nicm@users.sourceforge.net