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