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

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