Annotation of src/usr.bin/tmux/tmux.1, Revision 1.57
1.57 ! jmc 1: .\" $OpenBSD: tmux.1,v 1.56 2009/08/04 07:56:38 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.57 ! jmc 17: .Dd $Mdocdate: August 4 2009 $
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
26: .Op Fl 28dqUuv
27: .Op Fl f Ar file
28: .Op Fl L Ar socket-name
29: .Op Fl S Ar socket-path
30: .Op Ar command Op Ar flags
31: .Ek
32: .Sh DESCRIPTION
33: .Nm
1.6 jmc 34: is a terminal multiplexer: it enables a number of terminals to be accessed and
1.1 nicm 35: controlled from a single terminal.
36: .Pp
37: The options are as follows:
38: .Bl -tag -width "XXXXXXXXXXXX"
39: .It Fl 2
40: Force
41: .Nm
42: to assume the terminal supports 256 colours.
43: .It Fl 8
44: Like
45: .Fl 2 ,
1.6 jmc 46: but indicates that the terminal supports 88 colours.
1.1 nicm 47: .It Fl d
48: Force
49: .Nm
50: to assume the terminal supports default colours.
51: .It Fl f Ar file
52: Specify an alternative configuration file.
53: By default,
54: .Nm
1.26 nicm 55: loads the system configuration file from
56: .Pa /etc/tmux.conf ,
57: if present, then looks for a user configuration file at
1.1 nicm 58: .Pa ~/.tmux.conf .
59: The configuration file is a set of
60: .Nm
61: commands which are executed in sequence when the server is first started.
62: .It Fl L Ar socket-name
63: .Nm
64: stores the server socket in a directory under
65: .Pa /tmp ;
66: the default socket is named
67: .Em default .
68: This option allows a different socket name to be specified, allowing several
69: independent
70: .Nm
71: servers to be run.
72: Unlike
73: .Fl S
74: a full path is not necessary: the sockets are all created in the same
75: directory.
1.2 nicm 76: .Pp
77: If the socket is accidentally removed, the
1.6 jmc 78: .Dv SIGUSR1
1.2 nicm 79: signal may be sent to the
80: .Nm
81: server process to recreate it.
1.4 sobrado 82: .It Fl q
1.6 jmc 83: Prevent the server sending various informational messages, for example when
1.4 sobrado 84: window flags are altered.
1.1 nicm 85: .It Fl S Ar socket-path
86: Specify a full alternative path to the server socket.
87: If
88: .Fl S
89: is specified, the default socket directory is not used and any
90: .Fl L
91: flag is ignored.
92: .It Fl U
93: Unlock the server.
94: .It Fl u
95: .Nm
1.14 nicm 96: attempts to guess if the terminal is likely to support UTF-8 by checking the
97: first of the
98: .Ev LC_ALL ,
99: .Ev LC_CTYPE
100: and
1.2 nicm 101: .Ev LANG
1.14 nicm 102: environment variables to be set for the string "UTF-8".
1.5 nicm 103: This is not always correct: the
1.2 nicm 104: .Fl u
105: flag explicitly informs
106: .Nm
1.6 jmc 107: that UTF-8 is supported.
1.33 nicm 108: .Pp
109: If the server is started from a client passed
110: .Fl u
111: or where UTF-8 is detected, the
112: .Ic utf8
113: and
114: .Ic status-utf8
115: options are enabled in the global window and session options respectively.
1.1 nicm 116: .It Fl v
117: Request verbose logging.
118: This option may be specified multiple times for increasing verbosity.
119: Log messages will be saved into
120: .Pa tmux-client-PID.log
121: and
122: .Pa tmux-server-PID.log
123: files in the current directory, where
124: .Em PID
1.6 jmc 125: is the PID of the server or client process.
1.1 nicm 126: .It Ar command Op Ar flags
127: This specifies one of a set of commands used to control
128: .Nm ,
1.6 jmc 129: as described in the following sections.
130: If no command and flags are specified, the
1.1 nicm 131: .Ic new-session
132: command is assumed.
133: .El
1.57 ! jmc 134: .Sh INTRODUCTION
1.6 jmc 135: .Nm
1.57 ! jmc 136: runs as a server-client system.
! 137: A server holds a number of
! 138: .Em sessions ,
! 139: each of which may have a number of
! 140: .Em windows
! 141: linked to it.
! 142: A server is started automatically when the first session is created and exits
! 143: when all the sessions it contains are destroyed.
! 144: A window may be split on screen into one or more
! 145: .Em panes ,
! 146: each of which is a separate terminal.
! 147: Any number of
! 148: .Em clients
! 149: may connect to a session, or the server
! 150: may be controlled by issuing commands with
! 151: .Nm .
! 152: Communication takes place through a socket, by default placed in
! 153: .Pa /tmp .
1.1 nicm 154: .Pp
1.57 ! jmc 155: This is an overview of the sections in this manual page:
! 156: .Bl -ohang
! 157: .It Sy Commands
! 158: An overview of how
! 159: .Nm
! 160: commands work.
! 161: .It Sy Clients and sessions
! 162: Commands for managing clients and sessions.
! 163: .It Sy Windows and panes
! 164: Commands for managing windows and panes.
! 165: .It Sy Key bindings
! 166: How key bindings work.
! 167: .It Sy Options
! 168: Configuration options for
! 169: .Nm .
! 170: .It Sy Status line
! 171: Commands pertinent to the status line.
! 172: .It Sy Buffers
! 173: Copy and paste operations.
! 174: .It Sy Miscellaneous
! 175: Miscellaneous commands.
! 176: .It Sy Examples
! 177: A quick start guide.
! 178: .El
! 179: .Sh COMMANDS
! 180: This section contains a list of the commands supported by
! 181: .Nm .
! 182: Most commands accept the optional
! 183: .Fl t
! 184: argument with one of
! 185: .Ar target-client ,
! 186: .Ar target-session
! 187: .Ar target-window ,
! 188: or
! 189: .Ar target-pane .
! 190: These specify the client, session, window or pane which a command should affect.
! 191: .Ar target-client
! 192: is the name of the
! 193: .Xr pty 4
! 194: file to which the client is connected, for example either of
! 195: .Pa /dev/ttyp1
! 196: or
! 197: .Pa ttyp1
! 198: for the client attached to
! 199: .Pa /dev/ttyp1 .
! 200: If no client is specified, the current client is chosen, if possible, or an
! 201: error is reported.
! 202: Clients may be listed with the
! 203: .Ic list-clients
! 204: command.
1.1 nicm 205: .Pp
1.57 ! jmc 206: .Ar target-session
! 207: is either the name of a session (as listed by the
! 208: .Ic list-sessions
! 209: command) or the name of a client with the same syntax as
! 210: .Ar target-client ,
! 211: in which case the session attached to the client is used.
! 212: When looking for the session name,
! 213: .Nm
! 214: initially searches for an exact match; if none is found, the session names
! 215: are checked for any for which
! 216: .Ar target-session
! 217: is a prefix or for which it matches as an
! 218: .Xr fnmatch 3
! 219: pattern.
! 220: If a single match is found, it is used as the target session; multiple matches
! 221: produce an error.
! 222: If a session is omitted, the current session is used if available; if no
! 223: current session is available, the most recently created is chosen.
1.1 nicm 224: .Pp
1.57 ! jmc 225: .Ar target-window
! 226: specifies a window in the form
! 227: .Em session Ns \&: Ns Em window .
! 228: .Em session
! 229: follows the same rules as for
! 230: .Ar target-session ,
! 231: and
! 232: .Em window
! 233: is looked for in order: as a window index, for example mysession:1; as an exact
! 234: window name, such as mysession:mywindow; then as an
! 235: .Xr fnmatch 3
! 236: pattern or the start of a window name, such as mysession:mywin* or
! 237: mysession:mywin.
! 238: An empty window name specifies the next unused index if appropriate (for
! 239: example the
! 240: .Ic new-window
! 241: and
! 242: .Ic link-window
! 243: commands)
! 244: otherwise the current window in
! 245: .Em session
! 246: is chosen.
! 247: When the argument does not contain a colon,
! 248: .Nm
! 249: first attempts to parse it as window; if that fails, an attempt is made to
! 250: match a session.
1.1 nicm 251: .Pp
1.57 ! jmc 252: .Ar target-pane
! 253: takes a similar form to
! 254: .Ar target-window
! 255: but with the optional addition of a period followed by a pane index, for
! 256: example: mysession:mywindow.1.
! 257: If the pane index is omitted, the currently active pane in the specified
! 258: window is used.
! 259: If neither a colon nor period appears,
1.13 nicm 260: .Nm
1.57 ! jmc 261: first attempts to use the argument as a pane index; if that fails, it is looked
! 262: up as for
! 263: .Ar target-window .
1.15 jmc 264: .Pp
1.57 ! jmc 265: Multiple commands may be specified together as part of a
! 266: .Em command sequence .
! 267: Each command should be separated by spaces and a semicolon;
! 268: commands are executed sequentially from left to right.
! 269: A literal semicolon may be included by escaping it with a backslash (for
! 270: example, when specifying a command sequence to
! 271: .Ic bind-key ) .
1.13 nicm 272: .Pp
1.57 ! jmc 273: Examples include:
1.13 nicm 274: .Bd -literal -offset indent
1.57 ! jmc 275: refresh-client -t/dev/ttyp2
! 276:
! 277: rename-session -tfirst newname
! 278:
! 279: set-window-option -t:0 monitor-activity on
! 280:
! 281: new-window ; split-window -d
! 282:
! 283: bind-key D detach-client \e\; lock-server
1.13 nicm 284: .Ed
1.57 ! jmc 285: .Sh CLIENTS AND SESSIONS
! 286: The following commands are available:
! 287: .Bl -tag -width Ds
! 288: .It Xo Ic attach-session
! 289: .Op Fl d
! 290: .Op Fl t Ar target-session
! 291: .Xc
! 292: .D1 (alias: Ic attach )
! 293: If run from outside
! 294: .Nm ,
! 295: create a new client in the current terminal and attach it to
! 296: .Ar target-session .
! 297: If used from inside, switch the current client.
! 298: If
! 299: .Fl d
! 300: is specified, any other clients attached to the session are detached.
1.13 nicm 301: .Pp
1.57 ! jmc 302: If no server is started,
! 303: .Ic attach-session
! 304: will attempt to start it; this will fail unless sessions are created in the
! 305: configuration file.
! 306: .It Ic detach-client Op Fl t Ar target-client
! 307: .D1 (alias: Ic detach )
! 308: Detach the current client if bound to a key, or the specified client with
! 309: .Fl t .
! 310: .It Ic has-session Op Fl t Ar target-session
! 311: .D1 (alias: Ic has )
! 312: Report an error and exit with 1 if the specified session does not exist.
! 313: If it does exist, exit with 0.
! 314: .It Ic kill-server
! 315: Kill the
1.1 nicm 316: .Nm
1.57 ! jmc 317: server and clients and destroy all sessions.
! 318: .It Ic kill-session Op Fl t Ar target-session
! 319: Destroy the given session, closing any windows linked to it and no other
! 320: sessions, and detaching all clients attached to it.
! 321: .It Ic list-clients
! 322: .D1 (alias: Ic lsc )
! 323: List all clients attached to the server.
! 324: .It Ic list-commands
! 325: .D1 (alias: Ic lscm )
! 326: List the syntax of all commands supported by
! 327: .Nm .
! 328: .It Ic list-sessions
! 329: .D1 (alias: Ic ls )
! 330: List all sessions managed by the server.
! 331: .It Xo Ic new-session
! 332: .Op Fl d
! 333: .Op Fl n Ar window-name
! 334: .Op Fl s Ar session-name
! 335: .Op Ar command
! 336: .Xc
! 337: .D1 (alias: Ic new )
! 338: Create a new session with name
! 339: .Ar session-name .
! 340: The new session is attached to the current terminal unless
! 341: .Fl d
! 342: is given.
! 343: .Ar window-name
1.1 nicm 344: and
1.57 ! jmc 345: .Ar command
! 346: are the name of and command to execute in the initial window.
! 347: .It Ic refresh-client Op Fl t Ar target-client
! 348: .D1 (alias: Ic refresh )
! 349: Refresh the current client if bound to a key, or a single client if one is given
! 350: with
! 351: .Fl t .
! 352: .It Xo Ic rename-session
! 353: .Op Fl t Ar target-session
! 354: .Ar new-name
! 355: .Xc
! 356: .D1 (alias: Ic rename )
! 357: Rename the session to
! 358: .Ar new-name .
! 359: .It Ic source-file Ar path
! 360: .D1 (alias: Ic source )
! 361: Execute commands from
! 362: .Ar path .
! 363: .It Ic start-server
! 364: .D1 (alias: Ic start )
! 365: Start the
1.1 nicm 366: .Nm
1.57 ! jmc 367: server, if not already running, without creating any sessions.
! 368: .It Xo Ic suspend-client
! 369: .Op Fl c Ar target-client
! 370: .Xc
! 371: .D1 (alias: Ic suspendc )
! 372: Suspend a client by sending
! 373: .Dv SIGTSTP
! 374: (tty stop).
! 375: .It Xo Ic switch-client
! 376: .Op Fl c Ar target-client
! 377: .Op Fl t Ar target-session
! 378: .Xc
! 379: .D1 (alias: Ic switchc )
! 380: Switch the current session for client
! 381: .Ar target-client
! 382: to
! 383: .Ar target-session .
! 384: .El
! 385: .Sh WINDOWS AND PANES
1.1 nicm 386: A
387: .Nm
388: window may be in one of several modes.
389: The default permits direct access to the terminal attached to the window.
390: The others are:
391: .Bl -tag -width Ds
392: .It Em output mode
393: This is entered when a command which produces output, such as
394: .Ic list-keys ,
395: is executed from a key binding.
396: .It Em scroll mode
397: This is entered with the
398: .Ic scroll-mode
399: command (bound to
400: .Ql =
401: by default) and permits the window history buffer to be inspected.
402: .It Em copy mode
403: This permits a section of a window or its history to be copied to a
404: .Em paste buffer
405: for later insertion into another window.
406: This mode is entered with the
407: .Ic copy-mode
408: command, bound to
409: .Ql [
410: by default.
411: .El
412: .Pp
1.6 jmc 413: The keys available depend on whether emacs or vi mode is selected
414: (see the
1.1 nicm 415: .Ic mode-keys
416: option).
417: The following keys are supported as appropriate for the mode:
418: .Bl -column "FunctionXXXXXXXXXXXX" "viXXXXXX" "emacs" -offset indent
419: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27 nicm 420: .It Li "Start of line" Ta "0" Ta "C-a"
421: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.1 nicm 422: .It Li "Clear selection" Ta "Escape" Ta "C-g"
423: .It Li "Copy selection" Ta "Enter" Ta "M-w"
424: .It Li "Cursor down" Ta "j" Ta "Down"
425: .It Li "End of line" Ta "$" Ta "C-e"
426: .It Li "Cursor left" Ta "h" Ta "Left"
427: .It Li "Next page" Ta "C-f" Ta "Page down"
428: .It Li "Next word" Ta "w" Ta "M-f"
429: .It Li "Previous page" Ta "C-u" Ta "Page up"
430: .It Li "Previous word" Ta "b" Ta "M-b"
431: .It Li "Quit mode" Ta "q" Ta "Escape"
432: .It Li "Cursor right" Ta "l" Ta "Right"
433: .It Li "Start selection" Ta "Space" Ta "C-Space"
434: .It Li "Cursor up" Ta "k" Ta "Up"
1.48 nicm 435: .It Li "Delete to end of line" Ta "D" Ta "C-k"
1.2 nicm 436: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.1 nicm 437: .El
438: .Pp
1.48 nicm 439: These key bindings are defined in a set of named tables:
440: .Em vi-edit
441: and
442: .Em emacs-edit
443: for keys used when line editing at the command prompt;
444: .Em vi-choice
445: and
446: .Em emacs-choice
447: for keys used when choosing from lists (such as produced by the
448: .Ic window-choose
449: command) or in output mode; and
450: .Em vi-copy
451: and
452: .Em emacs-copy
453: used in copy and scroll modes.
454: The tables may be viewed with the
455: .Ic list-keys
1.49 nicm 456: command and keys modified or removed with
457: .Ic bind-key
458: and
459: .Ic unbind-key .
1.48 nicm 460: .Pp
1.2 nicm 461: The paste buffer key pastes the first line from the top paste buffer on the
462: stack.
1.57 ! jmc 463: .Pp
! 464: The mode commands are as follows:
! 465: .Bl -tag -width Ds
! 466: .It Xo Ic copy-mode
! 467: .Op Fl u
! 468: .Op Fl t Ar target-window
! 469: .Xc
! 470: Enter copy mode.
! 471: The
! 472: .Fl u
! 473: option scrolls one page up.
! 474: .It Xo Ic scroll-mode
! 475: .Op Fl u
! 476: .Op Fl t Ar target-window
! 477: .Xc
! 478: Enter scroll mode.
! 479: The
! 480: .Fl u
! 481: has the same meaning as in the
1.1 nicm 482: .Ic copy-mode
1.18 nicm 483: command.
1.57 ! jmc 484: .El
1.18 nicm 485: .Pp
1.1 nicm 486: Each window displayed by
487: .Nm
488: may be split into one or more
489: .Em panes ;
490: each pane takes up a certain area of the display and is a separate terminal.
491: A window may be split into panes using the
492: .Ic split-window
493: command.
1.38 nicm 494: Windows may be split horizontally (with the
495: .Fl h
496: flag) or vertically.
497: Panes may be resized with the
498: .Ic resize-pane
1.1 nicm 499: command (bound to
1.38 nicm 500: .Ql C-up ,
501: .Ql C-down
502: .Ql C-left
503: and
504: .Ql C-right
1.1 nicm 505: by default), the current pane may be changed with the
506: .Ic up-pane
507: and
508: .Ic down-pane
509: commands and the
510: .Ic rotate-window
511: and
512: .Ic swap-pane
1.38 nicm 513: commands may be used to swap panes without changing their position.
514: Panes are numbered beginning from zero in the order they are created.
515: .Pp
516: A number of preset
517: .Em layouts
518: are available.
519: These may be selected with the
520: .Ic select-layout
521: command or cycled with
522: .Ic next-layout
523: (bound to
524: .Ql C-space
525: by default); once a layout is chosen, panes within it may be moved and resized as normal.
1.1 nicm 526: .Pp
527: The following layouts are supported:
528: .Bl -tag -width Ds
529: .It Ic even-horizontal
530: Panes are spread out evenly from left to right across the window.
531: .It Ic even-vertical
532: Panes are spread evenly from top to bottom.
1.2 nicm 533: .It Ic main-horizontal
534: A large (main) pane is shown at the top of the window and the remaining panes are
1.6 jmc 535: spread from left to right in the leftover space at the bottom.
1.2 nicm 536: Use the
537: .Em main-pane-height
538: window option to specify the height of the top pane.
1.1 nicm 539: .It Ic main-vertical
1.2 nicm 540: Similar to
541: .Ic main-horizontal
542: but the large pane is placed on the left and the others spread from top to
543: bottom along the right.
544: See the
545: .Em main-pane-width
546: window option.
1.1 nicm 547: .El
1.8 nicm 548: .Pp
1.57 ! jmc 549: Commands related to windows and panes are as follows:
! 550: .Bl -tag -width Ds
! 551: .It Xo Ic break-pane
! 552: .Op Fl d
! 553: .Op Fl t Ar target-pane
! 554: .Xc
! 555: .D1 (alias: Ic breakp )
! 556: Break
! 557: .Ar target-pane
! 558: off from its containing window to make it the only pane in a new window.
! 559: If
! 560: .Fl d
! 561: is given, the new window does not become the current window.
! 562: .It Ic choose-session Op Fl t Ar target-window
! 563: Put a window into session choice mode, where the session for the current
! 564: client may be selected interactively from a list.
! 565: This command works only from inside
! 566: .Nm .
! 567: .It Ic choose-window Op Fl t Ar target-window
! 568: Put a window into window choice mode, where the window for the session
! 569: attached to the current client may be selected interactively from a list.
! 570: This command works only from inside
! 571: .Nm .
! 572: .It Ic down-pane Op Fl t Ar target-pane
! 573: .D1 (alias: Ic downp )
! 574: Move down a pane.
! 575: .It Xo Ic find-window
! 576: .Op Fl t Ar target-window
! 577: .Ar match-string
! 578: .Xc
! 579: .D1 (alias: Ic findw )
! 580: Search for the
! 581: .Xr fnmatch 3
! 582: pattern
! 583: .Ar match-string
! 584: in window names, titles, and visible content (but not history).
! 585: If only one window is matched, it'll be automatically selected, otherwise a
! 586: choice list is shown.
! 587: This command only works from inside
1.1 nicm 588: .Nm .
1.57 ! jmc 589: .It Ic kill-pane Op Fl t Ar target-pane
! 590: .D1 (alias: Ic killp )
! 591: Destroy the given pane.
! 592: If no panes remain in the containing window, it is also destroyed.
! 593: .It Ic kill-window Op Fl t Ar target-window
! 594: .D1 (alias: Ic killw )
! 595: Kill the current window or the window at
! 596: .Ar target-window ,
1.1 nicm 597: removing it from any sessions to which it is linked.
1.56 jmc 598: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 599: .D1 (alias: Ic last )
600: Select the last (previously selected) window.
601: If no
602: .Ar target-session
603: is specified, select the last window of the current session.
604: .It Xo Ic link-window
605: .Op Fl dk
606: .Op Fl s Ar src-window
607: .Op Fl t Ar dst-window
608: .Xc
609: .D1 (alias: Ic linkw )
610: Link the window at
611: .Ar src-window
612: to the specified
613: .Ar dst-window .
614: If
615: .Ar dst-window
616: is specified and no such window exists, the
617: .Ar src-window
618: is linked there.
619: If
620: .Fl k
621: is given and
622: .Ar dst-window
623: exists, it is killed, otherwise an error is generated.
624: If
625: .Fl d
626: is given, the newly linked window is not selected.
1.56 jmc 627: .It Ic list-windows Op Fl t Ar target-session
1.1 nicm 628: .D1 (alias: Ic lsw )
629: List windows in the current session or in
630: .Ar target-session .
631: .It Xo Ic move-window
632: .Op Fl d
633: .Op Fl s Ar src-window
634: .Op Fl t Ar dst-window
635: .Xc
636: .D1 (alias: Ic movew )
637: This is similar to
638: .Ic link-window ,
639: except the window at
640: .Ar src-window
641: is moved to
642: .Ar dst-window .
643: .It Xo Ic new-window
1.28 nicm 644: .Op Fl dk
1.1 nicm 645: .Op Fl n Ar window-name
646: .Op Fl t Ar target-window
647: .Op Ar command
648: .Xc
649: .D1 (alias: Ic neww )
650: Create a new window.
651: If
652: .Fl d
653: is given, the session does not make the new window the current window.
654: .Ar target-window
1.28 nicm 655: represents the window to be created; if the target already exists an error is
656: shown, unless the
657: .Fl k
658: flag is used, in which case it is destroyed.
1.1 nicm 659: .Ar command
660: is the command to execute.
661: If
662: .Ar command
663: is not specified, the default command is used.
664: .Pp
665: The
666: .Ev TERM
667: environment variable must be set to
668: .Dq screen
669: for all programs running
670: .Em inside
671: .Nm .
672: New windows will automatically have
673: .Dq TERM=screen
674: added to their environment, but care must be taken not to reset this in shell
675: start-up files.
1.56 jmc 676: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 677: .D1 (alias: Ic nextl )
678: Move a window to the next layout and rearrange the panes to fit.
679: .It Xo Ic next-window
1.9 nicm 680: .Op Fl a
1.1 nicm 681: .Op Fl t Ar target-session
682: .Xc
683: .D1 (alias: Ic next )
684: Move to the next window in the session.
1.9 nicm 685: If
1.12 jmc 686: .Fl a
1.9 nicm 687: is used, move to the next window with a bell, activity or content alert.
1.1 nicm 688: .It Xo Ic previous-window
1.9 nicm 689: .Op Fl a
1.1 nicm 690: .Op Fl t Ar target-session
691: .Xc
692: .D1 (alias: Ic prev )
693: Move to the previous window in the session.
1.9 nicm 694: With
695: .Fl a ,
696: move to the previous window with a bell, activity or content alert.
1.1 nicm 697: .It Xo Ic rename-window
698: .Op Fl t Ar target-window
699: .Ar new-name
700: .Xc
701: .D1 (alias: Ic renamew )
702: Rename the current window, or the window at
703: .Ar target-window
704: if specified, to
705: .Ar new-name .
706: .It Xo Ic resize-pane
1.39 jmc 707: .Op Fl DLRU
1.52 nicm 708: .Op Fl t Ar target-pane
1.1 nicm 709: .Op Ar adjustment
710: .Xc
711: .D1 (alias: Ic resizep )
1.57 ! jmc 712: Resize a pane, upward with
! 713: .Fl U
! 714: (the default), downward with
! 715: .Fl D ,
! 716: to the left with
! 717: .Fl L
! 718: and to the right with
! 719: .Fl R .
! 720: The
! 721: .Ar adjustment
! 722: is given in lines or cells (the default is 1).
! 723: .It Xo Ic respawn-window
! 724: .Op Fl k
! 725: .Op Fl t Ar target-window
! 726: .Op Ar command
! 727: .Xc
! 728: .D1 (alias: Ic respawnw )
! 729: Reactive a window in which the command has exited (see the
! 730: .Ic remain-on-exit
! 731: window option).
! 732: If
! 733: .Ar command
! 734: is not given, the command used when the window was created is executed.
! 735: The window must be already inactive, unless
! 736: .Fl k
! 737: is given, in which case any existing command is killed.
! 738: .It Xo Ic rotate-window
! 739: .Op Fl DU
! 740: .Op Fl t Ar target-window
! 741: .Xc
! 742: .D1 (alias: Ic rotatew )
! 743: Rotate the positions of the panes within a window, either upward (numerically
! 744: lower) with
! 745: .Fl U
! 746: or downward (numerically higher).
! 747: .It Xo Ic select-layout
! 748: .Op Fl t Ar target-window
! 749: .Op Ar layout-name
! 750: .Xc
! 751: .D1 (alias: selectl )
! 752: Choose a specific layout for a window.
! 753: If
! 754: .Ar layout-name
! 755: is not given, the last layout used (if any) is reapplied.
! 756: .It Ic select-pane Op Fl t Ar target-pane
! 757: .D1 (alias: Ic selectp )
! 758: Make pane
! 759: .Ar target-pane
! 760: the active pane in window
! 761: .Ar target-window .
! 762: .It Ic select-window Op Fl t Ar target-window
! 763: .D1 (alias: Ic selectw )
! 764: Select the window at
! 765: .Ar target-window .
! 766: .It Xo Ic split-window
! 767: .Op Fl dhv
! 768: .Oo Fl l
! 769: .Ar size |
! 770: .Fl p Ar percentage Oc
! 771: .Op Fl t Ar target-window
! 772: .Op Ar command
! 773: .Xc
! 774: .D1 (alias: splitw )
! 775: Creates a new pane by splitting the active pane:
! 776: .Fl h
! 777: does a horizontal split and
! 778: .Fl v
! 779: a vertical split; if neither is specified,
! 780: .Fl v
! 781: is assumed.
! 782: The
! 783: .Fl l
! 784: and
! 785: .Fl p
! 786: options specify the size of the new window in lines (for vertical split) or in
! 787: cells (for horizontal split), or as a percentage, respectively.
! 788: All other options have the same meaning as in the
! 789: .Ic new-window
! 790: command.
! 791: .It Xo Ic swap-pane
! 792: .Op Fl dDU
! 793: .Op Fl s Ar src-pane
! 794: .Op Fl t Ar dst-pane
! 795: .Xc
! 796: .D1 (alias: Ic swapp )
! 797: Swap two panes.
! 798: If
! 799: .Fl U
! 800: is used and no source pane is specified with
! 801: .Fl s ,
! 802: .Ar dst-pane
! 803: is swapped with the previous pane (before it numerically);
! 804: .Fl D
! 805: swaps with the next pane (after it numerically).
! 806: .It Xo Ic swap-window
! 807: .Op Fl d
! 808: .Op Fl s Ar src-window
! 809: .Op Fl t Ar dst-window
! 810: .Xc
! 811: .D1 (alias: Ic swapw )
! 812: This is similar to
! 813: .Ic link-window ,
! 814: except the source and destination windows are swapped.
! 815: It is an error if no window exists at
! 816: .Ar src-window .
! 817: .It Xo Ic unlink-window
1.1 nicm 818: .Op Fl k
819: .Op Fl t Ar target-window
820: .Xc
1.57 ! jmc 821: .D1 (alias: Ic unlinkw )
! 822: Unlink
! 823: .Ar target-window .
! 824: Unless
! 825: .Fl k
! 826: is given, a window may be unlinked only if it is linked to multiple sessions -
! 827: windows may not be linked to no sessions;
! 828: if
1.1 nicm 829: .Fl k
1.57 ! jmc 830: is specified and the window is linked to only one session, it is unlinked and
! 831: destroyed.
! 832: .It Ic up-pane Op Fl t Ar target-pane
! 833: .D1 (alias: Ic upp )
! 834: Move up a pane.
! 835: .El
! 836: .Sh KEY BINDINGS
! 837: .Nm
! 838: may be controlled from an attached client by using a key combination of a
! 839: prefix key,
! 840: .Ql C-b
! 841: (Ctrl-b) by default, followed by a command key.
! 842: .Pp
! 843: Some of the default key bindings include:
! 844: .Pp
! 845: .Bl -tag -width Ds -offset 3n -compact
! 846: .It c
! 847: Create new window.
! 848: .It d
! 849: Detach current client.
! 850: .It l
! 851: Move to last (previously selected) window in the current session.
! 852: .It n
! 853: Change to next window in the current session.
! 854: .It p
! 855: Change to previous window in the current session.
! 856: .It t
! 857: Display a large clock.
! 858: .It \&?
! 859: List current key bindings.
! 860: .El
! 861: .Pp
! 862: A complete list may be obtained with the
! 863: .Ic list-keys
! 864: command (bound to
! 865: .Ql \&?
! 866: by default).
! 867: Key bindings may be changed with the
! 868: .Ic bind-key
! 869: and
! 870: .Ic unbind-key
! 871: commands.
! 872: .Pp
! 873: Commands related to key bindings are as follows:
! 874: .Bl -tag -width Ds
! 875: .It Xo Ic bind-key
! 876: .Op Fl cnr
! 877: .Op Fl t Ar key-table
! 878: .Ar key Ar command Op Ar arguments
1.1 nicm 879: .Xc
1.57 ! jmc 880: .D1 (alias: Ic bind )
! 881: Bind key
! 882: .Ar key
! 883: to
! 884: .Ar command .
! 885: Keys may be specified prefixed with
! 886: .Ql C-
! 887: or
! 888: .Ql ^
! 889: for Ctrl keys, or
! 890: .Ql M-
! 891: for Alt (meta) keys.
! 892: .Pp
! 893: By default (without
! 894: .Fl t )
! 895: the primary key bindings are modified (those normally activated with the prefix
! 896: key); in this case, if
! 897: .Fl n
! 898: is specified, it is not necessary to use the prefix key,
! 899: .Ar command
! 900: is bound to
! 901: .Ar key
! 902: alone.
1.1 nicm 903: The
1.57 ! jmc 904: .Fl r
! 905: flag indicates this key may repeat, see the
! 906: .Ic repeat-time
! 907: option.
! 908: .Pp
! 909: If
! 910: .Fl t
! 911: is present,
! 912: .Ar key
! 913: is bound in
! 914: .Ar key-table :
! 915: the binding for command mode with
! 916: .Fl c
! 917: or for normal mode without.
! 918: To view the default bindings and possible commands, see the
! 919: .Ic list-keys
! 920: command.
! 921: .It Ic list-keys Op Fl t Ar key-table
! 922: .D1 (alias: Ic lsk )
! 923: List all key bindings.
! 924: Without
! 925: .Fl t
! 926: the primary key bindings - those executed when preceded by the prefix key -
! 927: are printed.
! 928: Keys bound without the prefix key (see
! 929: .Ic bind-key
! 930: .Fl n )
! 931: are enclosed in square brackets.
! 932: .Pp
! 933: With
! 934: .Fl t ,
! 935: the key bindings in
! 936: .Ar key-table
! 937: are listed; this may be one of:
! 938: .Em vi-edit ,
! 939: .Em emacs-edit ,
! 940: .Em vi-choice ,
! 941: .Em emacs-choice ,
! 942: .Em vi-copy
! 943: or
! 944: .Em emacs-copy .
! 945: .It Xo Ic send-keys
1.1 nicm 946: .Op Fl t Ar target-window
1.57 ! jmc 947: .Ar key Ar ...
1.1 nicm 948: .Xc
1.57 ! jmc 949: .D1 (alias: Ic send )
! 950: Send a key or keys to a window.
! 951: Each argument
! 952: .Ar key
! 953: is the name of the key (such as
! 954: .Ql C-a
! 955: or
! 956: .Ql npage
! 957: ) to send; if the string is not recognised as a key, it is sent as a series of
! 958: characters.
! 959: All arguments are sent sequentially from first to last.
! 960: .It Ic send-prefix Op Fl t Ar target-window
! 961: Send the prefix key to a window as if it was pressed.
! 962: .It Xo Ic unbind-key
! 963: .Op Fl cn
! 964: .Op Fl t Ar key-table
! 965: .Ar key
1.2 nicm 966: .Xc
1.57 ! jmc 967: .D1 (alias: Ic unbind )
! 968: Unbind the command bound to
! 969: .Ar key .
! 970: Without
! 971: .Fl t
! 972: the primary key bindings are modified; in this case, if
! 973: .Fl n
! 974: is specified, the command bound to
! 975: .Ar key
! 976: without a prefix (if any) is removed.
! 977: .Pp
1.47 nicm 978: If
1.57 ! jmc 979: .Fl t
! 980: is present,
! 981: .Ar key
! 982: in
! 983: .Ar key-table
! 984: is unbound: the binding for command mode with
! 985: .Fl c
! 986: or for normal mode without.
! 987: .El
! 988: .Sh OPTIONS
! 989: The appearance and behaviour of
! 990: .Nm
! 991: may be modified by changing the value of various options.
! 992: There are two types of option:
! 993: .Em session options
! 994: and
! 995: .Em window options .
! 996: .Pp
! 997: Each individual session may have a set of session options, and there is a
! 998: separate set of global session options.
! 999: Sessions which do not have a particular option configured inherit the value
! 1000: from the global session options.
! 1001: Session options are set or unset with the
! 1002: .Ic set-option
! 1003: command and may be listed with the
! 1004: .Ic show-options
! 1005: command.
! 1006: The available session options are listed under the
! 1007: .Ic set-option
! 1008: command.
! 1009: .Pp
! 1010: Similarly, a set of window options is attached to each window, and there is
! 1011: a set of global window options from which any unset options are inherited.
! 1012: Window options are altered with the
! 1013: .Ic set-window-option
! 1014: command and can be listed with the
! 1015: .Ic show-window-options
! 1016: command.
! 1017: All window options are documented with the
! 1018: .Ic set-window-option
! 1019: command.
! 1020: .Pp
! 1021: Commands which set options are as follows:
! 1022: .Bl -tag -width Ds
1.1 nicm 1023: .It Xo Ic set-option
1024: .Op Fl gu
1025: .Op Fl t Ar target-session
1026: .Ar option Ar value
1027: .Xc
1028: .D1 (alias: Ic set )
1.18 nicm 1029: Set a session option.
1.1 nicm 1030: If
1031: .Fl g
1.18 nicm 1032: is specified, the global session option is set.
1.1 nicm 1033: The
1034: .Fl u
1035: flag unsets an option, so a session inherits the option from the global
1036: options - it is not possible to unset a global option.
1037: .Pp
1.18 nicm 1038: Available session options are:
1.1 nicm 1039: .Bl -tag -width Ds
1040: .It Xo Ic bell-action
1.56 jmc 1041: .Op Ic any | none | current
1.1 nicm 1042: .Xc
1043: Set action on window bell.
1044: .Ic any
1045: means a bell in any window linked to a session causes a bell in the current
1046: window of that session,
1047: .Ic none
1048: means all bells are ignored and
1049: .Ic current
1050: means only bell in windows other than the current window are ignored.
1051: .It Ic buffer-limit Ar number
1052: Set the number of buffers kept for each session; as new buffers are added to
1053: the top of the stack, old ones are removed from the bottom if necessary to
1054: maintain this maximum length.
1055: .It Ic default-command Ar command
1056: Set the command used for new windows (if not specified when the window is
1057: created) to
1058: .Ar command .
1.19 nicm 1059: The default is an empty string, which instructs
1060: .Nm
1061: to create a login shell using the
1062: .Ev SHELL
1063: environment variable or, if it is unset, the user's shell returned by
1064: .Xr getpwuid 3 .
1.1 nicm 1065: .It Ic default-path Ar path
1066: Set the default working directory for processes created from keys, or
1067: interactively from the prompt.
1068: The default is the current working directory when the server is started.
1.22 nicm 1069: .It Ic default-terminal Ar terminal
1070: Set the default terminal for new windows created in this session - the
1071: default value of the
1072: .Ev TERM
1073: environment variable.
1074: For
1075: .Nm
1076: to work correctly, this
1077: .Em must
1078: be set to
1079: .Ql screen
1080: or a derivative of it.
1.21 nicm 1081: .It Ic display-time Ar time
1082: Set the amount of time for which status line messages are displayed.
1083: .Ar time
1084: is in milliseconds.
1.1 nicm 1085: .It Ic history-limit Ar lines
1086: Set the maximum number of lines held in window history.
1087: This setting applies only to new windows - existing window histories are not
1088: resized and retain the limit at the point they were created.
1089: .It Ic lock-after-time Ar number
1090: Lock the server after
1091: .Ar number
1092: seconds of inactivity.
1093: The default is off (set to 0).
1094: This has no effect as a session option; it must be set as a global option using
1095: .Fl g .
1096: .It Ic message-attr Ar attributes
1097: Set status line message attributes, where
1098: .Ar attributes
1099: is either
1100: .Ic default
1101: or a comma-delimited list of one or more of:
1102: .Ic bright
1103: (or
1104: .Ic bold ) ,
1105: .Ic dim ,
1106: .Ic underscore ,
1107: .Ic blink ,
1108: .Ic reverse ,
1109: .Ic hidden ,
1110: or
1111: .Ic italics .
1112: .It Ic message-bg Ar colour
1113: Set status line message background colour, where
1114: .Ar colour
1115: is one of:
1116: .Ic black ,
1117: .Ic red ,
1118: .Ic green ,
1119: .Ic yellow ,
1120: .Ic blue ,
1121: .Ic magenta ,
1122: .Ic cyan ,
1123: .Ic white
1124: or
1125: .Ic default .
1126: .It Ic message-fg Ar colour
1127: Set status line message foreground colour.
1128: .It Ic prefix Ar key
1129: Set the current prefix key.
1.21 nicm 1130: .It Ic repeat-time Ar time
1.1 nicm 1131: Allow multiple commands to be entered without pressing the prefix-key again
1132: in the specified
1.21 nicm 1133: .Ar time
1.1 nicm 1134: milliseconds (the default is 500).
1135: Whether a key repeats may be set when it is bound using the
1136: .Fl r
1137: flag to
1138: .Ic bind-key .
1.52 nicm 1139: Repeat is enabled for the default keys bound to the
1140: .Ic resize-pane
1141: command.
1.1 nicm 1142: .It Xo Ic set-remain-on-exit
1.56 jmc 1143: .Op Ic on | off
1.1 nicm 1144: .Xc
1145: Set the
1146: .Ic remain-on-exit
1147: window option for any windows first created in this session.
1148: .It Xo Ic set-titles
1.56 jmc 1149: .Op Ic on | off
1.1 nicm 1150: .Xc
1151: Attempt to set the window title using the \ee]2;...\e007 xterm code and
1152: the terminal appears to be an xterm.
1.11 nicm 1153: This option is off by default.
1.6 jmc 1154: Note that elinks
1.1 nicm 1155: will only attempt to set the window title if the STY environment
1156: variable is set.
1157: .It Xo Ic status
1.56 jmc 1158: .Op Ic on | off
1.1 nicm 1159: .Xc
1160: Show or hide the status line.
1161: .It Ic status-attr Ar attributes
1162: Set status line attributes.
1163: .It Ic status-bg Ar colour
1164: Set status line background colour.
1165: .It Ic status-fg Ar colour
1166: Set status line foreground colour.
1167: .It Ic status-interval Ar interval
1168: Update the status bar every
1169: .Ar interval
1170: seconds.
1171: By default, updates will occur every 15 seconds.
1172: A setting of zero disables redrawing at interval.
1.41 nicm 1173: .It Xo Ic status-justify
1.56 jmc 1174: .Op Ic left | centre | right
1.41 nicm 1175: .Xc
1176: Set the position of the window list component of the status line: left, centre
1177: or right justified.
1.1 nicm 1178: .It Xo Ic status-keys
1.56 jmc 1179: .Op Ic vi | emacs
1.1 nicm 1180: .Xc
1.6 jmc 1181: Use vi or emacs-style
1.1 nicm 1182: key bindings in the status line, for example at the command prompt.
1183: Defaults to emacs.
1184: .It Ic status-left Ar string
1185: Display
1186: .Ar string
1187: to the left of the status bar.
1188: .Ar string
1189: will be passed through
1190: .Xr strftime 3
1191: before being used.
1192: By default, the session name is shown.
1193: .Ar string
1194: may contain any of the following special character pairs:
1195: .Bl -column "Character pair" "Replaced with" -offset indent
1196: .It Sy "Character pair" Ta Sy "Replaced with"
1197: .It Li "#(command)" Ta "First line of command's output"
1198: .It Li "#H" Ta "Hostname of local host"
1.35 nicm 1199: .It Li "#I" Ta "Current window index"
1200: .It Li "#P" Ta "Current pane index"
1.1 nicm 1201: .It Li "#S" Ta "Session name"
1202: .It Li "#T" Ta "Current window title"
1.35 nicm 1203: .It Li "#W" Ta "Current window name"
1.1 nicm 1204: .It Li "##" Ta "A literal" Ql #
1205: .El
1206: .Pp
1207: Where appropriate, these may be prefixed with a number to specify the maximum
1208: length, for example
1209: .Ql #24T .
1.10 nicm 1210: .Pp
1.12 jmc 1211: By default, UTF-8 in
1.10 nicm 1212: .Ar string
1213: is not interpreted, to enable UTF-8, use the
1214: .Ic status-utf8
1215: option.
1.1 nicm 1216: .It Ic status-left-length Ar length
1217: Set the maximum
1218: .Ar length
1219: of the left component of the status bar.
1220: The default is 10.
1221: .It Ic status-right Ar string
1222: Display
1223: .Ar string
1224: to the right of the status bar.
1225: By default, the date and time will be shown.
1226: As with
1227: .Ic status-left ,
1228: .Ar string
1229: will be passed to
1.10 nicm 1230: .Xr strftime 3 ,
1231: character pairs are replaced, and UTF-8 is dependent on the
1232: .Ic status-utf8
1233: option.
1.1 nicm 1234: .It Ic status-right-length Ar length
1235: Set the maximum
1236: .Ar length
1237: of the right component of the status bar.
1238: The default is 40.
1.10 nicm 1239: .Pp
1240: .It Xo Ic status-utf8
1.56 jmc 1241: .Op Ic on | off
1.10 nicm 1242: .Xc
1243: Instruct
1244: .Nm
1245: to treat top-bit-set characters in the
1246: .Ic status-left
1247: and
1248: .Ic status-right
1249: strings as UTF-8; notably, this is important for wide characters.
1250: This option defaults to off.
1.55 jmc 1251: .It Ic terminal-overrides Ar string
1.54 nicm 1252: Contains a list of entries which override terminal descriptions read using
1253: .Xr terminfo 5 .
1254: .Ar string
1255: is a comma-separated list of items each a colon-separated string made up of a
1256: terminal type pattern (matched using
1257: .Xr fnmatch 3 )
1258: and a set of
1259: .Em name=value
1260: entries.
1261: .Pp
1262: For example, to set the
1263: .Ql clear
1264: .Xr terminfo 5
1265: entry to
1266: .Ql \ee[H\ee[2J
1267: for all terminal types and the
1268: .Ql dch1
1269: entry to
1270: .Ql \ee[P
1.55 jmc 1271: for the
1.54 nicm 1272: .Ql rxvt
1273: terminal type, the option could be set to the string:
1274: .Bd -literal -offset indent
1275: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
1276: .Ed
1277: .Pp
1278: The terminal entry value is passed through
1279: .Xr strunvis 3
1280: before interpretation.
1281: The default value forcibly corrects the
1282: .Ql colors
1283: entry for terminals which support 88 or 256 colours:
1284: .Bd -literal -offset indent
1285: "*88col*:colors=88,*256col*:colors=256"
1286: .Ed
1.37 nicm 1287: .It Xo Ic visual-activity
1.56 jmc 1288: .Op Ic on | off
1.37 nicm 1289: .Xc
1290: If on, display a status line message when activity occurs in a window
1.39 jmc 1291: for which the
1.37 nicm 1292: .Ic monitor-activity
1293: window option is enabled.
1294: .It Xo Ic visual-bell
1.56 jmc 1295: .Op Ic on | off
1.37 nicm 1296: .Xc
1297: If this option is on, a message is shown on a bell instead of it being passed
1298: through to the terminal (which normally makes a sound).
1299: Also see the
1300: .Ic bell-action
1301: option.
1302: .It Xo Ic visual-content
1.56 jmc 1303: .Op Ic on | off
1.37 nicm 1304: .Xc
1305: Like
1306: .Ic visual-activity ,
1307: display a message when content is present in a window
1.39 jmc 1308: for which the
1.37 nicm 1309: .Ic monitor-content
1310: window option is enabled.
1.1 nicm 1311: .El
1312: .It Xo Ic set-window-option
1313: .Op Fl gu
1314: .Op Fl t Ar target-window
1315: .Ar option Ar value
1316: .Xc
1317: .D1 (alias: Ic setw )
1.18 nicm 1318: Set a window option.
1.1 nicm 1319: The
1320: .Fl g
1321: and
1322: .Fl u
1323: flags work similarly to the
1324: .Ic set-option
1325: command.
1326: .Pp
1.18 nicm 1327: Supported window options are:
1.56 jmc 1328: .Pp
1329: .Bl -tag -width Ds -compact
1.1 nicm 1330: .It Xo Ic aggressive-resize
1.56 jmc 1331: .Op Ic on | off
1.1 nicm 1332: .Xc
1333: Aggressively resize the chosen window.
1334: This means that
1335: .Nm
1336: will resize the window to the size of the smallest session for which it is the
1337: current window, rather than the smallest session to which it is attached.
1338: The window may resize when the current window is changed on another sessions;
1.6 jmc 1339: this option is good for full-screen programs which support
1340: .Dv SIGWINCH
1341: and poor for interactive programs such as shells.
1.56 jmc 1342: .Pp
1.1 nicm 1343: .It Xo Ic automatic-rename
1.56 jmc 1344: .Op Ic on | off
1.1 nicm 1345: .Xc
1346: Control automatic window renaming.
1347: When this setting is enabled,
1348: .Nm
1349: will attempt - on supported platforms - to rename the window to reflect the
1350: command currently running in it.
1351: This flag is automatically disabled for an individual window when a name
1352: is specified at creation with
1353: .Ic new-window or
1354: .Ic new-session ,
1355: or later with
1356: .Ic rename-window .
1357: It may be switched off globally with:
1358: .Bd -literal -offset indent
1359: set-window-option -g automatic-rename off
1360: .Ed
1.56 jmc 1361: .Pp
1.1 nicm 1362: .It Ic clock-mode-colour Ar colour
1363: Set clock colour.
1.56 jmc 1364: .Pp
1.1 nicm 1365: .It Xo Ic clock-mode-style
1.56 jmc 1366: .Op Ic 12 | 24
1.1 nicm 1367: .Xc
1368: Set clock hour format.
1.56 jmc 1369: .Pp
1.1 nicm 1370: .It Ic force-height Ar height
1371: .It Ic force-width Ar width
1372: Prevent
1373: .Nm
1374: from resizing a window to greater than
1375: .Ar width
1376: or
1377: .Ar height .
1378: A value of zero restores the default unlimited setting.
1.56 jmc 1379: .Pp
1.2 nicm 1380: .It Ic main-pane-width Ar width
1381: .It Ic main-pane-height Ar height
1382: Set the width or height of the main (left or top) pane in the
1383: .Ic main-horizontal
1384: or
1385: .Ic main-vertical
1386: layouts.
1.56 jmc 1387: .Pp
1.1 nicm 1388: .It Ic mode-attr Ar attributes
1389: Set window modes attributes.
1.56 jmc 1390: .Pp
1.1 nicm 1391: .It Ic mode-bg Ar colour
1392: Set window modes background colour.
1.56 jmc 1393: .Pp
1.1 nicm 1394: .It Ic mode-fg Ar colour
1395: Set window modes foreground colour.
1.56 jmc 1396: .Pp
1.1 nicm 1397: .It Xo Ic mode-keys
1.56 jmc 1398: .Op Ic vi | emacs
1.1 nicm 1399: .Xc
1.50 nicm 1400: Use vi or emacs-style key bindings in scroll, copy and choice modes.
1.1 nicm 1401: Key bindings default to emacs.
1.56 jmc 1402: .Pp
1.50 nicm 1403: .It Xo Ic mode-mouse
1.56 jmc 1404: .Op Ic on | off
1.50 nicm 1405: .Xc
1.51 jmc 1406: Mouse state in modes.
1407: If on,
1.50 nicm 1408: .Nm
1409: will respond to mouse clicks by moving the cursor in copy mode or selecting an
1410: option in choice mode.
1.56 jmc 1411: .Pp
1.1 nicm 1412: .It Xo Ic monitor-activity
1.56 jmc 1413: .Op Ic on | off
1.1 nicm 1414: .Xc
1415: Monitor for activity in the window.
1416: Windows with activity are highlighted in the status line.
1.56 jmc 1417: .Pp
1418: .It Ic monitor-content Ar match-string
1.6 jmc 1419: Monitor content in the window.
1420: When
1.16 nicm 1421: .Xr fnmatch 3
1422: pattern
1.1 nicm 1423: .Ar match-string
1424: appears in the window, it is highlighted in the status line.
1.56 jmc 1425: .Pp
1.1 nicm 1426: .It Xo Ic remain-on-exit
1.56 jmc 1427: .Op Ic on | off
1.1 nicm 1428: .Xc
1429: A window with this flag set is not destroyed when the program running in it
1430: exits.
1431: The window may be reactivated with the
1432: .Ic respawn-window
1433: command.
1.56 jmc 1434: .Pp
1.1 nicm 1435: .It Xo Ic utf8
1.56 jmc 1436: .Op Ic on | off
1.1 nicm 1437: .Xc
1438: Instructs
1439: .Nm
1440: to expect UTF-8 sequences to appear in this window.
1.56 jmc 1441: .Pp
1.1 nicm 1442: .It Ic window-status-attr Ar attributes
1443: Set status line attributes for a single window.
1.56 jmc 1444: .Pp
1.1 nicm 1445: .It Ic window-status-bg Ar colour
1446: Set status line background colour for a single window.
1.56 jmc 1447: .Pp
1.1 nicm 1448: .It Ic window-status-fg Ar colour
1449: Set status line foreground colour for a single window.
1.56 jmc 1450: .Pp
1.40 nicm 1451: .It Ic window-status-current-attr Ar attributes
1452: Set status line attributes for the currently active window.
1.56 jmc 1453: .Pp
1.40 nicm 1454: .It Ic window-status-current-bg Ar colour
1455: Set status line background colour for the currently active window.
1.56 jmc 1456: .Pp
1.40 nicm 1457: .It Ic window-status-current-fg Ar colour
1458: Set status line foreground colour for the currently active window.
1.56 jmc 1459: .Pp
1.1 nicm 1460: .It Xo Ic xterm-keys
1.56 jmc 1461: .Op Ic on | off
1.1 nicm 1462: .Xc
1463: If this option is set,
1464: .Nm
1465: will generate
1.57 ! jmc 1466: .Xr xterm 1 -style
! 1467: function key sequences; these have a number included to indicate modifiers such
! 1468: as Shift, Alt or Ctrl.
! 1469: .El
! 1470: .It Xo Ic show-options
! 1471: .Op Fl g
! 1472: .Op Fl t Ar target-session
! 1473: .Xc
! 1474: .D1 (alias: Ic show )
! 1475: Show the session options for
! 1476: .Ar target session ,
! 1477: or the global session options with
! 1478: .Fl g .
! 1479: .It Xo Ic show-window-options
! 1480: .Op Fl g
! 1481: .Op Fl t Ar target-window
! 1482: .Xc
! 1483: .D1 (alias: Ic showw )
! 1484: List the window options for
! 1485: .Ar target-window ,
! 1486: or the global window options if
! 1487: .Fl g
! 1488: is used.
! 1489: .El
! 1490: .Sh STATUS LINE
! 1491: .Nm
! 1492: includes an optional status line which is displayed in the bottom line of each
! 1493: terminal.
! 1494: By default, the status line is enabled (it may be disabled with the
! 1495: .Ic status
! 1496: session option) and contains, from left-to-right: the name of the current
! 1497: session in square brackets; the window list; the current window title in double
! 1498: quotes; and the time and date.
! 1499: .Pp
! 1500: The status line is made of three parts: configurable left and right sections
! 1501: (which may contain dynamic content such as the time or output from a shell
! 1502: command, see the
! 1503: .Ic status-left ,
! 1504: .Ic status-left-length ,
! 1505: .Ic status-right ,
! 1506: and
! 1507: .Ic status-right-length
! 1508: options below), and a central window list.
! 1509: The window list shows the index, name and (if any) flag of the windows
! 1510: present in the current session in ascending numerical order.
! 1511: The flag is one of the following symbols appended to the window name:
! 1512: .Bl -column "Symbol" "Meaning" -offset indent
! 1513: .It Sy "Symbol" Ta Sy "Meaning"
! 1514: .It Li "*" Ta "Denotes the current window."
! 1515: .It Li "-" Ta "Marks the last window (previously selected)."
! 1516: .It Li "#" Ta "Window is monitored and activity has been detected."
! 1517: .It Li "!" Ta "A bell has occurred in the window."
! 1518: .It Li "+" Ta "Window is monitored for content and it has appeared."
! 1519: .El
! 1520: .Pp
! 1521: The # symbol relates to the
! 1522: .Ic monitor-activity
! 1523: and + to the
! 1524: .Ic monitor-content
! 1525: window options.
! 1526: The window name is printed in inverted colours if an alert (bell, activity or
! 1527: content) is present.
! 1528: .Pp
! 1529: The colour and attributes of the status line may be configured, the entire status line using
! 1530: the
! 1531: .Ic status-attr ,
! 1532: .Ic status-fg
! 1533: and
! 1534: .Ic status-bg
! 1535: session options and individual windows using the
! 1536: .Ic window-status-attr ,
! 1537: .Ic window-status-fg
! 1538: and
! 1539: .Ic window-status-bg
! 1540: window options.
! 1541: .Pp
! 1542: The status line is automatically refreshed at interval if it has changed, the interval may be
! 1543: controlled with the
! 1544: .Ic status-interval
! 1545: session option.
! 1546: .Pp
! 1547: Commands related to the status line are as follows:
! 1548: .Bl -tag -width Ds
! 1549: .It Xo Ic command-prompt
! 1550: .Op Fl t Ar target-client
! 1551: .Op Ar template
! 1552: .Xc
! 1553: Open the command prompt in a client.
! 1554: This may be used from inside
! 1555: .Nm
! 1556: to execute commands interactively.
! 1557: If
! 1558: .Ar template
! 1559: is specified, it is used as the command; any %% in the template will be
! 1560: replaced by what is entered at the prompt.
! 1561: .It Xo Ic confirm-before
! 1562: .Op Fl t Ar target-client
! 1563: .Ar command
! 1564: .Xc
! 1565: .D1 (alias: Ic confirm )
! 1566: Ask for confirmation before executing
! 1567: .Ar command .
! 1568: This command works only from inside
! 1569: .Nm .
! 1570: .It Xo Ic display-message
! 1571: .Op Fl t Ar target-client
! 1572: .Op Ar message
! 1573: .Xc
! 1574: .D1 (alias: Ic display )
! 1575: Display a message (see the
! 1576: .Ic status-left
! 1577: option below)
! 1578: in the status line.
! 1579: .It Ic select-prompt Op Fl t Ar target-client
! 1580: Open a prompt inside
! 1581: .Ar target-client
! 1582: allowing a window index to be entered interactively.
! 1583: .El
! 1584: .Sh BUFFERS
! 1585: .Nm
! 1586: maintains a stack of
! 1587: .Em paste buffers
! 1588: for each session.
! 1589: Up to the value of the
! 1590: .Ic buffer-limit
! 1591: option are kept; when a new buffer is added, the buffer at the bottom of the
! 1592: stack is removed.
! 1593: Buffers may be added using
! 1594: .Ic copy-mode
! 1595: or the
! 1596: .Ic set-buffer
! 1597: command, and pasted into a window using the
! 1598: .Ic paste-buffer
! 1599: command.
! 1600: .Pp
! 1601: A configurable history buffer is also maintained for each window.
! 1602: By default, up to 2000 lines are kept; this can be altered with the
! 1603: .Ic history-limit
! 1604: option (see the
! 1605: .Ic set-option
! 1606: command above).
! 1607: .Pp
! 1608: The buffer commands are as follows:
! 1609: .Bl -tag -width Ds
! 1610: .It Ic clear-history Op Fl t Ar target-pane
! 1611: .D1 (alias: Ic clearhist )
! 1612: Remove and free the history for the specified pane.
! 1613: .It Xo Ic copy-buffer
! 1614: .Op Fl a Ar src-index
! 1615: .Op Fl b Ar dst-index
! 1616: .Op Fl s Ar src-session
! 1617: .Op Fl t Ar dst-session
! 1618: .Xc
! 1619: .D1 (alias: Ic copyb )
! 1620: Copy a session paste buffer to another session.
! 1621: If no sessions are specified, the current one is used instead.
! 1622: .It Xo Ic delete-buffer
! 1623: .Op Fl b Ar buffer-index
! 1624: .Op Fl t Ar target-session
! 1625: .Xc
! 1626: .D1 (alias: Ic deleteb )
! 1627: Delete the buffer at
! 1628: .Ar buffer-index ,
! 1629: or the top buffer if not specified.
! 1630: .It Ic list-buffers Op Fl t Ar target-session
! 1631: .D1 (alias: Ic lsb )
! 1632: List the buffers in the given session.
! 1633: .It Xo Ic load-buffer
! 1634: .Op Fl b Ar buffer-index
! 1635: .Op Fl t Ar target-session
! 1636: .Ar path
! 1637: .Xc
! 1638: .D1 (alias: Ic loadb )
! 1639: Load the contents of the specified paste buffer from
! 1640: .Ar path .
! 1641: .It Xo Ic paste-buffer
! 1642: .Op Fl dr
! 1643: .Op Fl b Ar buffer-index
! 1644: .Op Fl t Ar target-window
! 1645: .Xc
! 1646: .D1 (alias: Ic pasteb )
! 1647: Insert the contents of a paste buffer into the current window.
! 1648: With
! 1649: .Fl d ,
! 1650: also delete the paste buffer from the stack.
! 1651: When output, any linefeed (LF) characters in the paste buffer are replaced with
! 1652: carriage returns (CR).
! 1653: This translation may be disabled with the
! 1654: .Fl r
! 1655: flag.
! 1656: .It Xo Ic save-buffer
! 1657: .Op Fl a
! 1658: .Op Fl b Ar buffer-index
! 1659: .Op Fl t Ar target-session
! 1660: .Ar path
! 1661: .Xc
! 1662: .D1 (alias: Ic saveb )
! 1663: Save the contents of the specified paste buffer to
! 1664: .Ar path .
! 1665: The
! 1666: .Fl a
! 1667: option appends to rather than overwriting the file.
! 1668: .It Xo Ic set-buffer
! 1669: .Op Fl b Ar buffer-index
! 1670: .Op Fl t Ar target-session
! 1671: .Ar data
! 1672: .Xc
! 1673: .D1 (alias: Ic setb )
! 1674: Set the contents of the specified buffer to
! 1675: .Ar data .
1.1 nicm 1676: .It Xo Ic show-buffer
1677: .Op Fl b Ar buffer-index
1678: .Op Fl t Ar target-session
1679: .Xc
1680: .D1 (alias: Ic showb )
1681: Display the contents of the specified buffer.
1.57 ! jmc 1682: .El
! 1683: .Sh MISCELLANEOUS
! 1684: .Pp
! 1685: Miscellaneous commands are as follows:
! 1686: .Bl -tag -width Ds
! 1687: .It Ic clock-mode Op Fl t Ar target-window
! 1688: Display a large clock.
! 1689: .It Ic if-shell Ar shell-command command
! 1690: .D1 (alias: Ic if )
! 1691: Execute
! 1692: .Ar command
! 1693: if
! 1694: .Ar shell-command
! 1695: returns success.
! 1696: .It Ic lock-server
! 1697: .D1 (alias: Ic lock )
! 1698: Lock the server until a password is entered.
! 1699: .It Ic server-info
! 1700: .D1 (alias: Ic info )
! 1701: Show server information and terminal details.
! 1702: .It Xo Ic set-password
! 1703: .Op Fl c
! 1704: .Ar password
1.1 nicm 1705: .Xc
1.57 ! jmc 1706: .D1 (alias: Ic pass )
! 1707: Set the server password.
! 1708: If the
1.49 nicm 1709: .Fl c
1.57 ! jmc 1710: option is given, a pre-encrypted password may be specified.
! 1711: By default, the password is blank, thus any entered password will be accepted
! 1712: when unlocking the server (see the
! 1713: .Ic lock-server
! 1714: command).
! 1715: To prevent variable expansion when an encrypted password is read from a
! 1716: configuration file, enclose it in single quotes (').
1.1 nicm 1717: .El
1718: .Sh FILES
1.26 nicm 1719: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 1720: .It Pa ~/.tmux.conf
1.6 jmc 1721: Default
1.1 nicm 1722: .Nm
1.6 jmc 1723: configuration file.
1.26 nicm 1724: .It Pa /etc/tmux.conf
1725: System-wide configuration file.
1.1 nicm 1726: .El
1.57 ! jmc 1727: .Sh EXAMPLES
! 1728: To create a new
! 1729: .Nm
! 1730: session running
! 1731: .Xr vi 1 :
! 1732: .Pp
! 1733: .Dl $ tmux new-session vi
! 1734: .Pp
! 1735: Most commands have a shorter form, known as an alias.
! 1736: For new-session, this is
! 1737: .Ic new :
! 1738: .Pp
! 1739: .Dl $ tmux new vi
! 1740: .Pp
! 1741: Alternatively, the shortest unambiguous form of a command is accepted.
! 1742: If there are several options, they are listed:
! 1743: .Bd -literal -offset indent
! 1744: $ tmux n
! 1745: ambiguous command: n, could be: new-session, new-window, next-window
! 1746: .Ed
! 1747: .Pp
! 1748: Within an active session, a new window may be created by typing
! 1749: .Ql C-b c
! 1750: (Ctrl
! 1751: followed by the
! 1752: .Ql b
! 1753: key
! 1754: followed by the
! 1755: .Ql c
! 1756: key).
! 1757: .Pp
! 1758: Windows may be navigated with:
! 1759: .Ql C-b 0
! 1760: (to select window 0),
! 1761: .Ql C-b 1
! 1762: (to select window 1), and so on;
! 1763: .Ql C-b n
! 1764: to select the next window; and
! 1765: .Ql C-b p
! 1766: to select the previous window.
! 1767: .Pp
! 1768: A session may be detached using
! 1769: .Ql C-b d
! 1770: and reattached with:
! 1771: .Pp
! 1772: .Dl $ tmux attach-session
! 1773: .Pp
! 1774: Typing
! 1775: .Ql C-b \&?
! 1776: lists the current key bindings in the current window; up and down may be used
! 1777: to navigate the list or
! 1778: .Ql q
! 1779: to exit from it.
! 1780: .Pp
! 1781: Commands to be run when the
! 1782: .Nm
! 1783: server is started may be placed in the
! 1784: .Pa ~/.tmux.conf
! 1785: configuration file.
! 1786: Common examples include:
! 1787: .Pp
! 1788: Changing the default prefix key:
! 1789: .Bd -literal -offset indent
! 1790: set-option -g prefix C-a
! 1791: unbind-key C-b
! 1792: bind-key C-a send-prefix
! 1793: .Ed
! 1794: .Pp
! 1795: Turning the status line off, or changing its colour:
! 1796: .Bd -literal -offset indent
! 1797: set-option -g status off
! 1798: set-option -g status-bg blue
! 1799: .Ed
! 1800: .Pp
! 1801: Setting other options, such as the default command,
! 1802: or locking after 30 minutes of inactivity:
! 1803: .Bd -literal -offset indent
! 1804: set-option -g default-command "exec /bin/ksh"
! 1805: set-option -g lock-after-time 1800
! 1806: .Ed
! 1807: .Pp
! 1808: Creating new key bindings:
! 1809: .Bd -literal -offset indent
! 1810: bind-key b set-option status
! 1811: bind-key / command-prompt "split-window 'exec man %%'"
! 1812: .Ed
1.1 nicm 1813: .Sh SEE ALSO
1814: .Xr pty 4
1815: .Sh AUTHORS
1816: .An Nicholas Marriott Aq nicm@users.sourceforge.net