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