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

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