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