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