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