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

1.247   ! nicm        1: .\" $OpenBSD: tmux.1,v 1.246 2011/08/26 13:07:49 jmc Exp $
1.1       nicm        2: .\"
                      3: .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
                      4: .\"
                      5: .\" Permission to use, copy, modify, and distribute this software for any
                      6: .\" purpose with or without fee is hereby granted, provided that the above
                      7: .\" copyright notice and this permission notice appear in all copies.
                      8: .\"
                      9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
                     14: .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
                     15: .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16: .\"
1.246     jmc        17: .Dd $Mdocdate: August 26 2011 $
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.114     nicm       26: .Op Fl 28lquv
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.
                    101: .It Fl 8
                    102: Like
                    103: .Fl 2 ,
1.6       jmc       104: but indicates that the terminal supports 88 colours.
1.91      nicm      105: .It Fl c Ar shell-command
                    106: Execute
                    107: .Ar shell-command
                    108: using the default shell.
                    109: If necessary, the
                    110: .Nm
                    111: server will be started to retrieve the
                    112: .Ic default-shell
                    113: option.
1.153     nicm      114: This option is for compatibility with
                    115: .Xr sh 1
                    116: when
                    117: .Nm
                    118: is used as a login shell.
1.1       nicm      119: .It Fl f Ar file
                    120: Specify an alternative configuration file.
                    121: By default,
                    122: .Nm
1.26      nicm      123: loads the system configuration file from
                    124: .Pa /etc/tmux.conf ,
                    125: if present, then looks for a user configuration file at
1.1       nicm      126: .Pa ~/.tmux.conf .
                    127: The configuration file is a set of
                    128: .Nm
                    129: commands which are executed in sequence when the server is first started.
1.61      nicm      130: .Pp
                    131: If a command in the configuration file fails,
                    132: .Nm
                    133: will report an error and exit without executing further commands.
1.1       nicm      134: .It Fl L Ar socket-name
                    135: .Nm
                    136: stores the server socket in a directory under
1.208     nicm      137: .Pa /tmp
                    138: (or
                    139: .Ev TMPDIR
                    140: if set);
1.1       nicm      141: the default socket is named
                    142: .Em default .
                    143: This option allows a different socket name to be specified, allowing several
                    144: independent
                    145: .Nm
                    146: servers to be run.
                    147: Unlike
                    148: .Fl S
                    149: a full path is not necessary: the sockets are all created in the same
                    150: directory.
1.2       nicm      151: .Pp
                    152: If the socket is accidentally removed, the
1.6       jmc       153: .Dv SIGUSR1
1.2       nicm      154: signal may be sent to the
                    155: .Nm
                    156: server process to recreate it.
1.166     sobrado   157: .It Fl l
                    158: Behave as a login shell.
                    159: This flag currently has no effect and is for compatibility with other shells
                    160: when using tmux as a login shell.
1.4       sobrado   161: .It Fl q
1.133     nicm      162: Set the
                    163: .Ic quiet
                    164: server option to prevent the server sending various informational messages.
1.1       nicm      165: .It Fl S Ar socket-path
                    166: Specify a full alternative path to the server socket.
                    167: If
                    168: .Fl S
                    169: is specified, the default socket directory is not used and any
                    170: .Fl L
                    171: flag is ignored.
                    172: .It Fl u
                    173: .Nm
1.14      nicm      174: attempts to guess if the terminal is likely to support UTF-8 by checking the
                    175: first of the
                    176: .Ev LC_ALL ,
                    177: .Ev LC_CTYPE
                    178: and
1.2       nicm      179: .Ev LANG
1.14      nicm      180: environment variables to be set for the string "UTF-8".
1.5       nicm      181: This is not always correct: the
1.2       nicm      182: .Fl u
                    183: flag explicitly informs
                    184: .Nm
1.6       jmc       185: that UTF-8 is supported.
1.33      nicm      186: .Pp
                    187: If the server is started from a client passed
                    188: .Fl u
                    189: or where UTF-8 is detected, the
                    190: .Ic utf8
                    191: and
                    192: .Ic status-utf8
                    193: options are enabled in the global window and session options respectively.
1.1       nicm      194: .It Fl v
                    195: Request verbose logging.
                    196: This option may be specified multiple times for increasing verbosity.
                    197: Log messages will be saved into
                    198: .Pa tmux-client-PID.log
                    199: and
                    200: .Pa tmux-server-PID.log
                    201: files in the current directory, where
                    202: .Em PID
1.6       jmc       203: is the PID of the server or client process.
1.1       nicm      204: .It Ar command Op Ar flags
                    205: This specifies one of a set of commands used to control
                    206: .Nm ,
1.6       jmc       207: as described in the following sections.
1.59      jmc       208: If no commands are specified, the
1.1       nicm      209: .Ic new-session
                    210: command is assumed.
1.57      jmc       211: .El
1.64      nicm      212: .Sh KEY BINDINGS
                    213: .Nm
                    214: may be controlled from an attached client by using a key combination of a
                    215: prefix key,
                    216: .Ql C-b
                    217: (Ctrl-b) by default, followed by a command key.
                    218: .Pp
1.172     nicm      219: The default command key bindings are:
1.64      nicm      220: .Pp
1.171     nicm      221: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
                    222: .It C-b
                    223: Send the prefix key (C-b) through to the application.
                    224: .It C-o
                    225: Rotate the panes in the current window forwards.
                    226: .It C-z
                    227: Suspend the
                    228: .Nm
                    229: client.
                    230: .It !
                    231: Break the current pane out of the window.
                    232: .It \&"
                    233: Split the current pane into two, top and bottom.
                    234: .It #
                    235: List all paste buffers.
1.236     nicm      236: .It $
                    237: Rename the current session.
1.171     nicm      238: .It %
                    239: Split the current pane into two, left and right.
                    240: .It &
                    241: Kill the current window.
                    242: .It '
                    243: Prompt for a window index to select.
                    244: .It ,
                    245: Rename the current window.
                    246: .It -
                    247: Delete the most recently copied buffer of text.
                    248: .It .
                    249: Prompt for an index to move the current window.
                    250: .It 0 to 9
                    251: Select windows 0 to 9.
                    252: .It :
                    253: Enter the
                    254: .Nm
                    255: command prompt.
1.187     nicm      256: .It ;
                    257: Move to the previously active pane.
1.178     nicm      258: .It =
                    259: Choose which buffer to paste interactively from a list.
1.171     nicm      260: .It \&?
                    261: List all key bindings.
                    262: .It D
                    263: Choose a client to detach.
1.182     jmc       264: .It \&[
1.171     nicm      265: Enter copy mode to copy text or view the history.
1.182     jmc       266: .It \&]
1.171     nicm      267: Paste the most recently copied buffer of text.
1.64      nicm      268: .It c
1.65      nicm      269: Create a new window.
1.64      nicm      270: .It d
1.65      nicm      271: Detach the current client.
1.171     nicm      272: .It f
                    273: Prompt to search for text in open windows.
                    274: .It i
                    275: Display some information about the current window.
1.64      nicm      276: .It l
1.65      nicm      277: Move to the previously selected window.
1.64      nicm      278: .It n
1.65      nicm      279: Change to the next window.
1.171     nicm      280: .It o
                    281: Select the next pane in the current window.
1.64      nicm      282: .It p
1.65      nicm      283: Change to the previous window.
1.171     nicm      284: .It q
                    285: Briefly display pane indexes.
                    286: .It r
                    287: Force redraw of the attached client.
                    288: .It s
                    289: Select a new session for the attached client interactively.
1.194     nicm      290: .It L
                    291: Switch the attached client back to the last session.
1.171     nicm      292: .It t
                    293: Show the time.
                    294: .It w
                    295: Choose the current window interactively.
                    296: .It x
                    297: Kill the current pane.
                    298: .It {
                    299: Swap the current pane with the previous pane.
                    300: .It }
                    301: Swap the current pane with the next pane.
                    302: .It ~
                    303: Show previous messages from
                    304: .Nm ,
                    305: if any.
                    306: .It Page Up
                    307: Enter copy mode and scroll one page up.
                    308: .It Up, Down
                    309: .It Left, Right
                    310: Change to the pane above, below, to the left, or to the right of the current
                    311: pane.
                    312: .It M-1 to M-5
                    313: Arrange panes in one of the five preset layouts: even-horizontal,
                    314: even-vertical, main-horizontal, main-vertical, or tiled.
                    315: .It M-n
                    316: Move to the next window with a bell or activity marker.
                    317: .It M-o
                    318: Rotate the panes in the current window backwards.
                    319: .It M-p
                    320: Move to the previous window with a bell or activity marker.
                    321: .It C-Up, C-Down
                    322: .It C-Left, C-Right
                    323: Resize the current pane in steps of one cell.
                    324: .It M-Up, M-Down
                    325: .It M-Left, M-Right
                    326: Resize the current pane in steps of five cells.
1.64      nicm      327: .El
                    328: .Pp
                    329: Key bindings may be changed with the
                    330: .Ic bind-key
                    331: and
                    332: .Ic unbind-key
                    333: commands.
1.57      jmc       334: .Sh COMMANDS
                    335: This section contains a list of the commands supported by
                    336: .Nm .
                    337: Most commands accept the optional
                    338: .Fl t
                    339: argument with one of
                    340: .Ar target-client ,
                    341: .Ar target-session
                    342: .Ar target-window ,
                    343: or
                    344: .Ar target-pane .
                    345: These specify the client, session, window or pane which a command should affect.
                    346: .Ar target-client
                    347: is the name of the
                    348: .Xr pty 4
                    349: file to which the client is connected, for example either of
                    350: .Pa /dev/ttyp1
                    351: or
                    352: .Pa ttyp1
                    353: for the client attached to
                    354: .Pa /dev/ttyp1 .
                    355: If no client is specified, the current client is chosen, if possible, or an
                    356: error is reported.
                    357: Clients may be listed with the
                    358: .Ic list-clients
                    359: command.
1.1       nicm      360: .Pp
1.57      jmc       361: .Ar target-session
                    362: is either the name of a session (as listed by the
                    363: .Ic list-sessions
                    364: command) or the name of a client with the same syntax as
                    365: .Ar target-client ,
                    366: in which case the session attached to the client is used.
                    367: When looking for the session name,
                    368: .Nm
                    369: initially searches for an exact match; if none is found, the session names
                    370: are checked for any for which
                    371: .Ar target-session
                    372: is a prefix or for which it matches as an
                    373: .Xr fnmatch 3
                    374: pattern.
                    375: If a single match is found, it is used as the target session; multiple matches
                    376: produce an error.
                    377: If a session is omitted, the current session is used if available; if no
1.117     nicm      378: current session is available, the most recently used is chosen.
1.1       nicm      379: .Pp
1.57      jmc       380: .Ar target-window
                    381: specifies a window in the form
                    382: .Em session Ns \&: Ns Em window .
                    383: .Em session
                    384: follows the same rules as for
                    385: .Ar target-session ,
                    386: and
                    387: .Em window
                    388: is looked for in order: as a window index, for example mysession:1; as an exact
                    389: window name, such as mysession:mywindow; then as an
                    390: .Xr fnmatch 3
                    391: pattern or the start of a window name, such as mysession:mywin* or
                    392: mysession:mywin.
                    393: An empty window name specifies the next unused index if appropriate (for
                    394: example the
                    395: .Ic new-window
                    396: and
                    397: .Ic link-window
                    398: commands)
                    399: otherwise the current window in
                    400: .Em session
                    401: is chosen.
1.140     nicm      402: The special character
                    403: .Ql \&!
                    404: uses the last (previously current) window, or
                    405: .Ql +
                    406: and
                    407: .Ql -
                    408: are the next window or the previous window by number.
1.57      jmc       409: When the argument does not contain a colon,
                    410: .Nm
                    411: first attempts to parse it as window; if that fails, an attempt is made to
                    412: match a session.
1.1       nicm      413: .Pp
1.57      jmc       414: .Ar target-pane
                    415: takes a similar form to
                    416: .Ar target-window
                    417: but with the optional addition of a period followed by a pane index, for
                    418: example: mysession:mywindow.1.
                    419: If the pane index is omitted, the currently active pane in the specified
                    420: window is used.
                    421: If neither a colon nor period appears,
1.13      nicm      422: .Nm
1.57      jmc       423: first attempts to use the argument as a pane index; if that fails, it is looked
                    424: up as for
                    425: .Ar target-window .
1.156     nicm      426: A
                    427: .Ql +
                    428: or
                    429: .Ql -
                    430: indicate the next or previous pane index, respectively.
1.132     nicm      431: One of the strings
                    432: .Em top ,
                    433: .Em bottom ,
                    434: .Em left ,
                    435: .Em right ,
                    436: .Em top-left ,
                    437: .Em top-right ,
1.216     nicm      438: .Em bottom-left
                    439: or
1.132     nicm      440: .Em bottom-right
                    441: may be used instead of a pane index.
1.177     nicm      442: .Pp
                    443: The special characters
                    444: .Ql +
                    445: and
                    446: .Ql -
                    447: may be followed by an offset, for example:
                    448: .Bd -literal -offset indent
                    449: select-window -t:+2
                    450: .Ed
                    451: .Pp
                    452: When dealing with a session that doesn't contain sequential window indexes,
                    453: they will be correctly skipped.
1.212     nicm      454: .Pp
                    455: .Nm
                    456: also gives each pane created in a server an identifier consisting of a
                    457: .Ql %
                    458: and a number, starting from zero.
                    459: A pane's identifier is unique for the life of the
                    460: .Nm
                    461: server and is passed to the child process of the pane in the
                    462: .Ev TMUX_PANE
                    463: environment variable.
                    464: It may be used alone to target a pane or the window containing it.
1.15      jmc       465: .Pp
1.153     nicm      466: .Ar shell-command
                    467: arguments are
                    468: .Xr sh 1
                    469: commands.
                    470: These must be passed as a single item, which typically means quoting them, for
                    471: example:
                    472: .Bd -literal -offset indent
                    473: new-window 'vi /etc/passwd'
                    474: .Ed
                    475: .Pp
                    476: .Ar command
                    477: .Op Ar arguments
                    478: refers to a
                    479: .Nm
                    480: command, passed with the command and arguments separately, for example:
                    481: .Bd -literal -offset indent
                    482: bind-key F1 set-window-option force-width 81
                    483: .Ed
                    484: .Pp
                    485: Or if using
                    486: .Xr sh 1 :
                    487: .Bd -literal -offset indent
                    488: $ tmux bind-key F1 set-window-option force-width 81
                    489: .Ed
                    490: .Pp
1.57      jmc       491: Multiple commands may be specified together as part of a
                    492: .Em command sequence .
                    493: Each command should be separated by spaces and a semicolon;
1.244     nicm      494: commands are executed sequentially from left to right and
                    495: lines ending with a backslash continue on to the next line.
1.57      jmc       496: A literal semicolon may be included by escaping it with a backslash (for
                    497: example, when specifying a command sequence to
                    498: .Ic bind-key ) .
1.13      nicm      499: .Pp
1.153     nicm      500: Example
                    501: .Nm
                    502: commands include:
