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