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

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