1.13      nicm      503: .Bd -literal -offset indent
1.57      jmc       504: refresh-client -t/dev/ttyp2
                    505:
                    506: rename-session -tfirst newname
                    507:
                    508: set-window-option -t:0 monitor-activity on
                    509:
                    510: new-window ; split-window -d
1.244     nicm      511:
                    512: bind-key R source-file ~/.tmux.conf \e; \e
                    513:        display-message "source-file done"
1.13      nicm      514: .Ed
1.153     nicm      515: .Pp
                    516: Or from
                    517: .Xr sh 1 :
                    518: .Bd -literal -offset indent
                    519: $ tmux kill-window -t :1
                    520:
1.159     jmc       521: $ tmux new-window \e; split-window -d
1.153     nicm      522:
1.159     jmc       523: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153     nicm      524: .Ed
1.57      jmc       525: .Sh CLIENTS AND SESSIONS
1.153     nicm      526: The
                    527: .Nm
                    528: server manages clients, sessions, windows and panes.
                    529: Clients are attached to sessions to interact with them, either
                    530: when they are created with the
                    531: .Ic new-session
                    532: command, or later with the
                    533: .Ic attach-session
                    534: command.
1.188     nicm      535: Each session has one or more windows
1.153     nicm      536: .Em linked
                    537: into it.
                    538: Windows may be linked to multiple sessions and are made up of one or
                    539: more panes,
                    540: each of which contains a pseudo terminal.
                    541: Commands for creating, linking and otherwise manipulating windows
                    542: are covered
                    543: in the
                    544: .Sx WINDOWS AND PANES
                    545: section.
                    546: .Pp
                    547: The following commands are available to manage clients and sessions:
1.57      jmc       548: .Bl -tag -width Ds
                    549: .It Xo Ic attach-session
1.148     nicm      550: .Op Fl dr
1.57      jmc       551: .Op Fl t Ar target-session
                    552: .Xc
                    553: .D1 (alias: Ic attach )
                    554: If run from outside
                    555: .Nm ,
                    556: create a new client in the current terminal and attach it to
                    557: .Ar target-session .
                    558: If used from inside, switch the current client.
                    559: If
                    560: .Fl d
                    561: is specified, any other clients attached to the session are detached.
1.148     nicm      562: .Fl r
                    563: signifies the client is read-only (only keys bound to the
                    564: .Ic detach-client
1.242     nicm      565: or
                    566: .Ic switch-client
                    567: commands have any effect)
1.13      nicm      568: .Pp
1.57      jmc       569: If no server is started,
                    570: .Ic attach-session
                    571: will attempt to start it; this will fail unless sessions are created in the
                    572: configuration file.
1.217     nicm      573: .Pp
                    574: The
                    575: .Ar target-session
                    576: rules for
                    577: .Ic attach-session
                    578: are slightly adjusted: if
                    579: .Nm
                    580: needs to select the most recently used session, it will prefer the most
                    581: recently used
                    582: .Em unattached
                    583: session.
1.211     nicm      584: .It Xo Ic detach-client
                    585: .Op Fl P
1.219     nicm      586: .Op Fl s Ar target-session
1.211     nicm      587: .Op Fl t Ar target-client
                    588: .Xc
1.57      jmc       589: .D1 (alias: Ic detach )
1.218     nicm      590: Detach the current client if bound to a key, the client specified with
                    591: .Fl t ,
                    592: or all clients currently attached to to the session specified by
                    593: .Fl s .
1.211     nicm      594: If
                    595: .Fl P
                    596: is given, send SIGHUP to the parent process of the client, typically causing it
                    597: to exit.
1.57      jmc       598: .It Ic has-session Op Fl t Ar target-session
                    599: .D1 (alias: Ic has )
                    600: Report an error and exit with 1 if the specified session does not exist.
                    601: If it does exist, exit with 0.
                    602: .It Ic kill-server
                    603: Kill the
1.1       nicm      604: .Nm
1.57      jmc       605: server and clients and destroy all sessions.
                    606: .It Ic kill-session Op Fl t Ar target-session
                    607: Destroy the given session, closing any windows linked to it and no other
                    608: sessions, and detaching all clients attached to it.
1.220     nicm      609: .It Ic list-clients Op Fl t Ar target-session
1.57      jmc       610: .D1 (alias: Ic lsc )
1.221     jmc       611: List all clients attached to the server.
                    612: If
1.220     nicm      613: .Ar target-session
                    614: is specified, list only clients connected to that session.
1.57      jmc       615: .It Ic list-commands
                    616: .D1 (alias: Ic lscm )
                    617: List the syntax of all commands supported by
                    618: .Nm .
1.247   ! nicm      619: .It Ic list-sessions Op Fl F Ar format
1.57      jmc       620: .D1 (alias: Ic ls )
                    621: List all sessions managed by the server.
1.247   ! nicm      622: For the meaning of the
        !           623: .Fl F
        !           624: flag, see the
        !           625: .Sx FORMATS
        !           626: section.
1.175     nicm      627: .It Ic lock-client Op Fl t Ar target-client
                    628: .D1 (alias: Ic lockc )
1.92      nicm      629: Lock
                    630: .Ar target-client ,
                    631: see the
                    632: .Ic lock-server
                    633: command.
1.175     nicm      634: .It Ic lock-session Op Fl t Ar target-session
                    635: .D1 (alias: Ic locks )
1.92      nicm      636: Lock all clients attached to
                    637: .Ar target-session .
1.57      jmc       638: .It Xo Ic new-session
                    639: .Op Fl d
                    640: .Op Fl n Ar window-name
                    641: .Op Fl s Ar session-name
1.101     nicm      642: .Op Fl t Ar target-session
1.210     nicm      643: .Op Fl x Ar width
                    644: .Op Fl y Ar height
1.153     nicm      645: .Op Ar shell-command
1.57      jmc       646: .Xc
                    647: .D1 (alias: Ic new )
                    648: Create a new session with name
                    649: .Ar session-name .
1.153     nicm      650: .Pp
1.57      jmc       651: The new session is attached to the current terminal unless
                    652: .Fl d
                    653: is given.
                    654: .Ar window-name
1.1       nicm      655: and
1.153     nicm      656: .Ar shell-command
                    657: are the name of and shell command to execute in the initial window.
1.210     nicm      658: If
                    659: .Fl d
                    660: is used,
                    661: .Fl x
                    662: and
                    663: .Fl y
                    664: specify the size of the initial window (80 by 24 if not given).
1.68      nicm      665: .Pp
                    666: If run from a terminal, any
                    667: .Xr termios 4
                    668: special characters are saved and used for new windows in the new session.
1.101     nicm      669: .Pp
                    670: If
                    671: .Fl t
                    672: is given, the new session is
                    673: .Em grouped
                    674: with
                    675: .Ar target-session .
                    676: This means they share the same set of windows - all windows from
                    677: .Ar target-session
                    678: are linked to the new session and any subsequent new windows or windows being
                    679: closed are applied to both sessions.
                    680: The current and previous window and any session options remain independent and
                    681: either session may be killed without affecting the other.
                    682: Giving
                    683: .Fl n
                    684: or
1.153     nicm      685: .Ar shell-command
1.101     nicm      686: are invalid if
                    687: .Fl t
                    688: is used.
1.57      jmc       689: .It Ic refresh-client Op Fl t Ar target-client
                    690: .D1 (alias: Ic refresh )
                    691: Refresh the current client if bound to a key, or a single client if one is given
                    692: with
                    693: .Fl t .
                    694: .It Xo Ic rename-session
                    695: .Op Fl t Ar target-session
                    696: .Ar new-name
                    697: .Xc
                    698: .D1 (alias: Ic rename )
                    699: Rename the session to
                    700: .Ar new-name .
1.121     nicm      701: .It Xo Ic show-messages
1.120     nicm      702: .Op Fl t Ar target-client
                    703: .Xc
                    704: .D1 (alias: Ic showmsgs )
                    705: Any messages displayed on the status line are saved in a per-client message
                    706: log, up to a maximum of the limit set by the
                    707: .Ar message-limit
                    708: session option for the session attached to that client.
                    709: This command displays the log for
                    710: .Ar target-client .
1.57      jmc       711: .It Ic source-file Ar path
                    712: .D1 (alias: Ic source )
                    713: Execute commands from
                    714: .Ar path .
                    715: .It Ic start-server
                    716: .D1 (alias: Ic start )
                    717: Start the
1.1       nicm      718: .Nm
1.57      jmc       719: server, if not already running, without creating any sessions.
                    720: .It Xo Ic suspend-client
1.202     nicm      721: .Op Fl t Ar target-client
1.57      jmc       722: .Xc
                    723: .D1 (alias: Ic suspendc )
                    724: Suspend a client by sending
                    725: .Dv SIGTSTP
                    726: (tty stop).
                    727: .It Xo Ic switch-client
1.242     nicm      728: .Op Fl lnpr
1.57      jmc       729: .Op Fl c Ar target-client
                    730: .Op Fl t Ar target-session
                    731: .Xc
                    732: .D1 (alias: Ic switchc )
                    733: Switch the current session for client
                    734: .Ar target-client
                    735: to
                    736: .Ar target-session .
1.183     nicm      737: If
1.197     jmc       738: .Fl l ,
1.183     nicm      739: .Fl n
                    740: or
                    741: .Fl p
1.194     nicm      742: is used, the client is moved to the last, next or previous session
                    743: respectively.
1.242     nicm      744: .Fl r
                    745: toggles whether a client is read-only (see the
                    746: .Ic attach-session
                    747: command).
1.57      jmc       748: .El
                    749: .Sh WINDOWS AND PANES
1.1       nicm      750: A
                    751: .Nm
                    752: window may be in one of several modes.
                    753: The default permits direct access to the terminal attached to the window.
1.164     nicm      754: The other is copy mode, which permits a section of a window or its
                    755: history to be copied to a
1.1       nicm      756: .Em paste buffer
                    757: for later insertion into another window.
                    758: This mode is entered with the
                    759: .Ic copy-mode
                    760: command, bound to
