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

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