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