1.113     nicm      761: .Ql \&[
1.1       nicm      762: by default.
1.164     nicm      763: It is also entered when a command that produces output, such as
                    764: .Ic list-keys ,
                    765: is executed from a key binding.
1.1       nicm      766: .Pp
1.6       jmc       767: The keys available depend on whether emacs or vi mode is selected
                    768: (see the
1.1       nicm      769: .Ic mode-keys
                    770: option).
                    771: The following keys are supported as appropriate for the mode:
1.157     nicm      772: .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.1       nicm      773: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27      nicm      774: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.142     nicm      775: .It Li "Bottom of history" Ta "G" Ta "M-<"
1.1       nicm      776: .It Li "Clear selection" Ta "Escape" Ta "C-g"
                    777: .It Li "Copy selection" Ta "Enter" Ta "M-w"
                    778: .It Li "Cursor down" Ta "j" Ta "Down"
1.70      nicm      779: .It Li "Cursor left" Ta "h" Ta "Left"
                    780: .It Li "Cursor right" Ta "l" Ta "Right"
1.116     nicm      781: .It Li "Cursor to bottom line" Ta "L" Ta ""
                    782: .It Li "Cursor to middle line" Ta "M" Ta "M-r"
                    783: .It Li "Cursor to top line" Ta "H" Ta "M-R"
1.70      nicm      784: .It Li "Cursor up" Ta "k" Ta "Up"
1.71      nicm      785: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.227     nicm      786: .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
1.1       nicm      787: .It Li "End of line" Ta "$" Ta "C-e"
1.142     nicm      788: .It Li "Go to line" Ta ":" Ta "g"
1.116     nicm      789: .It Li "Half page down" Ta "C-d" Ta "M-Down"
                    790: .It Li "Half page up" Ta "C-u" Ta "M-Up"
1.157     nicm      791: .It Li "Jump forward" Ta "f" Ta "f"
                    792: .It Li "Jump backward" Ta "F" Ta "F"
                    793: .It Li "Jump again" Ta ";" Ta ";"
                    794: .It Li "Jump again in reverse" Ta "," Ta ","
1.1       nicm      795: .It Li "Next page" Ta "C-f" Ta "Page down"
1.146     nicm      796: .It Li "Next space" Ta "W" Ta ""
                    797: .It Li "Next space, end of word" Ta "E" Ta ""
1.143     nicm      798: .It Li "Next word" Ta "w" Ta ""
                    799: .It Li "Next word end" Ta "e" Ta "M-f"
1.70      nicm      800: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.116     nicm      801: .It Li "Previous page" Ta "C-b" Ta "Page up"
1.1       nicm      802: .It Li "Previous word" Ta "b" Ta "M-b"
1.146     nicm      803: .It Li "Previous space" Ta "B" Ta ""
1.1       nicm      804: .It Li "Quit mode" Ta "q" Ta "Escape"
1.147     nicm      805: .It Li "Rectangle toggle" Ta "v" Ta "R"
1.141     nicm      806: .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
                    807: .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
1.70      nicm      808: .It Li "Search again" Ta "n" Ta "n"
1.152     nicm      809: .It Li "Search again in reverse" Ta "N" Ta "N"
1.70      nicm      810: .It Li "Search backward" Ta "?" Ta "C-r"
                    811: .It Li "Search forward" Ta "/" Ta "C-s"
                    812: .It Li "Start of line" Ta "0" Ta "C-a"
1.1       nicm      813: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.142     nicm      814: .It Li "Top of history" Ta "g" Ta "M->"
1.80      nicm      815: .It Li "Transpose chars" Ta "" Ta "C-t"
1.1       nicm      816: .El
1.146     nicm      817: .Pp
                    818: The next and previous word keys use space and the
                    819: .Ql - ,
1.154     nicm      820: .Ql _
1.146     nicm      821: and
                    822: .Ql @
1.154     nicm      823: characters as word delimiters by default, but this can be adjusted by
                    824: setting the
                    825: .Em word-separators
                    826: window option.
1.146     nicm      827: Next word moves to the start of the next word, next word end to the end of the
                    828: next word and previous word to the start of the previous word.
                    829: The three next and previous space keys work similarly but use a space alone as
                    830: the word separator.
1.157     nicm      831: .Pp
                    832: The jump commands enable quick movement within a line.
                    833: For instance, typing
                    834: .Ql f
                    835: followed by
                    836: .Ql /
                    837: will move the cursor to the next
                    838: .Ql /
                    839: character on the current line.
                    840: A
                    841: .Ql \&;
                    842: will then jump to the next occurrence.
1.1       nicm      843: .Pp
1.155     nicm      844: Commands in copy mode may be prefaced by an optional repeat count.
                    845: With vi key bindings, a prefix is entered using the number keys; with
                    846: emacs, the Alt (meta) key and a number begins prefix entry.
                    847: For example, to move the cursor forward by ten words, use
                    848: .Ql M-1 0 M-f
                    849: in emacs mode, and
                    850: .Ql 10w
                    851: in vi.
                    852: .Pp
                    853: Mode key bindings are defined in a set of named tables:
1.48      nicm      854: .Em vi-edit
                    855: and
                    856: .Em emacs-edit
                    857: for keys used when line editing at the command prompt;
                    858: .Em vi-choice
                    859: and
                    860: .Em emacs-choice
                    861: for keys used when choosing from lists (such as produced by the
1.144     nicm      862: .Ic choose-window
1.164     nicm      863: command); and
1.48      nicm      864: .Em vi-copy
                    865: and
                    866: .Em emacs-copy
1.97      nicm      867: used in copy mode.
1.48      nicm      868: The tables may be viewed with the
                    869: .Ic list-keys
1.49      nicm      870: command and keys modified or removed with
                    871: .Ic bind-key
                    872: and
                    873: .Ic unbind-key .
1.48      nicm      874: .Pp
1.2       nicm      875: The paste buffer key pastes the first line from the top paste buffer on the
                    876: stack.
1.57      jmc       877: .Pp
1.164     nicm      878: The synopsis for the
                    879: .Ic copy-mode
                    880: command is:
1.57      jmc       881: .Bl -tag -width Ds
                    882: .It Xo Ic copy-mode
                    883: .Op Fl u
1.72      nicm      884: .Op Fl t Ar target-pane
1.57      jmc       885: .Xc
                    886: Enter copy mode.
                    887: The
                    888: .Fl u
                    889: option scrolls one page up.
                    890: .El
1.18      nicm      891: .Pp
1.1       nicm      892: Each window displayed by
                    893: .Nm
                    894: may be split into one or more
                    895: .Em panes ;
                    896: each pane takes up a certain area of the display and is a separate terminal.
                    897: A window may be split into panes using the
                    898: .Ic split-window
                    899: command.
1.38      nicm      900: Windows may be split horizontally (with the
                    901: .Fl h
                    902: flag) or vertically.
                    903: Panes may be resized with the
                    904: .Ic resize-pane
1.1       nicm      905: command (bound to
1.38      nicm      906: .Ql C-up ,
                    907: .Ql C-down
                    908: .Ql C-left
                    909: and
                    910: .Ql C-right
1.1       nicm      911: by default), the current pane may be changed with the
1.156     nicm      912: .Ic select-pane
                    913: command and the
1.1       nicm      914: .Ic rotate-window
                    915: and
                    916: .Ic swap-pane
1.38      nicm      917: commands may be used to swap panes without changing their position.
                    918: Panes are numbered beginning from zero in the order they are created.
                    919: .Pp
                    920: A number of preset
                    921: .Em layouts
                    922: are available.
                    923: These may be selected with the
                    924: .Ic select-layout
                    925: command or cycled with
                    926: .Ic next-layout
                    927: (bound to
1.149     nicm      928: .Ql Space
1.131     nicm      929: by default); once a layout is chosen, panes within it may be moved and resized
                    930: as normal.
1.1       nicm      931: .Pp
                    932: The following layouts are supported:
                    933: .Bl -tag -width Ds
                    934: .It Ic even-horizontal
                    935: Panes are spread out evenly from left to right across the window.
                    936: .It Ic even-vertical
                    937: Panes are spread evenly from top to bottom.
1.2       nicm      938: .It Ic main-horizontal
1.131     nicm      939: A large (main) pane is shown at the top of the window and the remaining panes
                    940: are spread from left to right in the leftover space at the bottom.
1.2       nicm      941: Use the
                    942: .Em main-pane-height
                    943: window option to specify the height of the top pane.
1.1       nicm      944: .It Ic main-vertical
1.2       nicm      945: Similar to
                    946: .Ic main-horizontal
                    947: but the large pane is placed on the left and the others spread from top to
                    948: bottom along the right.
                    949: See the
                    950: .Em main-pane-width
                    951: window option.
1.165     nicm      952: .It Ic tiled
                    953: Panes are spread out as evenly as possible over the window in both rows and
                    954: columns.
1.1       nicm      955: .El
1.8       nicm      956: .Pp
1.181     nicm      957: In addition,
                    958: .Ic select-layout
                    959: may be used to apply a previously used layout - the
                    960: .Ic list-windows
                    961: command displays the layout of each window in a form suitable for use with
                    962: .Ic select-layout .
                    963: For example:
                    964: .Bd -literal -offset indent
                    965: $ tmux list-windows
                    966: 0: ksh [159x48]
                    967:     layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                    968: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
                    969: .Ed
1.196     nicm      970: .Pp
1.181     nicm      971: .Nm
                    972: automatically adjusts the size of the layout for the current window size.
                    973: Note that a layout cannot be applied to a window with more panes than that
                    974: from which the layout was originally defined.
                    975: .Pp
1.57      jmc       976: Commands related to windows and panes are as follows:
                    977: .Bl -tag -width Ds
                    978: .It Xo Ic break-pane
                    979: .Op Fl d
                    980: .Op Fl t Ar target-pane
                    981: .Xc
                    982: .D1 (alias: Ic breakp )
                    983: Break
                    984: .Ar target-pane
                    985: off from its containing window to make it the only pane in a new window.
                    986: If
                    987: .Fl d
                    988: is given, the new window does not become the current window.
1.128     nicm      989: .It Xo Ic capture-pane
                    990: .Op Fl b Ar buffer-index
1.213     nicm      991: .Op Fl E Ar end-line
                    992: .Op Fl S Ar start-line
1.128     nicm      993: .Op Fl t Ar target-pane
                    994: .Xc
                    995: .D1 (alias: Ic capturep )
                    996: Capture the contents of a pane to the specified buffer, or a new buffer if none
                    997: is specified.
1.213     nicm      998: .Pp
                    999: .Fl S
                   1000: and
                   1001: .Fl E
                   1002: specify the starting and ending line numbers, zero is the first line of the
                   1003: visible pane and negative numbers are lines in the history.
                   1004: The default is to capture only the visible contents of the pane.
1.76      nicm     1005: .It Xo
                   1006: .Ic choose-client
                   1007: .Op Fl t Ar target-window
                   1008: .Op Ar template
                   1009: .Xc
                   1010: Put a window into client choice mode, allowing a client to be selected
                   1011: interactively from a list.
                   1012: After a client is chosen,
                   1013: .Ql %%
                   1014: is replaced by the client
                   1015: .Xr pty 4
                   1016: path in
                   1017: .Ar template
                   1018: and the result executed as a command.
                   1019: If
                   1020: .Ar template
                   1021: is not given, "detach-client -t '%%'" is used.
1.57      jmc      1022: This command works only from inside
                   1023: .Nm .
1.76      nicm     1024: .It Xo
                   1025: .Ic choose-session
                   1026: .Op Fl t Ar target-window
                   1027: .Op Ar template
                   1028: .Xc
                   1029: Put a window into session choice mode, where a session may be selected
                   1030: interactively from a list.
                   1031: When one is chosen,
                   1032: .Ql %%
                   1033: is replaced by the session name in
                   1034: .Ar template
                   1035: and the result executed as a command.
                   1036: If
                   1037: .Ar template
                   1038: is not given, "switch-client -t '%%'" is used.
                   1039: This command works only from inside
                   1040: .Nm .
                   1041: .It Xo
                   1042: .Ic choose-window
                   1043: .Op Fl t Ar target-window
                   1044: .Op Ar template
                   1045: .Xc
                   1046: Put a window into window choice mode, where a window may be chosen
                   1047: interactively from a list.
                   1048: After a window is selected,
                   1049: .Ql %%
                   1050: is replaced by the session name and window index in
                   1051: .Ar template
                   1052: and the result executed as a command.
                   1053: If
                   1054: .Ar template
                   1055: is not given, "select-window -t '%%'" is used.
1.57      jmc      1056: This command works only from inside
                   1057: .Nm .
1.78      nicm     1058: .It Ic display-panes Op Fl t Ar target-client
                   1059: .D1 (alias: Ic displayp)
                   1060: Display a visible indicator of each pane shown by
                   1061: .Ar target-client .
                   1062: See the
1.145     nicm     1063: .Ic display-panes-time ,
                   1064: .Ic display-panes-colour ,
1.78      nicm     1065: and
1.145     nicm     1066: .Ic display-panes-active-colour
1.78      nicm     1067: session options.
1.84      nicm     1068: While the indicator is on screen, a pane may be selected with the
                   1069: .Ql 0
                   1070: to
                   1071: .Ql 9
                   1072: keys.
1.57      jmc      1073: .It Xo Ic find-window
                   1074: .Op Fl t Ar target-window
                   1075: .Ar match-string
                   1076: .Xc
                   1077: .D1 (alias: Ic findw )
                   1078: Search for the
                   1079: .Xr fnmatch 3
                   1080: pattern
                   1081: .Ar match-string
                   1082: in window names, titles, and visible content (but not history).
                   1083: If only one window is matched, it'll be automatically selected, otherwise a
                   1084: choice list is shown.
                   1085: This command only works from inside
1.1       nicm     1086: .Nm .
1.137     nicm     1087: .It Xo Ic join-pane
                   1088: .Op Fl dhv
                   1089: .Oo Fl l
                   1090: .Ar size |
                   1091: .Fl p Ar percentage Oc
                   1092: .Op Fl s Ar src-pane
                   1093: .Op Fl t Ar dst-pane
                   1094: .Xc
                   1095: .D1 (alias: Ic joinp )
                   1096: Like
                   1097: .Ic split-window ,
                   1098: but instead of splitting
                   1099: .Ar dst-pane
                   1100: and creating a new pane, split it and move
                   1101: .Ar src-pane
                   1102: into the space.
                   1103: This can be used to reverse
                   1104: .Ic break-pane .
1.112     nicm     1105: .It Xo Ic kill-pane
                   1106: .Op Fl a
                   1107: .Op Fl t Ar target-pane
                   1108: .Xc
1.57      jmc      1109: .D1 (alias: Ic killp )
                   1110: Destroy the given pane.
                   1111: If no panes remain in the containing window, it is also destroyed.
1.112     nicm     1112: The
                   1113: .Fl a
                   1114: option kills all but the pane given with
                   1115: .Fl t .
1.57      jmc      1116: .It Ic kill-window Op Fl t Ar target-window
                   1117: .D1 (alias: Ic killw )
                   1118: Kill the current window or the window at
                   1119: .Ar target-window ,
1.1       nicm     1120: removing it from any sessions to which it is linked.
1.187     nicm     1121: .It Ic last-pane Op Fl t Ar target-window
                   1122: .D1 (alias: Ic lastp )
                   1123: Select the last (previously selected) pane.
1.56      jmc      1124: .It Ic last-window Op Fl t Ar target-session
1.1       nicm     1125: .D1 (alias: Ic last )
                   1126: Select the last (previously selected) window.
                   1127: If no
                   1128: .Ar target-session
                   1129: is specified, select the last window of the current session.
                   1130: .It Xo Ic link-window
                   1131: .Op Fl dk
                   1132: .Op Fl s Ar src-window
                   1133: .Op Fl t Ar dst-window
                   1134: .Xc
                   1135: .D1 (alias: Ic linkw )
                   1136: Link the window at
                   1137: .Ar src-window
                   1138: to the specified
                   1139: .Ar dst-window .
                   1140: If
                   1141: .Ar dst-window
                   1142: is specified and no such window exists, the
                   1143: .Ar src-window
                   1144: is linked there.
                   1145: If
                   1146: .Fl k
                   1147: is given and
                   1148: .Ar dst-window
                   1149: exists, it is killed, otherwise an error is generated.
                   1150: If
                   1151: .Fl d
                   1152: is given, the newly linked window is not selected.
1.214     nicm     1153: .It Xo Ic list-panes
                   1154: .Op Fl as
1.245     nicm     1155: .Op Fl F Ar format
1.214     nicm     1156: .Op Fl t Ar target
                   1157: .Xc
1.104     nicm     1158: .D1 (alias: Ic lsp )
1.214     nicm     1159: If
                   1160: .Fl a
                   1161: is given,
                   1162: .Ar target
                   1163: is ignored and all panes on the server are listed.
                   1164: If
                   1165: .Fl s
                   1166: is given,
                   1167: .Ar target
                   1168: is a session (or the current session).
                   1169: If neither is given,
                   1170: .Ar target
                   1171: is a window (or the current window).
1.247   ! nicm     1172: For the meaning of the
        !          1173: .Fl F
        !          1174: flag, see the
        !          1175: .Sx FORMATS
        !          1176: section.
1.214     nicm     1177: .It Xo Ic list-windows
                   1178: .Op Fl a
1.245     nicm     1179: .Op Fl F Ar format
1.214     nicm     1180: .Op Fl t Ar target-session
                   1181: .Xc
1.1       nicm     1182: .D1 (alias: Ic lsw )
1.214     nicm     1183: If
                   1184: .Fl a
                   1185: is given, list all windows on the server.
                   1186: Otherwise, list windows in the current session or in
1.1       nicm     1187: .Ar target-session .
1.245     nicm     1188: For the meaning of the
                   1189: .Fl F
                   1190: flag, see the
                   1191: .Sx FORMATS
                   1192: section.
1.1       nicm     1193: .It Xo Ic move-window
1.175     nicm     1194: .Op Fl dk
1.1       nicm     1195: .Op Fl s Ar src-window
                   1196: .Op Fl t Ar dst-window
                   1197: .Xc
                   1198: .D1 (alias: Ic movew )
                   1199: This is similar to
                   1200: .Ic link-window ,
                   1201: except the window at
                   1202: .Ar src-window
                   1203: is moved to
                   1204: .Ar dst-window .
                   1205: .It Xo Ic new-window
1.201     nicm     1206: .Op Fl adkP
1.1       nicm     1207: .Op Fl n Ar window-name
                   1208: .Op Fl t Ar target-window
1.153     nicm     1209: .Op Ar shell-command
1.1       nicm     1210: .Xc
                   1211: .D1 (alias: Ic neww )
                   1212: Create a new window.
1.160     nicm     1213: With
                   1214: .Fl a ,
                   1215: the new window is inserted at the next index up from the specified
                   1216: .Ar target-window ,
                   1217: moving windows up if necessary,
                   1218: otherwise
                   1219: .Ar target-window
                   1220: is the new window location.
                   1221: .Pp
1.1       nicm     1222: If
                   1223: .Fl d
                   1224: is given, the session does not make the new window the current window.
                   1225: .Ar target-window
1.28      nicm     1226: represents the window to be created; if the target already exists an error is
                   1227: shown, unless the
                   1228: .Fl k
                   1229: flag is used, in which case it is destroyed.
1.153     nicm     1230: .Ar shell-command
1.1       nicm     1231: is the command to execute.
                   1232: If
1.153     nicm     1233: .Ar shell-command
                   1234: is not specified, the value of the
                   1235: .Ic default-command
                   1236: option is used.
                   1237: .Pp
                   1238: When the shell command completes, the window closes.
                   1239: See the
                   1240: .Ic remain-on-exit
                   1241: option to change this behaviour.
1.1       nicm     1242: .Pp
                   1243: The
                   1244: .Ev TERM
                   1245: environment variable must be set to
                   1246: .Dq screen
                   1247: for all programs running
                   1248: .Em inside
                   1249: .Nm .
                   1250: New windows will automatically have
                   1251: .Dq TERM=screen
                   1252: added to their environment, but care must be taken not to reset this in shell
                   1253: start-up files.
1.201     nicm     1254: .Pp
                   1255: The
                   1256: .Fl P
                   1257: option prints the location of the new window after it has been created.
1.56      jmc      1258: .It Ic next-layout Op Fl t Ar target-window
1.1       nicm     1259: .D1 (alias: Ic nextl )
                   1260: Move a window to the next layout and rearrange the panes to fit.
                   1261: .It Xo Ic next-window
1.9       nicm     1262: .Op Fl a
1.1       nicm     1263: .Op Fl t Ar target-session
                   1264: .Xc
                   1265: .D1 (alias: Ic next )
                   1266: Move to the next window in the session.
1.9       nicm     1267: If
1.12      jmc      1268: .Fl a
1.9       nicm     1269: is used, move to the next window with a bell, activity or content alert.
1.107     nicm     1270: .It Xo Ic pipe-pane
                   1271: .Op Fl o
                   1272: .Op Fl t Ar target-pane
1.153     nicm     1273: .Op Ar shell-command
1.107     nicm     1274: .Xc
                   1275: .D1 (alias: Ic pipep )
                   1276: Pipe any output sent by the program in
                   1277: .Ar target-pane
                   1278: to a shell command.
                   1279: A pane may only be piped to one command at a time, any existing pipe is
                   1280: closed before
1.153     nicm     1281: .Ar shell-command
1.107     nicm     1282: is executed.
1.174     nicm     1283: The
                   1284: .Ar shell-command
                   1285: string may contain the special character sequences supported by the
                   1286: .Ic status-left
1.231     nicm     1287: option.
1.107     nicm     1288: If no
1.153     nicm     1289: .Ar shell-command
1.107     nicm     1290: is given, the current pipe (if any) is closed.
                   1291: .Pp
                   1292: The
                   1293: .Fl o
                   1294: option only opens a new pipe if no previous pipe exists, allowing a pipe to
                   1295: be toggled with a single key, for example:
                   1296: .Bd -literal -offset indent
1.174     nicm     1297: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107     nicm     1298: .Ed
1.176     nicm     1299: .It Xo Ic previous-layout
                   1300: .Op Fl t Ar target-window
                   1301: .Xc
                   1302: .D1 (alias: Ic prevl )
                   1303: Move to the previous layout in the session.
1.1       nicm     1304: .It Xo Ic previous-window
1.9       nicm     1305: .Op Fl a
1.1       nicm     1306: .Op Fl t Ar target-session
                   1307: .Xc
                   1308: .D1 (alias: Ic prev )
                   1309: Move to the previous window in the session.
1.9       nicm     1310: With
                   1311: .Fl a ,
                   1312: move to the previous window with a bell, activity or content alert.
1.1       nicm     1313: .It Xo Ic rename-window
                   1314: .Op Fl t Ar target-window
                   1315: .Ar new-name
                   1316: .Xc
                   1317: .D1 (alias: Ic renamew )
                   1318: Rename the current window, or the window at
                   1319: .Ar target-window
                   1320: if specified, to
                   1321: .Ar new-name .
                   1322: .It Xo Ic resize-pane
1.39      jmc      1323: .Op Fl DLRU
1.52      nicm     1324: .Op Fl t Ar target-pane
1.1       nicm     1325: .Op Ar adjustment
                   1326: .Xc
                   1327: .D1 (alias: Ic resizep )
1.57      jmc      1328: Resize a pane, upward with
                   1329: .Fl U
                   1330: (the default), downward with
                   1331: .Fl D ,
                   1332: to the left with
                   1333: .Fl L
                   1334: and to the right with
                   1335: .Fl R .
                   1336: The
                   1337: .Ar adjustment
                   1338: is given in lines or cells (the default is 1).
1.234     nicm     1339: .It Xo Ic respawn-pane
                   1340: .Op Fl k
                   1341: .Op Fl t Ar target-pane
                   1342: .Op Ar shell-command
                   1343: .Xc
                   1344: .D1 (alias: Ic respawnp )
                   1345: Reactivate a pane in which the command has exited (see the
                   1346: .Ic remain-on-exit
                   1347: window option).
                   1348: If
                   1349: .Ar shell-command
                   1350: is not given, the command used when the pane was created is executed.
                   1351: The pane must be already inactive, unless
                   1352: .Fl k
                   1353: is given, in which case any existing command is killed.
1.57      jmc      1354: .It Xo Ic respawn-window
                   1355: .Op Fl k
                   1356: .Op Fl t Ar target-window
1.153     nicm     1357: .Op Ar shell-command
1.57      jmc      1358: .Xc
                   1359: .D1 (alias: Ic respawnw )
1.153     nicm     1360: Reactivate a window in which the command has exited (see the
1.57      jmc      1361: .Ic remain-on-exit
                   1362: window option).
                   1363: If
1.153     nicm     1364: .Ar shell-command
1.57      jmc      1365: is not given, the command used when the window was created is executed.
                   1366: The window must be already inactive, unless
                   1367: .Fl k
                   1368: is given, in which case any existing command is killed.
                   1369: .It Xo Ic rotate-window
                   1370: .Op Fl DU
                   1371: .Op Fl t Ar target-window
                   1372: .Xc
                   1373: .D1 (alias: Ic rotatew )
                   1374: Rotate the positions of the panes within a window, either upward (numerically
                   1375: lower) with
                   1376: .Fl U
                   1377: or downward (numerically higher).
                   1378: .It Xo Ic select-layout
1.204     nicm     1379: .Op Fl np
1.57      jmc      1380: .Op Fl t Ar target-window
                   1381: .Op Ar layout-name
                   1382: .Xc
1.176     nicm     1383: .D1 (alias: Ic selectl )
1.57      jmc      1384: Choose a specific layout for a window.
                   1385: If
                   1386: .Ar layout-name
1.181     nicm     1387: is not given, the last preset layout used (if any) is reapplied.
1.204     nicm     1388: .Fl n
                   1389: and
                   1390: .Fl p
                   1391: are equivalent to the
                   1392: .Ic next-layout
                   1393: and
                   1394: .Ic previous-layout
                   1395: commands.
1.156     nicm     1396: .It Xo Ic select-pane
1.204     nicm     1397: .Op Fl lDLRU
1.156     nicm     1398: .Op Fl t Ar target-pane
                   1399: .Xc
1.57      jmc      1400: .D1 (alias: Ic selectp )
                   1401: Make pane
                   1402: .Ar target-pane
                   1403: the active pane in window
                   1404: .Ar target-window .
1.156     nicm     1405: If one of
                   1406: .Fl D ,
                   1407: .Fl L ,
                   1408: .Fl R ,
                   1409: or
                   1410: .Fl U
                   1411: is used, respectively the pane below, to the left, to the right, or above the
                   1412: target pane is used.
1.204     nicm     1413: .Fl l
                   1414: is the same as using the
                   1415: .Ic last-pane
                   1416: command.
                   1417: .It Xo Ic select-window
                   1418: .Op Fl lnp
                   1419: .Op Fl t Ar target-window
                   1420: .Xc
1.57      jmc      1421: .D1 (alias: Ic selectw )
                   1422: Select the window at
                   1423: .Ar target-window .
1.204     nicm     1424: .Fl l ,
                   1425: .Fl n
                   1426: and
                   1427: .Fl p
                   1428: are equivalent to the
                   1429: .Ic last-window ,
                   1430: .Ic next-window
                   1431: and
                   1432: .Ic previous-window
                   1433: commands.
1.57      jmc      1434: .It Xo Ic split-window
1.201     nicm     1435: .Op Fl dhvP
1.57      jmc      1436: .Oo Fl l
                   1437: .Ar size |
                   1438: .Fl p Ar percentage Oc
1.136     nicm     1439: .Op Fl t Ar target-pane
1.153     nicm     1440: .Op Ar shell-command
1.57      jmc      1441: .Xc
1.176     nicm     1442: .D1 (alias: Ic splitw )
1.136     nicm     1443: Create a new pane by splitting
                   1444: .Ar target-pane :
1.57      jmc      1445: .Fl h
                   1446: does a horizontal split and
                   1447: .Fl v
                   1448: a vertical split; if neither is specified,
                   1449: .Fl v
                   1450: is assumed.
                   1451: The
                   1452: .Fl l
                   1453: and
                   1454: .Fl p
1.136     nicm     1455: options specify the size of the new pane in lines (for vertical split) or in
1.57      jmc      1456: cells (for horizontal split), or as a percentage, respectively.
1.136     nicm     1457: All other options have the same meaning as for the
1.57      jmc      1458: .Ic new-window
                   1459: command.
                   1460: .It Xo Ic swap-pane
                   1461: .Op Fl dDU
                   1462: .Op Fl s Ar src-pane
                   1463: .Op Fl t Ar dst-pane
                   1464: .Xc
                   1465: .D1 (alias: Ic swapp )
                   1466: Swap two panes.
                   1467: If
                   1468: .Fl U
                   1469: is used and no source pane is specified with
                   1470: .Fl s ,
                   1471: .Ar dst-pane
                   1472: is swapped with the previous pane (before it numerically);
                   1473: .Fl D
                   1474: swaps with the next pane (after it numerically).
1.138     nicm     1475: .Fl d
                   1476: instructs
                   1477: .Nm
                   1478: not to change the active pane.
1.57      jmc      1479: .It Xo Ic swap-window
                   1480: .Op Fl d
                   1481: .Op Fl s Ar src-window
                   1482: .Op Fl t Ar dst-window
                   1483: .Xc
                   1484: .D1 (alias: Ic swapw )
                   1485: This is similar to
                   1486: .Ic link-window ,
                   1487: except the source and destination windows are swapped.
                   1488: It is an error if no window exists at
                   1489: .Ar src-window .
                   1490: .It Xo Ic unlink-window
1.1       nicm     1491: .Op Fl k
                   1492: .Op Fl t Ar target-window
                   1493: .Xc
1.57      jmc      1494: .D1 (alias: Ic unlinkw )
                   1495: Unlink
                   1496: .Ar target-window .
                   1497: Unless
                   1498: .Fl k
                   1499: is given, a window may be unlinked only if it is linked to multiple sessions -
                   1500: windows may not be linked to no sessions;
                   1501: if
1.1       nicm     1502: .Fl k
1.57      jmc      1503: is specified and the window is linked to only one session, it is unlinked and
                   1504: destroyed.
                   1505: .El
                   1506: .Sh KEY BINDINGS
1.93      nicm     1507: .Nm
                   1508: allows a command to be bound to most keys, with or without a prefix key.
                   1509: When specifying keys, most represent themselves (for example
                   1510: .Ql A
                   1511: to
1.95      jmc      1512: .Ql Z ) .
1.93      nicm     1513: Ctrl keys may be prefixed with
                   1514: .Ql C-
                   1515: or
1.95      jmc      1516: .Ql ^ ,
                   1517: and Alt (meta) with
1.93      nicm     1518: .Ql M- .
                   1519: In addition, the following special key names are accepted:
1.126     nicm     1520: .Em Up ,
                   1521: .Em Down ,
                   1522: .Em Left ,
                   1523: .Em Right ,
1.93      nicm     1524: .Em BSpace ,
                   1525: .Em BTab ,
                   1526: .Em DC
                   1527: (Delete),
                   1528: .Em End ,
                   1529: .Em Enter ,
                   1530: .Em Escape ,
                   1531: .Em F1
                   1532: to
                   1533: .Em F20 ,
                   1534: .Em Home ,
                   1535: .Em IC
                   1536: (Insert),
                   1537: .Em NPage
                   1538: (Page Up),
                   1539: .Em PPage
                   1540: (Page Down),
                   1541: .Em Space ,
                   1542: and
                   1543: .Em Tab .
                   1544: Note that to bind the
                   1545: .Ql \&"
                   1546: or
                   1547: .Ql '
                   1548: keys, quotation marks are necessary, for example:
                   1549: .Bd -literal -offset indent
                   1550: bind-key '"' split-window
1.167     nicm     1551: bind-key "'" new-window
1.93      nicm     1552: .Ed
                   1553: .Pp
1.57      jmc      1554: Commands related to key bindings are as follows:
                   1555: .Bl -tag -width Ds
                   1556: .It Xo Ic bind-key
                   1557: .Op Fl cnr
                   1558: .Op Fl t Ar key-table
                   1559: .Ar key Ar command Op Ar arguments
1.1       nicm     1560: .Xc
1.57      jmc      1561: .D1 (alias: Ic bind )
                   1562: Bind key
                   1563: .Ar key
                   1564: to
                   1565: .Ar command .
                   1566: By default (without
                   1567: .Fl t )
                   1568: the primary key bindings are modified (those normally activated with the prefix
                   1569: key); in this case, if
                   1570: .Fl n
                   1571: is specified, it is not necessary to use the prefix key,
                   1572: .Ar command
                   1573: is bound to
                   1574: .Ar key
                   1575: alone.
1.1       nicm     1576: The
1.57      jmc      1577: .Fl r
                   1578: flag indicates this key may repeat, see the
                   1579: .Ic repeat-time
                   1580: option.
                   1581: .Pp
                   1582: If
                   1583: .Fl t
                   1584: is present,
                   1585: .Ar key
                   1586: is bound in
                   1587: .Ar key-table :
                   1588: the binding for command mode with
                   1589: .Fl c
                   1590: or for normal mode without.
                   1591: To view the default bindings and possible commands, see the
                   1592: .Ic list-keys
                   1593: command.
                   1594: .It Ic list-keys Op Fl t Ar key-table
                   1595: .D1 (alias: Ic lsk )
                   1596: List all key bindings.
                   1597: Without
                   1598: .Fl t
                   1599: the primary key bindings - those executed when preceded by the prefix key -
                   1600: are printed.
                   1601: Keys bound without the prefix key (see
                   1602: .Ic bind-key
                   1603: .Fl n )
1.119     nicm     1604: are marked with
                   1605: .Ql (no prefix) .
1.57      jmc      1606: .Pp
                   1607: With
                   1608: .Fl t ,
                   1609: the key bindings in
                   1610: .Ar key-table
                   1611: are listed; this may be one of:
                   1612: .Em vi-edit ,
                   1613: .Em emacs-edit ,
                   1614: .Em vi-choice ,
                   1615: .Em emacs-choice ,
                   1616: .Em vi-copy
                   1617: or
                   1618: .Em emacs-copy .
                   1619: .It Xo Ic send-keys
1.72      nicm     1620: .Op Fl t Ar target-pane
1.57      jmc      1621: .Ar key Ar ...
1.1       nicm     1622: .Xc
1.57      jmc      1623: .D1 (alias: Ic send )
                   1624: Send a key or keys to a window.
                   1625: Each argument
                   1626: .Ar key
                   1627: is the name of the key (such as
                   1628: .Ql C-a
                   1629: or
                   1630: .Ql npage
                   1631: ) to send; if the string is not recognised as a key, it is sent as a series of
                   1632: characters.
                   1633: All arguments are sent sequentially from first to last.
1.72      nicm     1634: .It Ic send-prefix Op Fl t Ar target-pane
1.57      jmc      1635: Send the prefix key to a window as if it was pressed.
1.89      nicm     1636: If multiple prefix keys are configured, only the first is sent.
1.57      jmc      1637: .It Xo Ic unbind-key
1.189     nicm     1638: .Op Fl acn
1.57      jmc      1639: .Op Fl t Ar key-table
                   1640: .Ar key
1.2       nicm     1641: .Xc
1.57      jmc      1642: .D1 (alias: Ic unbind )
                   1643: Unbind the command bound to
                   1644: .Ar key .
                   1645: Without
                   1646: .Fl t
                   1647: the primary key bindings are modified; in this case, if
                   1648: .Fl n
                   1649: is specified, the command bound to
                   1650: .Ar key
                   1651: without a prefix (if any) is removed.
1.189     nicm     1652: If
                   1653: .Fl a
                   1654: is present, all key bindings are removed.
1.57      jmc      1655: .Pp
1.47      nicm     1656: If
1.57      jmc      1657: .Fl t
                   1658: is present,
                   1659: .Ar key
                   1660: in
                   1661: .Ar key-table
                   1662: is unbound: the binding for command mode with
                   1663: .Fl c
                   1664: or for normal mode without.
                   1665: .El
                   1666: .Sh OPTIONS
                   1667: The appearance and behaviour of
                   1668: .Nm
                   1669: may be modified by changing the value of various options.
1.133     nicm     1670: There are three types of option:
                   1671: .Em server options ,
1.57      jmc      1672: .Em session options
                   1673: and
                   1674: .Em window options .
                   1675: .Pp
1.133     nicm     1676: The
                   1677: .Nm
                   1678: server has a set of global options which do not apply to any particular
                   1679: window or session.
                   1680: These are altered with the
                   1681: .Ic set-option
                   1682: .Fl s
                   1683: command, or displayed with the
                   1684: .Ic show-options
                   1685: .Fl s
                   1686: command.
                   1687: .Pp
                   1688: In addition, each individual session may have a set of session options, and
                   1689: there is a separate set of global session options.
1.57      jmc      1690: Sessions which do not have a particular option configured inherit the value
                   1691: from the global session options.
                   1692: Session options are set or unset with the
                   1693: .Ic set-option
                   1694: command and may be listed with the
                   1695: .Ic show-options
                   1696: command.
1.133     nicm     1697: The available server and session options are listed under the
1.57      jmc      1698: .Ic set-option
                   1699: command.
                   1700: .Pp
                   1701: Similarly, a set of window options is attached to each window, and there is
                   1702: a set of global window options from which any unset options are inherited.
                   1703: Window options are altered with the
                   1704: .Ic set-window-option
                   1705: command and can be listed with the
                   1706: .Ic show-window-options
                   1707: command.
                   1708: All window options are documented with the
                   1709: .Ic set-window-option
                   1710: command.
                   1711: .Pp
                   1712: Commands which set options are as follows:
                   1713: .Bl -tag -width Ds
1.1       nicm     1714: .It Xo Ic set-option
1.133     nicm     1715: .Op Fl agsuw
1.129     nicm     1716: .Op Fl t Ar target-session | Ar target-window
1.1       nicm     1717: .Ar option Ar value
                   1718: .Xc
                   1719: .D1 (alias: Ic set )
1.133     nicm     1720: Set a window option with
                   1721: .Fl w
                   1722: (equivalent to the
                   1723: .Ic set-window-option
                   1724: command),
                   1725: a server option with
                   1726: .Fl s ,
                   1727: otherwise a session option.
                   1728: .Pp
                   1729: If
                   1730: .Fl g
                   1731: is specified, the global session or window option is set.
1.58      nicm     1732: With
                   1733: .Fl a ,
                   1734: and if the option expects a string,
                   1735: .Ar value
                   1736: is appended to the existing setting.
1.1       nicm     1737: The
                   1738: .Fl u
                   1739: flag unsets an option, so a session inherits the option from the global
1.133     nicm     1740: options.
                   1741: It is not possible to unset a global option.
1.1       nicm     1742: .Pp
1.133     nicm     1743: Available window options are listed under
                   1744: .Ic set-window-option .
                   1745: .Pp
                   1746: Available server options are:
                   1747: .Bl -tag -width Ds
1.198     nicm     1748: .It Ic buffer-limit Ar number
                   1749: Set the number of buffers; as new buffers are added to the top of the stack,
                   1750: old ones are removed from the bottom if necessary to maintain this maximum
                   1751: length.
1.239     nicm     1752: .It Ic escape-time Ar time
                   1753: Set the time in milliseconds for which
                   1754: .Nm
                   1755: waits after an escape is input to determine if it is part of a function or meta
                   1756: key sequences.
                   1757: The default is 500 milliseconds.
                   1758: .It Xo Ic exit-unattached
                   1759: .Op Ic on | off
                   1760: .Xc
                   1761: If enabled, the server will exit when there are no attached clients.
                   1762: .It Xo Ic quiet
                   1763: .Op Ic on | off
                   1764: .Xc
                   1765: Enable or disable the display of various informational messages (see also the
                   1766: .Fl q
                   1767: command line flag).
1.228     nicm     1768: .It Xo Ic set-clipboard
                   1769: .Op Ic on | off
                   1770: .Xc
                   1771: Attempt to set the terminal clipboard content using the
                   1772: \ee]52;...\e007
                   1773: .Xr xterm 1
                   1774: escape sequences.
                   1775: This option is on by default if there is an
                   1776: .Em \&Ms
                   1777: entry in the
                   1778: .Xr terminfo 5
                   1779: description for the client terminal.
                   1780: Note that this feature needs to be enabled in
                   1781: .Xr xterm 1
                   1782: by setting the resource:
                   1783: .Bd -literal -offset indent
                   1784: disallowedWindowOps: 20,21,SetXprop
                   1785: .Ed
                   1786: .Pp
                   1787: Or changing this property from the
                   1788: .Xr xterm 1
                   1789: interactive menu when required.
