Annotation of src/usr.bin/tmux/tmux.1, Revision 1.61
1.61 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.60 2009/08/07 12:24:16 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.61 ! nicm 17: .Dd $Mdocdate: August 7 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.1 nicm 1241: .It Ic status-left-length Ar length
1242: Set the maximum
1243: .Ar length
1244: of the left component of the status bar.
1245: The default is 10.
1246: .It Ic status-right Ar string
1247: Display
1248: .Ar string
1249: to the right of the status bar.
1250: By default, the date and time will be shown.
1251: As with
1252: .Ic status-left ,
1253: .Ar string
1254: will be passed to
1.10 nicm 1255: .Xr strftime 3 ,
1256: character pairs are replaced, and UTF-8 is dependent on the
1257: .Ic status-utf8
1258: option.
1.1 nicm 1259: .It Ic status-right-length Ar length
1260: Set the maximum
1261: .Ar length
1262: of the right component of the status bar.
1263: The default is 40.
1.10 nicm 1264: .Pp
1265: .It Xo Ic status-utf8
1.56 jmc 1266: .Op Ic on | off
1.10 nicm 1267: .Xc
1268: Instruct
1269: .Nm
1270: to treat top-bit-set characters in the
1271: .Ic status-left
1272: and
1273: .Ic status-right
1274: strings as UTF-8; notably, this is important for wide characters.
1275: This option defaults to off.
1.55 jmc 1276: .It Ic terminal-overrides Ar string
1.54 nicm 1277: Contains a list of entries which override terminal descriptions read using
1278: .Xr terminfo 5 .
1279: .Ar string
1280: is a comma-separated list of items each a colon-separated string made up of a
1281: terminal type pattern (matched using
1282: .Xr fnmatch 3 )
1283: and a set of
1284: .Em name=value
1285: entries.
1286: .Pp
1287: For example, to set the
1288: .Ql clear
1289: .Xr terminfo 5
1290: entry to
1291: .Ql \ee[H\ee[2J
1292: for all terminal types and the
1293: .Ql dch1
1294: entry to
1295: .Ql \ee[P
1.55 jmc 1296: for the
1.54 nicm 1297: .Ql rxvt
1298: terminal type, the option could be set to the string:
1299: .Bd -literal -offset indent
1300: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
1301: .Ed
1302: .Pp
1303: The terminal entry value is passed through
1304: .Xr strunvis 3
1305: before interpretation.
1306: The default value forcibly corrects the
1307: .Ql colors
1308: entry for terminals which support 88 or 256 colours:
1309: .Bd -literal -offset indent
1310: "*88col*:colors=88,*256col*:colors=256"
1311: .Ed
1.37 nicm 1312: .It Xo Ic visual-activity
1.56 jmc 1313: .Op Ic on | off
1.37 nicm 1314: .Xc
1315: If on, display a status line message when activity occurs in a window
1.39 jmc 1316: for which the
1.37 nicm 1317: .Ic monitor-activity
1318: window option is enabled.
1319: .It Xo Ic visual-bell
1.56 jmc 1320: .Op Ic on | off
1.37 nicm 1321: .Xc
1322: If this option is on, a message is shown on a bell instead of it being passed
1323: through to the terminal (which normally makes a sound).
1324: Also see the
1325: .Ic bell-action
1326: option.
1327: .It Xo Ic visual-content
1.56 jmc 1328: .Op Ic on | off
1.37 nicm 1329: .Xc
1330: Like
1331: .Ic visual-activity ,
1332: display a message when content is present in a window
1.39 jmc 1333: for which the
1.37 nicm 1334: .Ic monitor-content
1335: window option is enabled.
1.1 nicm 1336: .El
1337: .It Xo Ic set-window-option
1.58 nicm 1338: .Op Fl agu
1.1 nicm 1339: .Op Fl t Ar target-window
1340: .Ar option Ar value
1341: .Xc
1342: .D1 (alias: Ic setw )
1.18 nicm 1343: Set a window option.
1.1 nicm 1344: The
1.58 nicm 1345: .Fl a ,
1.1 nicm 1346: .Fl g
1347: and
1348: .Fl u
1349: flags work similarly to the
1350: .Ic set-option
1351: command.
1352: .Pp
1.18 nicm 1353: Supported window options are:
1.56 jmc 1354: .Pp
1355: .Bl -tag -width Ds -compact
1.1 nicm 1356: .It Xo Ic aggressive-resize
1.56 jmc 1357: .Op Ic on | off
1.1 nicm 1358: .Xc
1359: Aggressively resize the chosen window.
1360: This means that
1361: .Nm
1362: will resize the window to the size of the smallest session for which it is the
1363: current window, rather than the smallest session to which it is attached.
1364: The window may resize when the current window is changed on another sessions;
1.6 jmc 1365: this option is good for full-screen programs which support
1366: .Dv SIGWINCH
1367: and poor for interactive programs such as shells.
1.56 jmc 1368: .Pp
1.1 nicm 1369: .It Xo Ic automatic-rename
1.56 jmc 1370: .Op Ic on | off
1.1 nicm 1371: .Xc
1372: Control automatic window renaming.
1373: When this setting is enabled,
1374: .Nm
1375: will attempt - on supported platforms - to rename the window to reflect the
1376: command currently running in it.
1377: This flag is automatically disabled for an individual window when a name
1378: is specified at creation with
1379: .Ic new-window or
1380: .Ic new-session ,
1381: or later with
1382: .Ic rename-window .
1383: It may be switched off globally with:
1384: .Bd -literal -offset indent
1385: set-window-option -g automatic-rename off
1386: .Ed
1.56 jmc 1387: .Pp
1.1 nicm 1388: .It Ic clock-mode-colour Ar colour
1389: Set clock colour.
1.56 jmc 1390: .Pp
1.1 nicm 1391: .It Xo Ic clock-mode-style
1.56 jmc 1392: .Op Ic 12 | 24
1.1 nicm 1393: .Xc
1394: Set clock hour format.
1.56 jmc 1395: .Pp
1.1 nicm 1396: .It Ic force-height Ar height
1397: .It Ic force-width Ar width
1398: Prevent
1399: .Nm
1400: from resizing a window to greater than
1401: .Ar width
1402: or
1403: .Ar height .
1404: A value of zero restores the default unlimited setting.
1.56 jmc 1405: .Pp
1.2 nicm 1406: .It Ic main-pane-width Ar width
1407: .It Ic main-pane-height Ar height
1408: Set the width or height of the main (left or top) pane in the
1409: .Ic main-horizontal
1410: or
1411: .Ic main-vertical
1412: layouts.
1.56 jmc 1413: .Pp
1.1 nicm 1414: .It Ic mode-attr Ar attributes
1415: Set window modes attributes.
1.56 jmc 1416: .Pp
1.1 nicm 1417: .It Ic mode-bg Ar colour
1418: Set window modes background colour.
1.56 jmc 1419: .Pp
1.1 nicm 1420: .It Ic mode-fg Ar colour
1421: Set window modes foreground colour.
1.56 jmc 1422: .Pp
1.1 nicm 1423: .It Xo Ic mode-keys
1.56 jmc 1424: .Op Ic vi | emacs
1.1 nicm 1425: .Xc
1.50 nicm 1426: Use vi or emacs-style key bindings in scroll, copy and choice modes.
1.1 nicm 1427: Key bindings default to emacs.
1.56 jmc 1428: .Pp
1.50 nicm 1429: .It Xo Ic mode-mouse
1.56 jmc 1430: .Op Ic on | off
1.50 nicm 1431: .Xc
1.51 jmc 1432: Mouse state in modes.
1433: If on,
1.50 nicm 1434: .Nm
1435: will respond to mouse clicks by moving the cursor in copy mode or selecting an
1436: option in choice mode.
1.56 jmc 1437: .Pp
1.1 nicm 1438: .It Xo Ic monitor-activity
1.56 jmc 1439: .Op Ic on | off
1.1 nicm 1440: .Xc
1441: Monitor for activity in the window.
1442: Windows with activity are highlighted in the status line.
1.56 jmc 1443: .Pp
1444: .It Ic monitor-content Ar match-string
1.6 jmc 1445: Monitor content in the window.
1446: When
1.16 nicm 1447: .Xr fnmatch 3
1448: pattern
1.1 nicm 1449: .Ar match-string
1450: appears in the window, it is highlighted in the status line.
1.56 jmc 1451: .Pp
1.1 nicm 1452: .It Xo Ic remain-on-exit
1.56 jmc 1453: .Op Ic on | off
1.1 nicm 1454: .Xc
1455: A window with this flag set is not destroyed when the program running in it
1456: exits.
1457: The window may be reactivated with the
1458: .Ic respawn-window
1459: command.
1.56 jmc 1460: .Pp
1.1 nicm 1461: .It Xo Ic utf8
1.56 jmc 1462: .Op Ic on | off
1.1 nicm 1463: .Xc
1464: Instructs
1465: .Nm
1466: to expect UTF-8 sequences to appear in this window.
1.56 jmc 1467: .Pp
1.1 nicm 1468: .It Ic window-status-attr Ar attributes
1469: Set status line attributes for a single window.
1.56 jmc 1470: .Pp
1.1 nicm 1471: .It Ic window-status-bg Ar colour
1472: Set status line background colour for a single window.
1.56 jmc 1473: .Pp
1.1 nicm 1474: .It Ic window-status-fg Ar colour
1475: Set status line foreground colour for a single window.
1.56 jmc 1476: .Pp
1.40 nicm 1477: .It Ic window-status-current-attr Ar attributes
1478: Set status line attributes for the currently active window.
1.56 jmc 1479: .Pp
1.40 nicm 1480: .It Ic window-status-current-bg Ar colour
1481: Set status line background colour for the currently active window.
1.56 jmc 1482: .Pp
1.40 nicm 1483: .It Ic window-status-current-fg Ar colour
1484: Set status line foreground colour for the currently active window.
1.56 jmc 1485: .Pp
1.1 nicm 1486: .It Xo Ic xterm-keys
1.56 jmc 1487: .Op Ic on | off
1.1 nicm 1488: .Xc
1489: If this option is set,
1490: .Nm
1491: will generate
1.57 jmc 1492: .Xr xterm 1 -style
1493: function key sequences; these have a number included to indicate modifiers such
1494: as Shift, Alt or Ctrl.
1495: .El
1496: .It Xo Ic show-options
1497: .Op Fl g
1498: .Op Fl t Ar target-session
1499: .Xc
1500: .D1 (alias: Ic show )
1501: Show the session options for
1502: .Ar target session ,
1503: or the global session options with
1504: .Fl g .
1505: .It Xo Ic show-window-options
1506: .Op Fl g
1507: .Op Fl t Ar target-window
1508: .Xc
1509: .D1 (alias: Ic showw )
1510: List the window options for
1511: .Ar target-window ,
1512: or the global window options if
1513: .Fl g
1514: is used.
1515: .El
1516: .Sh STATUS LINE
1517: .Nm
1518: includes an optional status line which is displayed in the bottom line of each
1519: terminal.
1520: By default, the status line is enabled (it may be disabled with the
1521: .Ic status
1522: session option) and contains, from left-to-right: the name of the current
1523: session in square brackets; the window list; the current window title in double
1524: quotes; and the time and date.
1525: .Pp
1526: The status line is made of three parts: configurable left and right sections
1527: (which may contain dynamic content such as the time or output from a shell
1528: command, see the
1529: .Ic status-left ,
1530: .Ic status-left-length ,
1531: .Ic status-right ,
1532: and
1533: .Ic status-right-length
1534: options below), and a central window list.
1535: The window list shows the index, name and (if any) flag of the windows
1536: present in the current session in ascending numerical order.
1537: The flag is one of the following symbols appended to the window name:
1538: .Bl -column "Symbol" "Meaning" -offset indent
1539: .It Sy "Symbol" Ta Sy "Meaning"
1540: .It Li "*" Ta "Denotes the current window."
1541: .It Li "-" Ta "Marks the last window (previously selected)."
1542: .It Li "#" Ta "Window is monitored and activity has been detected."
1543: .It Li "!" Ta "A bell has occurred in the window."
1544: .It Li "+" Ta "Window is monitored for content and it has appeared."
1545: .El
1546: .Pp
1547: The # symbol relates to the
1548: .Ic monitor-activity
1549: and + to the
1550: .Ic monitor-content
1551: window options.
1552: The window name is printed in inverted colours if an alert (bell, activity or
1553: content) is present.
1554: .Pp
1555: The colour and attributes of the status line may be configured, the entire status line using
1556: the
1557: .Ic status-attr ,
1558: .Ic status-fg
1559: and
1560: .Ic status-bg
1561: session options and individual windows using the
1562: .Ic window-status-attr ,
1563: .Ic window-status-fg
1564: and
1565: .Ic window-status-bg
1566: window options.
1567: .Pp
1568: The status line is automatically refreshed at interval if it has changed, the interval may be
1569: controlled with the
1570: .Ic status-interval
1571: session option.
1572: .Pp
1573: Commands related to the status line are as follows:
1574: .Bl -tag -width Ds
1575: .It Xo Ic command-prompt
1576: .Op Fl t Ar target-client
1577: .Op Ar template
1578: .Xc
1579: Open the command prompt in a client.
1580: This may be used from inside
1581: .Nm
1582: to execute commands interactively.
1583: If
1584: .Ar template
1585: is specified, it is used as the command; any %% in the template will be
1586: replaced by what is entered at the prompt.
1587: .It Xo Ic confirm-before
1588: .Op Fl t Ar target-client
1589: .Ar command
1590: .Xc
1591: .D1 (alias: Ic confirm )
1592: Ask for confirmation before executing
1593: .Ar command .
1594: This command works only from inside
1595: .Nm .
1596: .It Xo Ic display-message
1597: .Op Fl t Ar target-client
1598: .Op Ar message
1599: .Xc
1600: .D1 (alias: Ic display )
1601: Display a message (see the
1602: .Ic status-left
1603: option below)
1604: in the status line.
1605: .It Ic select-prompt Op Fl t Ar target-client
1606: Open a prompt inside
1607: .Ar target-client
1608: allowing a window index to be entered interactively.
1609: .El
1610: .Sh BUFFERS
1611: .Nm
1612: maintains a stack of
1613: .Em paste buffers
1614: for each session.
1615: Up to the value of the
1616: .Ic buffer-limit
1617: option are kept; when a new buffer is added, the buffer at the bottom of the
1618: stack is removed.
1619: Buffers may be added using
1620: .Ic copy-mode
1621: or the
1622: .Ic set-buffer
1623: command, and pasted into a window using the
1624: .Ic paste-buffer
1625: command.
1626: .Pp
1627: A configurable history buffer is also maintained for each window.
1628: By default, up to 2000 lines are kept; this can be altered with the
1629: .Ic history-limit
1630: option (see the
1631: .Ic set-option
1632: command above).
1633: .Pp
1634: The buffer commands are as follows:
1635: .Bl -tag -width Ds
1636: .It Ic clear-history Op Fl t Ar target-pane
1637: .D1 (alias: Ic clearhist )
1638: Remove and free the history for the specified pane.
1639: .It Xo Ic copy-buffer
1640: .Op Fl a Ar src-index
1641: .Op Fl b Ar dst-index
1642: .Op Fl s Ar src-session
1643: .Op Fl t Ar dst-session
1644: .Xc
1645: .D1 (alias: Ic copyb )
1646: Copy a session paste buffer to another session.
1647: If no sessions are specified, the current one is used instead.
1648: .It Xo Ic delete-buffer
1649: .Op Fl b Ar buffer-index
1650: .Op Fl t Ar target-session
1651: .Xc
1652: .D1 (alias: Ic deleteb )
1653: Delete the buffer at
1654: .Ar buffer-index ,
1655: or the top buffer if not specified.
1656: .It Ic list-buffers Op Fl t Ar target-session
1657: .D1 (alias: Ic lsb )
1658: List the buffers in the given session.
1659: .It Xo Ic load-buffer
1660: .Op Fl b Ar buffer-index
1661: .Op Fl t Ar target-session
1662: .Ar path
1663: .Xc
1664: .D1 (alias: Ic loadb )
1665: Load the contents of the specified paste buffer from
1666: .Ar path .
1667: .It Xo Ic paste-buffer
1668: .Op Fl dr
1669: .Op Fl b Ar buffer-index
1670: .Op Fl t Ar target-window
1671: .Xc
1672: .D1 (alias: Ic pasteb )
1673: Insert the contents of a paste buffer into the current window.
1674: With
1675: .Fl d ,
1676: also delete the paste buffer from the stack.
1677: When output, any linefeed (LF) characters in the paste buffer are replaced with
1678: carriage returns (CR).
1679: This translation may be disabled with the
1680: .Fl r
1681: flag.
1682: .It Xo Ic save-buffer
1683: .Op Fl a
1684: .Op Fl b Ar buffer-index
1685: .Op Fl t Ar target-session
1686: .Ar path
1687: .Xc
1688: .D1 (alias: Ic saveb )
1689: Save the contents of the specified paste buffer to
1690: .Ar path .
1691: The
1692: .Fl a
1693: option appends to rather than overwriting the file.
1694: .It Xo Ic set-buffer
1695: .Op Fl b Ar buffer-index
1696: .Op Fl t Ar target-session
1697: .Ar data
1698: .Xc
1699: .D1 (alias: Ic setb )
1700: Set the contents of the specified buffer to
1701: .Ar data .
1.1 nicm 1702: .It Xo Ic show-buffer
1703: .Op Fl b Ar buffer-index
1704: .Op Fl t Ar target-session
1705: .Xc
1706: .D1 (alias: Ic showb )
1707: Display the contents of the specified buffer.
1.57 jmc 1708: .El
1709: .Sh MISCELLANEOUS
1710: .Pp
1711: Miscellaneous commands are as follows:
1712: .Bl -tag -width Ds
1713: .It Ic clock-mode Op Fl t Ar target-window
1714: Display a large clock.
1715: .It Ic if-shell Ar shell-command command
1716: .D1 (alias: Ic if )
1717: Execute
1718: .Ar command
1719: if
1720: .Ar shell-command
1721: returns success.
1722: .It Ic lock-server
1723: .D1 (alias: Ic lock )
1724: Lock the server until a password is entered.
1725: .It Ic server-info
1726: .D1 (alias: Ic info )
1727: Show server information and terminal details.
1728: .It Xo Ic set-password
1729: .Op Fl c
1730: .Ar password
1.1 nicm 1731: .Xc
1.57 jmc 1732: .D1 (alias: Ic pass )
1733: Set the server password.
1734: If the
1.49 nicm 1735: .Fl c
1.57 jmc 1736: option is given, a pre-encrypted password may be specified.
1737: By default, the password is blank, thus any entered password will be accepted
1738: when unlocking the server (see the
1739: .Ic lock-server
1740: command).
1741: To prevent variable expansion when an encrypted password is read from a
1742: configuration file, enclose it in single quotes (').
1.1 nicm 1743: .El
1744: .Sh FILES
1.26 nicm 1745: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 1746: .It Pa ~/.tmux.conf
1.6 jmc 1747: Default
1.1 nicm 1748: .Nm
1.6 jmc 1749: configuration file.
1.26 nicm 1750: .It Pa /etc/tmux.conf
1751: System-wide configuration file.
1.1 nicm 1752: .El
1.57 jmc 1753: .Sh EXAMPLES
1754: To create a new
1755: .Nm
1756: session running
1757: .Xr vi 1 :
1758: .Pp
1759: .Dl $ tmux new-session vi
1760: .Pp
1761: Most commands have a shorter form, known as an alias.
1762: For new-session, this is
1763: .Ic new :
1764: .Pp
1765: .Dl $ tmux new vi
1766: .Pp
1767: Alternatively, the shortest unambiguous form of a command is accepted.
1768: If there are several options, they are listed:
1769: .Bd -literal -offset indent
1770: $ tmux n
1771: ambiguous command: n, could be: new-session, new-window, next-window
1772: .Ed
1773: .Pp
1774: Within an active session, a new window may be created by typing
1775: .Ql C-b c
1776: (Ctrl
1777: followed by the
1778: .Ql b
1779: key
1780: followed by the
1781: .Ql c
1782: key).
1783: .Pp
1784: Windows may be navigated with:
1785: .Ql C-b 0
1786: (to select window 0),
1787: .Ql C-b 1
1788: (to select window 1), and so on;
1789: .Ql C-b n
1790: to select the next window; and
1791: .Ql C-b p
1792: to select the previous window.
1793: .Pp
1794: A session may be detached using
1795: .Ql C-b d
1796: and reattached with:
1797: .Pp
1798: .Dl $ tmux attach-session
1799: .Pp
1800: Typing
1801: .Ql C-b \&?
1802: lists the current key bindings in the current window; up and down may be used
1803: to navigate the list or
1804: .Ql q
1805: to exit from it.
1806: .Pp
1807: Commands to be run when the
1808: .Nm
1809: server is started may be placed in the
1810: .Pa ~/.tmux.conf
1811: configuration file.
1812: Common examples include:
1813: .Pp
1814: Changing the default prefix key:
1815: .Bd -literal -offset indent
1816: set-option -g prefix C-a
1817: unbind-key C-b
1818: bind-key C-a send-prefix
1819: .Ed
1820: .Pp
1821: Turning the status line off, or changing its colour:
1822: .Bd -literal -offset indent
1823: set-option -g status off
1824: set-option -g status-bg blue
1825: .Ed
1826: .Pp
1827: Setting other options, such as the default command,
1828: or locking after 30 minutes of inactivity:
1829: .Bd -literal -offset indent
1830: set-option -g default-command "exec /bin/ksh"
1831: set-option -g lock-after-time 1800
1832: .Ed
1833: .Pp
1834: Creating new key bindings:
1835: .Bd -literal -offset indent
1836: bind-key b set-option status
1837: bind-key / command-prompt "split-window 'exec man %%'"
1838: .Ed
1.1 nicm 1839: .Sh SEE ALSO
1840: .Xr pty 4
1841: .Sh AUTHORS
1842: .An Nicholas Marriott Aq nicm@users.sourceforge.net