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

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