1.133     nicm     1790: .El
1.129     nicm     1791: .Pp
1.18      nicm     1792: Available session options are:
1.1       nicm     1793: .Bl -tag -width Ds
1.69      nicm     1794: .It Ic base-index Ar index
                   1795: Set the base index from which an unused index should be searched when a new
                   1796: window is created.
                   1797: The default is zero.
1.1       nicm     1798: .It Xo Ic bell-action
1.56      jmc      1799: .Op Ic any | none | current
1.1       nicm     1800: .Xc
                   1801: Set action on window bell.
                   1802: .Ic any
                   1803: means a bell in any window linked to a session causes a bell in the current
                   1804: window of that session,
                   1805: .Ic none
                   1806: means all bells are ignored and
                   1807: .Ic current
                   1808: means only bell in windows other than the current window are ignored.
1.237     nicm     1809: .It Xo Ic bell-on-alert
                   1810: .Op Ic on | off
                   1811: .Xc
                   1812: If on, ring the terminal bell when an activity, content or silence alert
                   1813: occurs.
1.153     nicm     1814: .It Ic default-command Ar shell-command
1.1       nicm     1815: Set the command used for new windows (if not specified when the window is
                   1816: created) to
1.153     nicm     1817: .Ar shell-command ,
1.79      nicm     1818: which may be any
                   1819: .Xr sh 1
                   1820: command.
