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

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