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

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