1.19      nicm     1821: The default is an empty string, which instructs
                   1822: .Nm
1.79      nicm     1823: to create a login shell using the value of the
                   1824: .Ic default-shell
                   1825: option.
1.196     nicm     1826: .It Ic default-path Ar path
                   1827: Set the default working directory for processes created from keys, or
                   1828: interactively from the prompt.
                   1829: The default is empty, which means to use the working directory of the shell
                   1830: from which the server was started if it is available or the user's home if not.
1.79      nicm     1831: .It Ic default-shell Ar path
                   1832: Specify the default shell.
                   1833: This is used as the login shell for new windows when the
                   1834: .Ic default-command
                   1835: option is set to empty, and must be the full path of the executable.
                   1836: When started
                   1837: .Nm
                   1838: tries to set a default value from the first suitable of the
1.19      nicm     1839: .Ev SHELL
1.79      nicm     1840: environment variable, the shell returned by
                   1841: .Xr getpwuid 3 ,
                   1842: or
                   1843: .Pa /bin/sh .
                   1844: This option should be configured when
                   1845: .Nm
                   1846: is used as a login shell.
1.22      nicm     1847: .It Ic default-terminal Ar terminal
                   1848: Set the default terminal for new windows created in this session - the
                   1849: default value of the
                   1850: .Ev TERM
                   1851: environment variable.
                   1852: For
                   1853: .Nm
                   1854: to work correctly, this
                   1855: .Em must
                   1856: be set to
                   1857: .Ql screen
                   1858: or a derivative of it.
1.206     nicm     1859: .It Xo Ic destroy-unattached
                   1860: .Op Ic on | off
                   1861: .Xc
1.185     nicm     1862: If enabled and the session is no longer attached to any clients, it is
                   1863: destroyed.
1.206     nicm     1864: .It Xo Ic detach-on-destroy
                   1865: .Op Ic on | off
                   1866: .Xc
1.184     nicm     1867: If on (the default), the client is detached when the session it is attached to
                   1868: is destroyed.
                   1869: If off, the client is switched to the most recently active of the remaining
                   1870: sessions.
1.145     nicm     1871: .It Ic display-panes-active-colour Ar colour
                   1872: Set the colour used by the
                   1873: .Ic display-panes
                   1874: command to show the indicator for the active pane.
1.78      nicm     1875: .It Ic display-panes-colour Ar colour
1.145     nicm     1876: Set the colour used by the
1.78      nicm     1877: .Ic display-panes
1.145     nicm     1878: command to show the indicators for inactive panes.
1.78      nicm     1879: .It Ic display-panes-time Ar time
                   1880: Set the time in milliseconds for which the indicators shown by the
                   1881: .Ic display-panes
                   1882: command appear.
1.21      nicm     1883: .It Ic display-time Ar time
1.78      nicm     1884: Set the amount of time for which status line messages and other on-screen
                   1885: indicators are displayed.
1.21      nicm     1886: .Ar time
                   1887: is in milliseconds.
1.1       nicm     1888: .It Ic history-limit Ar lines
                   1889: Set the maximum number of lines held in window history.
                   1890: This setting applies only to new windows - existing window histories are not
                   1891: resized and retain the limit at the point they were created.
                   1892: .It Ic lock-after-time Ar number
1.100     nicm     1893: Lock the session (like the
                   1894: .Ic lock-session
1.90      nicm     1895: command) after
1.1       nicm     1896: .Ar number
1.100     nicm     1897: seconds of inactivity, or the entire server (all sessions) if the
                   1898: .Ic lock-server
                   1899: option is set.
                   1900: The default is not to lock (set to 0).
1.153     nicm     1901: .It Ic lock-command Ar shell-command
1.90      nicm     1902: Command to run when locking each client.
                   1903: The default is to run
                   1904: .Xr lock 1
                   1905: with
                   1906: .Fl np .
1.100     nicm     1907: .It Xo Ic lock-server
                   1908: .Op Ic on | off
                   1909: .Xc
                   1910: If this option is
1.102     nicm     1911: .Ic on
1.100     nicm     1912: (the default),
                   1913: instead of each session locking individually as each has been
                   1914: idle for
1.108     jmc      1915: .Ic lock-after-time ,
                   1916: the entire server will lock after
1.100     nicm     1917: .Em all
                   1918: sessions would have locked.
                   1919: This has no effect as a session option; it must be set as a global option.
1.1       nicm     1920: .It Ic message-attr Ar attributes
                   1921: Set status line message attributes, where
                   1922: .Ar attributes
                   1923: is either
1.168     nicm     1924: .Ic none
1.1       nicm     1925: or a comma-delimited list of one or more of:
                   1926: .Ic bright
                   1927: (or
                   1928: .Ic bold ) ,
                   1929: .Ic dim ,
                   1930: .Ic underscore ,
                   1931: .Ic blink ,
                   1932: .Ic reverse ,
                   1933: .Ic hidden ,
                   1934: or
                   1935: .Ic italics .
                   1936: .It Ic message-bg Ar colour
                   1937: Set status line message background colour, where
                   1938: .Ar colour
                   1939: is one of:
                   1940: .Ic black ,
                   1941: .Ic red ,
                   1942: .Ic green ,
                   1943: .Ic yellow ,
                   1944: .Ic blue ,
                   1945: .Ic magenta ,
                   1946: .Ic cyan ,
1.85      nicm     1947: .Ic white ,
                   1948: .Ic colour0
                   1949: to
                   1950: .Ic colour255
1.205     nicm     1951: from the 256-colour set,
                   1952: .Ic default ,
                   1953: or a hexadecimal RGB string such as
                   1954: .Ql #ffffff ,
                   1955: which chooses the closest match from the default 256-colour set.
1.1       nicm     1956: .It Ic message-fg Ar colour
                   1957: Set status line message foreground colour.
1.120     nicm     1958: .It Ic message-limit Ar number
                   1959: Set the number of error or information messages to save in the message log for
                   1960: each client.
                   1961: The default is 20.
1.226     nicm     1962: .It Xo Ic mouse-resize-pane
                   1963: .Op Ic on | off
                   1964: .Xc
                   1965: If on,
                   1966: .Nm
                   1967: captures the mouse and allows panes to be resized by dragging on their borders.
1.102     nicm     1968: .It Xo Ic mouse-select-pane
                   1969: .Op Ic on | off
                   1970: .Xc
                   1971: If on,
                   1972: .Nm
                   1973: captures the mouse and when a window is split into multiple panes the mouse may
                   1974: be used to select the current pane.
                   1975: The mouse click is also passed through to the application as normal.
1.222     nicm     1976: .It Xo Ic mouse-select-window
                   1977: .Op Ic on | off
                   1978: .Xc
                   1979: If on, clicking the mouse on a window name in the status line will select that
                   1980: window.
1.239     nicm     1981: .It Xo Ic mouse-utf8
                   1982: .Op Ic on | off
                   1983: .Xc
                   1984: If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1.196     nicm     1985: .It Ic pane-active-border-bg Ar colour
                   1986: .It Ic pane-active-border-fg Ar colour
                   1987: Set the pane border colour for the currently active pane.
                   1988: .It Ic pane-border-bg Ar colour
1.135     nicm     1989: .It Ic pane-border-fg Ar colour
                   1990: Set the pane border colour for panes aside from the active pane.
1.89      nicm     1991: .It Ic prefix Ar keys
                   1992: Set the keys accepted as a prefix key.
                   1993: .Ar keys
                   1994: is a comma-separated list of key names, each of which individually behave as
                   1995: the prefix key.
1.21      nicm     1996: .It Ic repeat-time Ar time
1.1       nicm     1997: Allow multiple commands to be entered without pressing the prefix-key again
                   1998: in the specified
1.21      nicm     1999: .Ar time
1.1       nicm     2000: milliseconds (the default is 500).
                   2001: Whether a key repeats may be set when it is bound using the
                   2002: .Fl r
                   2003: flag to
                   2004: .Ic bind-key .
1.52      nicm     2005: Repeat is enabled for the default keys bound to the
                   2006: .Ic resize-pane
                   2007: command.
1.1       nicm     2008: .It Xo Ic set-remain-on-exit
1.56      jmc      2009: .Op Ic on | off
1.1       nicm     2010: .Xc
                   2011: Set the
                   2012: .Ic remain-on-exit
                   2013: window option for any windows first created in this session.
1.153     nicm     2014: When this option is true, windows in which the running program has
                   2015: exited do not close, instead remaining open but inactivate.
                   2016: Use the
                   2017: .Ic respawn-window
                   2018: command to reactivate such a window, or the
                   2019: .Ic kill-window
                   2020: command to destroy it.
1.1       nicm     2021: .It Xo Ic set-titles
1.56      jmc      2022: .Op Ic on | off
1.1       nicm     2023: .Xc
1.77      stsp     2024: Attempt to set the window title using the \ee]2;...\e007 xterm code if
1.1       nicm     2025: the terminal appears to be an xterm.
1.11      nicm     2026: This option is off by default.
1.6       jmc      2027: Note that elinks
1.1       nicm     2028: will only attempt to set the window title if the STY environment
                   2029: variable is set.
1.86      nicm     2030: .It Ic set-titles-string Ar string
                   2031: String used to set the window title if
                   2032: .Ic set-titles
                   2033: is on.
                   2034: Character sequences are replaced as for the
                   2035: .Ic status-left
                   2036: option.
1.1       nicm     2037: .It Xo Ic status
1.56      jmc      2038: .Op Ic on | off
1.1       nicm     2039: .Xc
                   2040: Show or hide the status line.
                   2041: .It Ic status-attr Ar attributes
                   2042: Set status line attributes.
                   2043: .It Ic status-bg Ar colour
                   2044: Set status line background colour.
                   2045: .It Ic status-fg Ar colour
                   2046: Set status line foreground colour.
                   2047: .It Ic status-interval Ar interval
                   2048: Update the status bar every
                   2049: .Ar interval
                   2050: seconds.
                   2051: By default, updates will occur every 15 seconds.
                   2052: A setting of zero disables redrawing at interval.
1.41      nicm     2053: .It Xo Ic status-justify
1.56      jmc      2054: .Op Ic left | centre | right
1.41      nicm     2055: .Xc
                   2056: Set the position of the window list component of the status line: left, centre
                   2057: or right justified.
1.1       nicm     2058: .It Xo Ic status-keys
1.56      jmc      2059: .Op Ic vi | emacs
1.1       nicm     2060: .Xc
1.6       jmc      2061: Use vi or emacs-style
1.1       nicm     2062: key bindings in the status line, for example at the command prompt.
1.191     nicm     2063: The default is emacs, unless the
                   2064: .Ev VISUAL
                   2065: or
                   2066: .Ev EDITOR
                   2067: environment variables are set and contain the string
                   2068: .Ql vi .
1.1       nicm     2069: .It Ic status-left Ar string
                   2070: Display
                   2071: .Ar string
                   2072: to the left of the status bar.
                   2073: .Ar string
                   2074: will be passed through
                   2075: .Xr strftime 3
                   2076: before being used.
                   2077: By default, the session name is shown.
                   2078: .Ar string
1.83      nicm     2079: may contain any of the following special character sequences:
1.1       nicm     2080: .Bl -column "Character pair" "Replaced with" -offset indent
                   2081: .It Sy "Character pair" Ta Sy "Replaced with"
1.153     nicm     2082: .It Li "#(shell-command)" Ta "First line of the command's output"
1.83      nicm     2083: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1       nicm     2084: .It Li "#H" Ta "Hostname of local host"
1.224     nicm     2085: .It Li "#h" Ta "Hostname of local host without the domain name"
1.125     nicm     2086: .It Li "#F" Ta "Current window flag"
1.35      nicm     2087: .It Li "#I" Ta "Current window index"
                   2088: .It Li "#P" Ta "Current pane index"
1.1       nicm     2089: .It Li "#S" Ta "Session name"
                   2090: .It Li "#T" Ta "Current window title"
1.35      nicm     2091: .It Li "#W" Ta "Current window name"
1.1       nicm     2092: .It Li "##" Ta "A literal" Ql #
                   2093: .El
1.83      nicm     2094: .Pp
1.153     nicm     2095: The #(shell-command) form executes
                   2096: .Ql shell-command
                   2097: and inserts the first line of its output.
1.103     nicm     2098: Note that shell commands are only executed once at the interval specified by
                   2099: the
                   2100: .Ic status-interval
                   2101: option: if the status line is redrawn in the meantime, the previous result is
                   2102: used.
1.161     nicm     2103: Shell commands are executed with the
                   2104: .Nm
                   2105: global environment set (see the
1.162     jmc      2106: .Sx ENVIRONMENT
                   2107: section).
1.163     nicm     2108: .Pp
                   2109: The window title (#T) is the title set by the program running within the window
                   2110: using the OSC title setting sequence, for example:
                   2111: .Bd -literal -offset indent
                   2112: $ printf '\e033]2;My Title\e033\e\e'
                   2113: .Ed
                   2114: .Pp
                   2115: When a window is first created, its title is the hostname.
1.109     nicm     2116: .Pp
1.83      nicm     2117: #[attributes] allows a comma-separated list of attributes to be specified,
                   2118: these may be
                   2119: .Ql fg=colour
                   2120: to set the foreground colour,
                   2121: .Ql bg=colour
1.131     nicm     2122: to set the background colour, the name of one of the attributes (listed under
                   2123: the
1.83      nicm     2124: .Ic message-attr
1.109     nicm     2125: option) to turn an attribute on, or an attribute prefixed with
                   2126: .Ql no
                   2127: to turn one off, for example
                   2128: .Ic nobright .
1.83      nicm     2129: Examples are:
                   2130: .Bd -literal -offset indent
                   2131: #(sysctl vm.loadavg)
                   2132: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
                   2133: .Ed
1.1       nicm     2134: .Pp
1.109     nicm     2135: Where appropriate, special character sequences may be prefixed with a number to
                   2136: specify the maximum length, for example
1.1       nicm     2137: .Ql #24T .
1.10      nicm     2138: .Pp
1.12      jmc      2139: By default, UTF-8 in
1.10      nicm     2140: .Ar string
                   2141: is not interpreted, to enable UTF-8, use the
                   2142: .Ic status-utf8
                   2143: option.
1.62      nicm     2144: .It Ic status-left-attr Ar attributes
1.66      jmc      2145: Set the attribute of the left part of the status line.
1.196     nicm     2146: .It Ic status-left-bg Ar colour
                   2147: Set the background colour of the left part of the status line.
1.62      nicm     2148: .It Ic status-left-fg Ar colour
                   2149: Set the foreground colour of the left part of the status line.
1.1       nicm     2150: .It Ic status-left-length Ar length
                   2151: Set the maximum
                   2152: .Ar length
                   2153: of the left component of the status bar.
                   2154: The default is 10.
                   2155: .It Ic status-right Ar string
                   2156: Display
                   2157: .Ar string
                   2158: to the right of the status bar.
1.151     nicm     2159: By default, the current window title in double quotes, the date and the time
                   2160: are shown.
1.1       nicm     2161: As with
                   2162: .Ic status-left ,
                   2163: .Ar string
                   2164: will be passed to
1.10      nicm     2165: .Xr strftime 3 ,
                   2166: character pairs are replaced, and UTF-8 is dependent on the
                   2167: .Ic status-utf8
                   2168: option.
1.62      nicm     2169: .It Ic status-right-attr Ar attributes
1.66      jmc      2170: Set the attribute of the right part of the status line.
1.196     nicm     2171: .It Ic status-right-bg Ar colour
                   2172: Set the background colour of the right part of the status line.
1.62      nicm     2173: .It Ic status-right-fg Ar colour
                   2174: Set the foreground colour of the right part of the status line.
1.1       nicm     2175: .It Ic status-right-length Ar length
                   2176: Set the maximum
                   2177: .Ar length
                   2178: of the right component of the status bar.
                   2179: The default is 40.
1.10      nicm     2180: .It Xo Ic status-utf8
1.56      jmc      2181: .Op Ic on | off
1.10      nicm     2182: .Xc
                   2183: Instruct
                   2184: .Nm
                   2185: to treat top-bit-set characters in the
                   2186: .Ic status-left
                   2187: and
                   2188: .Ic status-right
                   2189: strings as UTF-8; notably, this is important for wide characters.
                   2190: This option defaults to off.
1.55      jmc      2191: .It Ic terminal-overrides Ar string
1.54      nicm     2192: Contains a list of entries which override terminal descriptions read using
                   2193: .Xr terminfo 5 .
                   2194: .Ar string
                   2195: is a comma-separated list of items each a colon-separated string made up of a
                   2196: terminal type pattern (matched using
                   2197: .Xr fnmatch 3 )
                   2198: and a set of
                   2199: .Em name=value
                   2200: entries.
                   2201: .Pp
                   2202: For example, to set the
                   2203: .Ql clear
                   2204: .Xr terminfo 5
                   2205: entry to
                   2206: .Ql \ee[H\ee[2J
                   2207: for all terminal types and the
                   2208: .Ql dch1
                   2209: entry to
                   2210: .Ql \ee[P
1.55      jmc      2211: for the
1.54      nicm     2212: .Ql rxvt
                   2213: terminal type, the option could be set to the string:
                   2214: .Bd -literal -offset indent
                   2215: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
                   2216: .Ed
                   2217: .Pp
                   2218: The terminal entry value is passed through
                   2219: .Xr strunvis 3
                   2220: before interpretation.
                   2221: The default value forcibly corrects the
                   2222: .Ql colors
                   2223: entry for terminals which support 88 or 256 colours:
                   2224: .Bd -literal -offset indent
1.225     nicm     2225: "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
1.54      nicm     2226: .Ed
1.63      nicm     2227: .It Ic update-environment Ar variables
                   2228: Set a space-separated string containing a list of environment variables to be
                   2229: copied into the session environment when a new session is created or an
                   2230: existing session is attached.
                   2231: Any variables that do not exist in the source environment are set to be
                   2232: removed from the session environment (as if
                   2233: .Fl r
                   2234: was given to the
                   2235: .Ic set-environment
                   2236: command).
                   2237: The default is
1.190     nicm     2238: "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
                   2239: XAUTHORITY".
1.37      nicm     2240: .It Xo Ic visual-activity
1.56      jmc      2241: .Op Ic on | off
1.37      nicm     2242: .Xc
                   2243: If on, display a status line message when activity occurs in a window
1.39      jmc      2244: for which the
1.37      nicm     2245: .Ic monitor-activity
                   2246: window option is enabled.
                   2247: .It Xo Ic visual-bell
1.56      jmc      2248: .Op Ic on | off
1.37      nicm     2249: .Xc
                   2250: If this option is on, a message is shown on a bell instead of it being passed
                   2251: through to the terminal (which normally makes a sound).
                   2252: Also see the
                   2253: .Ic bell-action
                   2254: option.
                   2255: .It Xo Ic visual-content
1.56      jmc      2256: .Op Ic on | off
1.37      nicm     2257: .Xc
                   2258: Like
                   2259: .Ic visual-activity ,
                   2260: display a message when content is present in a window
1.39      jmc      2261: for which the
1.37      nicm     2262: .Ic monitor-content
                   2263: window option is enabled.
1.192     nicm     2264: .It Xo Ic visual-silence
                   2265: .Op Ic on | off
                   2266: .Xc
                   2267: If
                   2268: .Ic monitor-silence
                   2269: is enabled, prints a message after the interval has expired on a given window.
1.1       nicm     2270: .El
                   2271: .It Xo Ic set-window-option
1.58      nicm     2272: .Op Fl agu
1.1       nicm     2273: .Op Fl t Ar target-window
                   2274: .Ar option Ar value
                   2275: .Xc
                   2276: .D1 (alias: Ic setw )
1.18      nicm     2277: Set a window option.
1.1       nicm     2278: The
1.58      nicm     2279: .Fl a ,
1.1       nicm     2280: .Fl g
                   2281: and
                   2282: .Fl u
                   2283: flags work similarly to the
                   2284: .Ic set-option
                   2285: command.
                   2286: .Pp
1.18      nicm     2287: Supported window options are:
1.56      jmc      2288: .Pp
                   2289: .Bl -tag -width Ds -compact
1.1       nicm     2290: .It Xo Ic aggressive-resize
1.56      jmc      2291: .Op Ic on | off
1.1       nicm     2292: .Xc
                   2293: Aggressively resize the chosen window.
                   2294: This means that
                   2295: .Nm
                   2296: will resize the window to the size of the smallest session for which it is the
                   2297: current window, rather than the smallest session to which it is attached.
                   2298: The window may resize when the current window is changed on another sessions;
1.6       jmc      2299: this option is good for full-screen programs which support
                   2300: .Dv SIGWINCH
                   2301: and poor for interactive programs such as shells.
1.56      jmc      2302: .Pp
1.196     nicm     2303: .It Xo Ic alternate-screen
                   2304: .Op Ic on | off
                   2305: .Xc
                   2306: This option configures whether programs running inside
                   2307: .Nm
                   2308: may use the terminal alternate screen feature, which allows the
                   2309: .Em smcup
                   2310: and
                   2311: .Em rmcup
                   2312: .Xr terminfo 5
1.209     nicm     2313: capabilities.
                   2314: The alternate screen feature preserves the contents of the window when an
                   2315: interactive application starts and restores it on exit, so that any output
                   2316: visible before the application starts reappears unchanged after it exits.
                   2317: The default is on.
1.196     nicm     2318: .Pp
1.1       nicm     2319: .It Xo Ic automatic-rename
1.56      jmc      2320: .Op Ic on | off
1.1       nicm     2321: .Xc
                   2322: Control automatic window renaming.
                   2323: When this setting is enabled,
                   2324: .Nm
                   2325: will attempt - on supported platforms - to rename the window to reflect the
                   2326: command currently running in it.
                   2327: This flag is automatically disabled for an individual window when a name
                   2328: is specified at creation with
1.186     nicm     2329: .Ic new-window
                   2330: or
1.1       nicm     2331: .Ic new-session ,
                   2332: or later with
                   2333: .Ic rename-window .
                   2334: It may be switched off globally with:
                   2335: .Bd -literal -offset indent
                   2336: set-window-option -g automatic-rename off
                   2337: .Ed
1.56      jmc      2338: .Pp
1.1       nicm     2339: .It Ic clock-mode-colour Ar colour
                   2340: Set clock colour.
1.56      jmc      2341: .Pp
1.1       nicm     2342: .It Xo Ic clock-mode-style
1.56      jmc      2343: .Op Ic 12 | 24
1.1       nicm     2344: .Xc
                   2345: Set clock hour format.
1.56      jmc      2346: .Pp
1.1       nicm     2347: .It Ic force-height Ar height
                   2348: .It Ic force-width Ar width
                   2349: Prevent
                   2350: .Nm
                   2351: from resizing a window to greater than
                   2352: .Ar width
                   2353: or
                   2354: .Ar height .
                   2355: A value of zero restores the default unlimited setting.
1.56      jmc      2356: .Pp
1.196     nicm     2357: .It Ic main-pane-height Ar height
1.2       nicm     2358: .It Ic main-pane-width Ar width
                   2359: Set the width or height of the main (left or top) pane in the
                   2360: .Ic main-horizontal
                   2361: or
                   2362: .Ic main-vertical
                   2363: layouts.
1.56      jmc      2364: .Pp
1.1       nicm     2365: .It Ic mode-attr Ar attributes
                   2366: Set window modes attributes.
1.56      jmc      2367: .Pp
1.1       nicm     2368: .It Ic mode-bg Ar colour
                   2369: Set window modes background colour.
1.56      jmc      2370: .Pp
1.1       nicm     2371: .It Ic mode-fg Ar colour
                   2372: Set window modes foreground colour.
1.56      jmc      2373: .Pp
1.1       nicm     2374: .It Xo Ic mode-keys
1.56      jmc      2375: .Op Ic vi | emacs
1.1       nicm     2376: .Xc
1.105     nicm     2377: Use vi or emacs-style key bindings in copy and choice modes.
1.191     nicm     2378: As with the
                   2379: .Ic status-keys
                   2380: option, the default is emacs, unless
                   2381: .Ev VISUAL
                   2382: or
                   2383: .Ev EDITOR
                   2384: contains
                   2385: .Ql vi .
1.56      jmc      2386: .Pp
1.50      nicm     2387: .It Xo Ic mode-mouse
1.240     nicm     2388: .Op Ic on | off | copy-mode
1.50      nicm     2389: .Xc
1.51      jmc      2390: Mouse state in modes.
1.223     nicm     2391: If on, the mouse may be used to enter copy mode and copy a selection by
                   2392: dragging, to enter copy mode and scroll with the mouse wheel, or to select an
                   2393: option in choice mode.
1.240     nicm     2394: If set to
1.241     jmc      2395: .Em copy-mode ,
1.240     nicm     2396: the mouse behaves as set to on, but cannot be used to enter copy
                   2397: mode.
1.56      jmc      2398: .Pp
1.1       nicm     2399: .It Xo Ic monitor-activity
1.56      jmc      2400: .Op Ic on | off
1.1       nicm     2401: .Xc
                   2402: Monitor for activity in the window.
                   2403: Windows with activity are highlighted in the status line.
1.56      jmc      2404: .Pp
                   2405: .It Ic monitor-content Ar match-string
1.6       jmc      2406: Monitor content in the window.
                   2407: When
1.16      nicm     2408: .Xr fnmatch 3
                   2409: pattern
1.1       nicm     2410: .Ar match-string
                   2411: appears in the window, it is highlighted in the status line.
1.56      jmc      2412: .Pp
1.192     nicm     2413: .It Xo Ic monitor-silence
                   2414: .Op Ic interval
                   2415: .Xc
                   2416: Monitor for silence (no activity) in the window within
                   2417: .Ic interval
                   2418: seconds.
                   2419: Windows that have been silent for the interval are highlighted in the
                   2420: status line.
                   2421: An interval of zero disables the monitoring.
1.195     nicm     2422: .Pp
                   2423: .It Ic other-pane-height Ar height
                   2424: Set the height of the other panes (not the main pane) in the
                   2425: .Ic main-horizontal
                   2426: layout.
                   2427: If this option is set to 0 (the default), it will have no effect.
                   2428: If both the
                   2429: .Ic main-pane-height
                   2430: and
                   2431: .Ic other-pane-height
                   2432: options are set, the main pane will grow taller to make the other panes the
                   2433: specified height, but will never shrink to do so.
                   2434: .Pp
                   2435: .It Ic other-pane-width Ar width
                   2436: Like
                   2437: .Ic other-pane-height ,
                   2438: but set the width of other panes in the
                   2439: .Ic main-vertical
                   2440: layout.
1.243     nicm     2441: .Pp
                   2442: .It Ic pane-base-index Ar index
                   2443: Like
                   2444: .Ic base-index ,
                   2445: but set the starting index for pane numbers.
1.192     nicm     2446: .Pp
1.1       nicm     2447: .It Xo Ic remain-on-exit
1.56      jmc      2448: .Op Ic on | off
1.1       nicm     2449: .Xc
                   2450: A window with this flag set is not destroyed when the program running in it
                   2451: exits.
                   2452: The window may be reactivated with the
                   2453: .Ic respawn-window
                   2454: command.
1.56      jmc      2455: .Pp
1.99      nicm     2456: .It Xo Ic synchronize-panes
                   2457: .Op Ic on | off
                   2458: .Xc
1.164     nicm     2459: Duplicate input to any pane to all other panes in the same window (only
                   2460: for panes that are not in any special mode).
1.139     nicm     2461: .Pp
1.1       nicm     2462: .It Xo Ic utf8
1.56      jmc      2463: .Op Ic on | off
1.1       nicm     2464: .Xc
                   2465: Instructs
                   2466: .Nm
                   2467: to expect UTF-8 sequences to appear in this window.
1.56      jmc      2468: .Pp
1.169     nicm     2469: .It Ic window-status-alert-attr Ar attributes
                   2470: Set status line attributes for windows which have an alert (bell, activity
                   2471: or content).
                   2472: .Pp
                   2473: .It Ic window-status-alert-bg Ar colour
                   2474: Set status line background colour for windows with an alert.
                   2475: .Pp
                   2476: .It Ic window-status-alert-fg Ar colour
                   2477: Set status line foreground colour for windows with an alert.
1.125     nicm     2478: .Pp
1.239     nicm     2479: .It Ic window-status-attr Ar attributes
                   2480: Set status line attributes for a single window.
                   2481: .Pp
                   2482: .It Ic window-status-bg Ar colour
                   2483: Set status line background colour for a single window.
                   2484: .Pp
1.40      nicm     2485: .It Ic window-status-current-attr Ar attributes
                   2486: Set status line attributes for the currently active window.
1.56      jmc      2487: .Pp
1.40      nicm     2488: .It Ic window-status-current-bg Ar colour
                   2489: Set status line background colour for the currently active window.
1.56      jmc      2490: .Pp
1.40      nicm     2491: .It Ic window-status-current-fg Ar colour
                   2492: Set status line foreground colour for the currently active window.
1.56      jmc      2493: .Pp
1.125     nicm     2494: .It Ic window-status-current-format Ar string
                   2495: Like
                   2496: .Ar window-status-format ,
                   2497: but is the format used when the window is the current window.
1.239     nicm     2498: .Pp
                   2499: .It Ic window-status-fg Ar colour
                   2500: Set status line foreground colour for a single window.
                   2501: .Pp
                   2502: .It Ic window-status-format Ar string
                   2503: Set the format in which the window is displayed in the status line window list.
                   2504: See the
                   2505: .Ar status-left
                   2506: option for details of special character sequences available.
                   2507: The default is
                   2508: .Ql #I:#W#F .
1.154     nicm     2509: .Pp
                   2510: .It Ic word-separators Ar string
                   2511: Sets the window's conception of what characters are considered word
                   2512: separators, for the purposes of the next and previous word commands in
                   2513: copy mode.
                   2514: The default is
                   2515: .Ql \ -_@ .
1.125     nicm     2516: .Pp
1.1       nicm     2517: .It Xo Ic xterm-keys
1.56      jmc      2518: .Op Ic on | off
1.1       nicm     2519: .Xc
                   2520: If this option is set,
                   2521: .Nm
                   2522: will generate
1.57      jmc      2523: .Xr xterm 1 -style
                   2524: function key sequences; these have a number included to indicate modifiers such
                   2525: as Shift, Alt or Ctrl.
1.123     nicm     2526: The default is off.
1.57      jmc      2527: .El
                   2528: .It Xo Ic show-options
1.133     nicm     2529: .Op Fl gsw
1.129     nicm     2530: .Op Fl t Ar target-session | Ar target-window
1.57      jmc      2531: .Xc
                   2532: .D1 (alias: Ic show )
1.133     nicm     2533: Show the window options with
1.129     nicm     2534: .Fl w
1.133     nicm     2535: (equivalent to
1.134     nicm     2536: .Ic show-window-options ) ,
1.133     nicm     2537: the server options with
                   2538: .Fl s ,
                   2539: otherwise the session options for
                   2540: .Ar target session .
                   2541: Global session or window options are listed if
                   2542: .Fl g
                   2543: is used.
1.57      jmc      2544: .It Xo Ic show-window-options
                   2545: .Op Fl g
                   2546: .Op Fl t Ar target-window
                   2547: .Xc
                   2548: .D1 (alias: Ic showw )
                   2549: List the window options for
                   2550: .Ar target-window ,
                   2551: or the global window options if
                   2552: .Fl g
                   2553: is used.
1.63      nicm     2554: .El
1.245     nicm     2555: .Sh FORMATS
                   2556: The
                   2557: .Ic list-sessions ,
                   2558: .Ic list-windows
                   2559: and
                   2560: .Ic list-panes
                   2561: commands accept the
                   2562: .Fl F
                   2563: flag with a
                   2564: .Ar format
                   2565: argument.
                   2566: This is a string which controls the output format of the command.
                   2567: Special character sequences are replaced as documented under the
                   2568: .Ic status-left
                   2569: option and an additional long form is accepted.
                   2570: Replacement variables are enclosed in
                   2571: .Ql #{
                   2572: and
                   2573: .Ql } ,
                   2574: for example
                   2575: .Ql #{session_name}
                   2576: is equivalent to
                   2577: .Ql #S .
                   2578: Conditionals are also accepted by prefixing with
1.246     jmc      2579: .Ql \&?
1.245     nicm     2580: and separating two alternatives with a comma;
                   2581: if the specified variable exists and is not zero, the first alternative
1.246     jmc      2582: is chosen, otherwise the second is used.
                   2583: For example
1.245     nicm     2584: .Ql #{?session_attached,attached,not attached}
                   2585: will include the string
                   2586: .Ql attached
                   2587: if the session is attached and the string
                   2588: .Ql not attached
                   2589: if it is unattached.
                   2590: .Pp
                   2591: The following variables are available, where appropriate:
                   2592: .Bl -column "session_created_string" "Replaced with" -offset indent
                   2593: .It Sy "Variable name" Ta Sy "Replaced with"
                   2594: .It Li "host" Ta "Hostname of local host"
                   2595: .It Li "line" Ta "Line number in the list"
                   2596: .It Li "pane_active" Ta "1 if active pane"
                   2597: .It Li "pane_dead" Ta "1 if pane is dead"
                   2598: .It Li "pane_height" Ta "Height of pane"
                   2599: .It Li "pane_id" Ta "Unique pane id"
                   2600: .It Li "pane_title" Ta "Title of pane"
                   2601: .It Li "pane_width" Ta "Width of pane"
                   2602: .It Li "session_attached" Ta "1 if session attached"
                   2603: .It Li "session_created" Ta "Integer time session created"
                   2604: .It Li "session_created_string" Ta "String time session created"
                   2605: .It Li "session_group" Ta "Number of session group"
                   2606: .It Li "session_grouped" Ta "1 if session in a group"
                   2607: .It Li "session_height" Ta "Height of session"
                   2608: .It Li "session_name" Ta "Name of session"
                   2609: .It Li "session_width" Ta "Width of session"
                   2610: .It Li "session_windows" Ta "Number of windows in session"
                   2611: .It Li "window_active" Ta "1 if window active"
                   2612: .It Li "window_flags" Ta "Window flags"
                   2613: .It Li "window_height" Ta "Height of window"
                   2614: .It Li "window_index" Ta "Index of window"
                   2615: .It Li "window_layout" Ta "Window layout description"
                   2616: .It Li "window_name" Ta "Name of window"
                   2617: .It Li "window_width" Ta "Width of window"
                   2618: .El
1.63      nicm     2619: .Sh ENVIRONMENT
                   2620: When the server is started,
                   2621: .Nm
                   2622: copies the environment into the
                   2623: .Em global environment ;
                   2624: in addition, each session has a
                   2625: .Em session environment .
1.193     nicm     2626: When a window is created, the session and global environments are merged.
                   2627: If a variable exists in both, the value from the session environment is used.
                   2628: The result is the initial environment passed to the new process.
1.63      nicm     2629: .Pp
                   2630: The
                   2631: .Ic update-environment
                   2632: session option may be used to update the session environment from the client
                   2633: when a new session is created or an old reattached.
                   2634: .Nm
                   2635: also initialises the
                   2636: .Ev TMUX
                   2637: variable with some internal information to allow commands to be executed
                   2638: from inside, and the
                   2639: .Ev TERM
                   2640: variable with the correct terminal setting of
                   2641: .Ql screen .
                   2642: .Pp
                   2643: Commands to alter and view the environment are:
                   2644: .Bl -tag -width Ds
                   2645: .It Xo Ic set-environment
                   2646: .Op Fl gru
                   2647: .Op Fl t Ar target-session
                   2648: .Ar name Op Ar value
                   2649: .Xc
1.115     nicm     2650: .D1 (alias: Ic setenv )
1.63      nicm     2651: Set or unset an environment variable.
                   2652: If
                   2653: .Fl g
                   2654: is used, the change is made in the global environment; otherwise, it is applied
                   2655: to the session environment for
                   2656: .Ar target-session .
                   2657: The
                   2658: .Fl u
                   2659: flag unsets a variable.
                   2660: .Fl r
                   2661: indicates the variable is to be removed from the environment before starting a
                   2662: new process.
                   2663: .It Xo Ic show-environment
                   2664: .Op Fl g
                   2665: .Op Fl t Ar target-session
                   2666: .Xc
1.115     nicm     2667: .D1 (alias: Ic showenv )
1.63      nicm     2668: Display the environment for
                   2669: .Ar target-session
                   2670: or the global environment with
                   2671: .Fl g .
                   2672: Variables removed from the environment are prefixed with
                   2673: .Ql - .
1.57      jmc      2674: .El
                   2675: .Sh STATUS LINE
                   2676: .Nm
                   2677: includes an optional status line which is displayed in the bottom line of each
                   2678: terminal.
                   2679: By default, the status line is enabled (it may be disabled with the
                   2680: .Ic status
                   2681: session option) and contains, from left-to-right: the name of the current
                   2682: session in square brackets; the window list; the current window title in double
                   2683: quotes; and the time and date.
                   2684: .Pp
                   2685: The status line is made of three parts: configurable left and right sections
                   2686: (which may contain dynamic content such as the time or output from a shell
                   2687: command, see the
                   2688: .Ic status-left ,
                   2689: .Ic status-left-length ,
                   2690: .Ic status-right ,
                   2691: and
                   2692: .Ic status-right-length
                   2693: options below), and a central window list.
1.125     nicm     2694: By default, the window list shows the index, name and (if any) flag of the
                   2695: windows present in the current session in ascending numerical order.
                   2696: It may be customised with the
                   2697: .Ar window-status-format
                   2698: and
                   2699: .Ar window-status-current-format
                   2700: options.
1.57      jmc      2701: The flag is one of the following symbols appended to the window name:
                   2702: .Bl -column "Symbol" "Meaning" -offset indent
                   2703: .It Sy "Symbol" Ta Sy "Meaning"
                   2704: .It Li "*" Ta "Denotes the current window."
                   2705: .It Li "-" Ta "Marks the last window (previously selected)."
                   2706: .It Li "#" Ta "Window is monitored and activity has been detected."
                   2707: .It Li "!" Ta "A bell has occurred in the window."
                   2708: .It Li "+" Ta "Window is monitored for content and it has appeared."
1.192     nicm     2709: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.57      jmc      2710: .El
                   2711: .Pp
                   2712: The # symbol relates to the
                   2713: .Ic monitor-activity
                   2714: and + to the
                   2715: .Ic monitor-content
                   2716: window options.
                   2717: The window name is printed in inverted colours if an alert (bell, activity or
                   2718: content) is present.
                   2719: .Pp
1.131     nicm     2720: The colour and attributes of the status line may be configured, the entire
                   2721: status line using the
1.57      jmc      2722: .Ic status-attr ,
                   2723: .Ic status-fg
                   2724: and
                   2725: .Ic status-bg
                   2726: session options and individual windows using the
                   2727: .Ic window-status-attr ,
                   2728: .Ic window-status-fg
                   2729: and
                   2730: .Ic window-status-bg
                   2731: window options.
                   2732: .Pp
1.131     nicm     2733: The status line is automatically refreshed at interval if it has changed, the
                   2734: interval may be controlled with the
1.57      jmc      2735: .Ic status-interval
                   2736: session option.
                   2737: .Pp
                   2738: Commands related to the status line are as follows:
                   2739: .Bl -tag -width Ds
                   2740: .It Xo Ic command-prompt
1.235     nicm     2741: .Op Fl I Ar inputs
1.73      nicm     2742: .Op Fl p Ar prompts
1.57      jmc      2743: .Op Fl t Ar target-client
                   2744: .Op Ar template
                   2745: .Xc
                   2746: Open the command prompt in a client.
                   2747: This may be used from inside
                   2748: .Nm
                   2749: to execute commands interactively.
1.231     nicm     2750: .Pp
1.57      jmc      2751: If
                   2752: .Ar template
1.73      nicm     2753: is specified, it is used as the command.
1.235     nicm     2754: If present,
                   2755: .Fl I
                   2756: is a comma-separated list of the initial text for each prompt.
1.73      nicm     2757: If
                   2758: .Fl p
                   2759: is given,
                   2760: .Ar prompts
                   2761: is a comma-separated list of prompts which are displayed in order; otherwise
                   2762: a single prompt is displayed, constructed from
                   2763: .Ar template
                   2764: if it is present, or
                   2765: .Ql \&:
                   2766: if not.
1.235     nicm     2767: .Pp
                   2768: Both
                   2769: .Ar inputs
                   2770: and
1.231     nicm     2771: .Ar prompts
                   2772: may contain the special character sequences supported by the
                   2773: .Ic status-left
                   2774: option.
                   2775: .Pp
1.73      nicm     2776: Before the command is executed, the first occurrence of the string
                   2777: .Ql %%
1.74      jmc      2778: and all occurrences of
1.73      nicm     2779: .Ql %1
                   2780: are replaced by the response to the first prompt, the second
                   2781: .Ql %%
                   2782: and all
                   2783: .Ql %2
                   2784: are replaced with the response to the second prompt, and so on for further
1.74      jmc      2785: prompts.
                   2786: Up to nine prompt responses may be replaced
                   2787: .Po
                   2788: .Ql %1
1.73      nicm     2789: to
1.74      jmc      2790: .Ql %9
                   2791: .Pc .
1.57      jmc      2792: .It Xo Ic confirm-before
1.238     nicm     2793: .Op Fl p Ar prompt
1.57      jmc      2794: .Op Fl t Ar target-client
                   2795: .Ar command
                   2796: .Xc
                   2797: .D1 (alias: Ic confirm )
                   2798: Ask for confirmation before executing
                   2799: .Ar command .
1.238     nicm     2800: If
                   2801: .Fl p
                   2802: is given,
                   2803: .Ar prompt
                   2804: is the prompt to display; otherwise a prompt is constructed from
                   2805: .Ar command .
                   2806: It may contain the special character sequences supported by the
                   2807: .Ic status-left
                   2808: option.
                   2809: .Pp
1.57      jmc      2810: This command works only from inside
                   2811: .Nm .
                   2812: .It Xo Ic display-message
1.127     nicm     2813: .Op Fl p
1.215     nicm     2814: .Op Fl c Ar target-client
                   2815: .Op Fl t Ar target-pane
1.57      jmc      2816: .Op Ar message
                   2817: .Xc
                   2818: .D1 (alias: Ic display )
1.127     nicm     2819: Display a message.
                   2820: If
                   2821: .Fl p
                   2822: is given, the output is printed to stdout, otherwise it is displayed in the
                   2823: .Ar target-client
                   2824: status line.
1.122     nicm     2825: The format of
1.124     jmc      2826: .Ar message
                   2827: is as for
1.122     nicm     2828: .Ic status-left ,
1.215     nicm     2829: with the exception that #() are not handled; information is taken from
                   2830: .Ar target-pane
                   2831: if
                   2832: .Fl t
                   2833: is given, otherwise the active pane for the session attached to
                   2834: .Ar target-client .
1.57      jmc      2835: .El
                   2836: .Sh BUFFERS
                   2837: .Nm
                   2838: maintains a stack of
1.199     nicm     2839: .Em paste buffers .
1.57      jmc      2840: Up to the value of the
                   2841: .Ic buffer-limit
                   2842: option are kept; when a new buffer is added, the buffer at the bottom of the
                   2843: stack is removed.
                   2844: Buffers may be added using
                   2845: .Ic copy-mode
                   2846: or the
                   2847: .Ic set-buffer
                   2848: command, and pasted into a window using the
                   2849: .Ic paste-buffer
                   2850: command.
                   2851: .Pp
                   2852: A configurable history buffer is also maintained for each window.
                   2853: By default, up to 2000 lines are kept; this can be altered with the
                   2854: .Ic history-limit
                   2855: option (see the
                   2856: .Ic set-option
                   2857: command above).
                   2858: .Pp
                   2859: The buffer commands are as follows:
                   2860: .Bl -tag -width Ds
1.178     nicm     2861: .It Xo
                   2862: .Ic choose-buffer
                   2863: .Op Fl t Ar target-window
                   2864: .Op Ar template
                   2865: .Xc
                   2866: Put a window into buffer choice mode, where a buffer may be chosen
                   2867: interactively from a list.
                   2868: After a buffer is selected,
                   2869: .Ql %%
                   2870: is replaced by the buffer index in
                   2871: .Ar template
                   2872: and the result executed as a command.
                   2873: If
                   2874: .Ar template
                   2875: is not given, "paste-buffer -b '%%'" is used.
                   2876: This command works only from inside
                   2877: .Nm .
1.57      jmc      2878: .It Ic clear-history Op Fl t Ar target-pane
                   2879: .D1 (alias: Ic clearhist )
                   2880: Remove and free the history for the specified pane.
1.198     nicm     2881: .It Ic delete-buffer Op Fl b Ar buffer-index
1.57      jmc      2882: .D1 (alias: Ic deleteb )
                   2883: Delete the buffer at
                   2884: .Ar buffer-index ,
                   2885: or the top buffer if not specified.
1.198     nicm     2886: .It Ic list-buffers
1.57      jmc      2887: .D1 (alias: Ic lsb )
1.198     nicm     2888: List the global buffers.
1.200     jmc      2889: .It Xo Ic load-buffer
1.57      jmc      2890: .Op Fl b Ar buffer-index
                   2891: .Ar path
                   2892: .Xc
                   2893: .D1 (alias: Ic loadb )
                   2894: Load the contents of the specified paste buffer from
                   2895: .Ar path .
                   2896: .It Xo Ic paste-buffer
                   2897: .Op Fl dr
                   2898: .Op Fl b Ar buffer-index
1.170     nicm     2899: .Op Fl s Ar separator
1.158     nicm     2900: .Op Fl t Ar target-pane
1.57      jmc      2901: .Xc
                   2902: .D1 (alias: Ic pasteb )
1.158     nicm     2903: Insert the contents of a paste buffer into the specified pane.
                   2904: If not specified, paste into the current one.
1.57      jmc      2905: With
                   2906: .Fl d ,
                   2907: also delete the paste buffer from the stack.
                   2908: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170     nicm     2909: a separator, by default carriage return (CR).
                   2910: A custom separator may be specified using the
                   2911: .Fl s
                   2912: flag.
                   2913: The
1.57      jmc      2914: .Fl r
1.170     nicm     2915: flag means to do no replacement (equivalent to a separator of LF).
1.57      jmc      2916: .It Xo Ic save-buffer
                   2917: .Op Fl a
                   2918: .Op Fl b Ar buffer-index
                   2919: .Ar path
                   2920: .Xc
                   2921: .D1 (alias: Ic saveb )
                   2922: Save the contents of the specified paste buffer to
                   2923: .Ar path .
                   2924: The
                   2925: .Fl a
                   2926: option appends to rather than overwriting the file.
                   2927: .It Xo Ic set-buffer
                   2928: .Op Fl b Ar buffer-index
                   2929: .Ar data
                   2930: .Xc
                   2931: .D1 (alias: Ic setb )
                   2932: Set the contents of the specified buffer to
                   2933: .Ar data .
1.1       nicm     2934: .It Xo Ic show-buffer
                   2935: .Op Fl b Ar buffer-index
                   2936: .Xc
                   2937: .D1 (alias: Ic showb )
                   2938: Display the contents of the specified buffer.
1.57      jmc      2939: .El
                   2940: .Sh MISCELLANEOUS
                   2941: Miscellaneous commands are as follows:
                   2942: .Bl -tag -width Ds
1.72      nicm     2943: .It Ic clock-mode Op Fl t Ar target-pane
1.57      jmc      2944: Display a large clock.
                   2945: .It Ic if-shell Ar shell-command command
                   2946: .D1 (alias: Ic if )
                   2947: Execute
                   2948: .Ar command
                   2949: if
                   2950: .Ar shell-command
                   2951: returns success.
                   2952: .It Ic lock-server
                   2953: .D1 (alias: Ic lock )
1.90      nicm     2954: Lock each client individually by running the command specified by the
                   2955: .Ic lock-command
                   2956: option.
1.153     nicm     2957: .It Ic run-shell Ar shell-command
1.87      nicm     2958: .D1 (alias: Ic run )
                   2959: Execute
1.153     nicm     2960: .Ar shell-command
1.106     nicm     2961: in the background without creating a window.
1.164     nicm     2962: After it finishes, any output to stdout is displayed in copy mode.
1.153     nicm     2963: If the command doesn't return success, the exit status is also displayed.
1.57      jmc      2964: .It Ic server-info
                   2965: .D1 (alias: Ic info )
                   2966: Show server information and terminal details.
1.228     nicm     2967: .El
                   2968: .Sh TERMINFO EXTENSIONS
                   2969: .Nm
                   2970: understands some extensions to
                   2971: .Xr terminfo 5 :
                   2972: .Bl -tag -width Ds
1.232     jmc      2973: .It Em Cc , Cr
1.233     nicm     2974: Set the cursor colour.
1.232     jmc      2975: The first takes a single string argument and is used to set the colour;
                   2976: the second takes no arguments and restores the default cursor colour.
                   2977: If set, a sequence such as this may be used
                   2978: to change the cursor colour from inside
                   2979: .Nm :
                   2980: .Bd -literal -offset indent
                   2981: $ printf '\e033]12;red\e033\e\e'
                   2982: .Ed
                   2983: .It Em Cs , Csr
1.230     nicm     2984: Change the cursor style.
1.232     jmc      2985: If set, a sequence such as this may be used
                   2986: to change the cursor to an underline:
1.230     nicm     2987: .Bd -literal -offset indent
                   2988: $ printf '\e033[4 q'
                   2989: .Ed
                   2990: .Pp
                   2991: If
                   2992: .Em Csr
                   2993: is set, it will be used to reset the cursor style instead
                   2994: of
                   2995: .Em Cs .
1.232     jmc      2996: .It Em \&Ms
                   2997: This sequence can be used by
                   2998: .Nm
                   2999: to store the current buffer in the host terminal's selection (clipboard).
                   3000: See the
                   3001: .Em set-clipboard
                   3002: option above and the
                   3003: .Xr xterm 1
                   3004: man page.
1.1       nicm     3005: .El
                   3006: .Sh FILES
1.26      nicm     3007: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1       nicm     3008: .It Pa ~/.tmux.conf
1.6       jmc      3009: Default
1.1       nicm     3010: .Nm
1.6       jmc      3011: configuration file.
1.26      nicm     3012: .It Pa /etc/tmux.conf
                   3013: System-wide configuration file.
1.1       nicm     3014: .El
1.57      jmc      3015: .Sh EXAMPLES
                   3016: To create a new
                   3017: .Nm
                   3018: session running
                   3019: .Xr vi 1 :
                   3020: .Pp
                   3021: .Dl $ tmux new-session vi
                   3022: .Pp
                   3023: Most commands have a shorter form, known as an alias.
                   3024: For new-session, this is
                   3025: .Ic new :
                   3026: .Pp
                   3027: .Dl $ tmux new vi
                   3028: .Pp
                   3029: Alternatively, the shortest unambiguous form of a command is accepted.
                   3030: If there are several options, they are listed:
                   3031: .Bd -literal -offset indent
                   3032: $ tmux n
                   3033: ambiguous command: n, could be: new-session, new-window, next-window
                   3034: .Ed
                   3035: .Pp
                   3036: Within an active session, a new window may be created by typing
                   3037: .Ql C-b c
                   3038: (Ctrl
                   3039: followed by the
                   3040: .Ql b
                   3041: key
                   3042: followed by the
                   3043: .Ql c
                   3044: key).
                   3045: .Pp
                   3046: Windows may be navigated with:
                   3047: .Ql C-b 0
                   3048: (to select window 0),
                   3049: .Ql C-b 1
                   3050: (to select window 1), and so on;
                   3051: .Ql C-b n
                   3052: to select the next window; and
                   3053: .Ql C-b p
                   3054: to select the previous window.
                   3055: .Pp
                   3056: A session may be detached using
                   3057: .Ql C-b d
1.64      nicm     3058: (or by an external event such as
                   3059: .Xr ssh 1
                   3060: disconnection) and reattached with:
1.57      jmc      3061: .Pp
                   3062: .Dl $ tmux attach-session
                   3063: .Pp
                   3064: Typing
                   3065: .Ql C-b \&?
                   3066: lists the current key bindings in the current window; up and down may be used
                   3067: to navigate the list or
                   3068: .Ql q
                   3069: to exit from it.
                   3070: .Pp
                   3071: Commands to be run when the
                   3072: .Nm
                   3073: server is started may be placed in the
                   3074: .Pa ~/.tmux.conf
                   3075: configuration file.
                   3076: Common examples include:
                   3077: .Pp
                   3078: Changing the default prefix key:
                   3079: .Bd -literal -offset indent
                   3080: set-option -g prefix C-a
                   3081: unbind-key C-b
                   3082: bind-key C-a send-prefix
                   3083: .Ed
                   3084: .Pp
                   3085: Turning the status line off, or changing its colour:
                   3086: .Bd -literal -offset indent
                   3087: set-option -g status off
                   3088: set-option -g status-bg blue
                   3089: .Ed
                   3090: .Pp
                   3091: Setting other options, such as the default command,
                   3092: or locking after 30 minutes of inactivity:
                   3093: .Bd -literal -offset indent
                   3094: set-option -g default-command "exec /bin/ksh"
                   3095: set-option -g lock-after-time 1800
                   3096: .Ed
                   3097: .Pp
                   3098: Creating new key bindings:
                   3099: .Bd -literal -offset indent
                   3100: bind-key b set-option status
                   3101: bind-key / command-prompt "split-window 'exec man %%'"
1.73      nicm     3102: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57      jmc      3103: .Ed
1.1       nicm     3104: .Sh SEE ALSO
                   3105: .Xr pty 4
                   3106: .Sh AUTHORS
                   3107: .An Nicholas Marriott Aq nicm@users.sourceforge.net