Annotation of src/usr.bin/tmux/tmux.1, Revision 1.134
1.134 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.133 2009/12/10 09:16:52 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.134 ! nicm 17: .Dd $Mdocdate: December 10 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
1.134 ! nicm 1291: .It Ic escape-time
! 1292: Set the time in milliseconds for which
! 1293: .Nm
! 1294: waits after an escape is input to determine if it is part of a function or meta
! 1295: key sequences.
! 1296: The default is 500 milliseconds.
1.133 nicm 1297: .It Ic quiet
1.134 ! nicm 1298: Enable or disable the display of various informational messages (see also the
1.133 nicm 1299: .Fl q
1300: command line flag).
1301: .El
1.129 nicm 1302: .Pp
1.18 nicm 1303: Available session options are:
1.1 nicm 1304: .Bl -tag -width Ds
1.69 nicm 1305: .It Ic base-index Ar index
1306: Set the base index from which an unused index should be searched when a new
1307: window is created.
1308: The default is zero.
1.1 nicm 1309: .It Xo Ic bell-action
1.56 jmc 1310: .Op Ic any | none | current
1.1 nicm 1311: .Xc
1312: Set action on window bell.
1313: .Ic any
1314: means a bell in any window linked to a session causes a bell in the current
1315: window of that session,
1316: .Ic none
1317: means all bells are ignored and
1318: .Ic current
1319: means only bell in windows other than the current window are ignored.
1320: .It Ic buffer-limit Ar number
1321: Set the number of buffers kept for each session; as new buffers are added to
1322: the top of the stack, old ones are removed from the bottom if necessary to
1323: maintain this maximum length.
1324: .It Ic default-command Ar command
1325: Set the command used for new windows (if not specified when the window is
1326: created) to
1.79 nicm 1327: .Ar command ,
1328: which may be any
1329: .Xr sh 1
1330: command.
1.19 nicm 1331: The default is an empty string, which instructs
1332: .Nm
1.79 nicm 1333: to create a login shell using the value of the
1334: .Ic default-shell
1335: option.
1336: .It Ic default-shell Ar path
1337: Specify the default shell.
1338: This is used as the login shell for new windows when the
1339: .Ic default-command
1340: option is set to empty, and must be the full path of the executable.
1341: When started
1342: .Nm
1343: tries to set a default value from the first suitable of the
1.19 nicm 1344: .Ev SHELL
1.79 nicm 1345: environment variable, the shell returned by
1346: .Xr getpwuid 3 ,
1347: or
1348: .Pa /bin/sh .
1349: This option should be configured when
1350: .Nm
1351: is used as a login shell.
1.1 nicm 1352: .It Ic default-path Ar path
1353: Set the default working directory for processes created from keys, or
1354: interactively from the prompt.
1355: The default is the current working directory when the server is started.
1.22 nicm 1356: .It Ic default-terminal Ar terminal
1357: Set the default terminal for new windows created in this session - the
1358: default value of the
1359: .Ev TERM
1360: environment variable.
1361: For
1362: .Nm
1363: to work correctly, this
1364: .Em must
1365: be set to
1366: .Ql screen
1367: or a derivative of it.
1.78 nicm 1368: .It Ic display-panes-colour Ar colour
1369: Set the colour used for the
1370: .Ic display-panes
1371: command.
1372: .It Ic display-panes-time Ar time
1373: Set the time in milliseconds for which the indicators shown by the
1374: .Ic display-panes
1375: command appear.
1.21 nicm 1376: .It Ic display-time Ar time
1.78 nicm 1377: Set the amount of time for which status line messages and other on-screen
1378: indicators are displayed.
1.21 nicm 1379: .Ar time
1380: is in milliseconds.
1.1 nicm 1381: .It Ic history-limit Ar lines
1382: Set the maximum number of lines held in window history.
1383: This setting applies only to new windows - existing window histories are not
1384: resized and retain the limit at the point they were created.
1385: .It Ic lock-after-time Ar number
1.100 nicm 1386: Lock the session (like the
1387: .Ic lock-session
1.90 nicm 1388: command) after
1.1 nicm 1389: .Ar number
1.100 nicm 1390: seconds of inactivity, or the entire server (all sessions) if the
1391: .Ic lock-server
1392: option is set.
1393: The default is not to lock (set to 0).
1.90 nicm 1394: .It Ic lock-command Ar command
1395: Command to run when locking each client.
1396: The default is to run
1397: .Xr lock 1
1398: with
1399: .Fl np .
1.100 nicm 1400: .It Xo Ic lock-server
1401: .Op Ic on | off
1402: .Xc
1403: If this option is
1.102 nicm 1404: .Ic on
1.100 nicm 1405: (the default),
1406: instead of each session locking individually as each has been
1407: idle for
1.108 jmc 1408: .Ic lock-after-time ,
1409: the entire server will lock after
1.100 nicm 1410: .Em all
1411: sessions would have locked.
1412: This has no effect as a session option; it must be set as a global option.
1.1 nicm 1413: .It Ic message-attr Ar attributes
1414: Set status line message attributes, where
1415: .Ar attributes
1416: is either
1417: .Ic default
1418: or a comma-delimited list of one or more of:
1419: .Ic bright
1420: (or
1421: .Ic bold ) ,
1422: .Ic dim ,
1423: .Ic underscore ,
1424: .Ic blink ,
1425: .Ic reverse ,
1426: .Ic hidden ,
1427: or
1428: .Ic italics .
1429: .It Ic message-bg Ar colour
1430: Set status line message background colour, where
1431: .Ar colour
1432: is one of:
1433: .Ic black ,
1434: .Ic red ,
1435: .Ic green ,
1436: .Ic yellow ,
1437: .Ic blue ,
1438: .Ic magenta ,
1439: .Ic cyan ,
1.85 nicm 1440: .Ic white ,
1441: .Ic colour0
1442: to
1443: .Ic colour255
1444: from the 256-colour palette, or
1.1 nicm 1445: .Ic default .
1446: .It Ic message-fg Ar colour
1447: Set status line message foreground colour.
1.120 nicm 1448: .It Ic message-limit Ar number
1449: Set the number of error or information messages to save in the message log for
1450: each client.
1451: The default is 20.
1.102 nicm 1452: .It Xo Ic mouse-select-pane
1453: .Op Ic on | off
1454: .Xc
1455: If on,
1456: .Nm
1457: captures the mouse and when a window is split into multiple panes the mouse may
1458: be used to select the current pane.
1459: The mouse click is also passed through to the application as normal.
1.89 nicm 1460: .It Ic prefix Ar keys
1461: Set the keys accepted as a prefix key.
1462: .Ar keys
1463: is a comma-separated list of key names, each of which individually behave as
1464: the prefix key.
1.21 nicm 1465: .It Ic repeat-time Ar time
1.1 nicm 1466: Allow multiple commands to be entered without pressing the prefix-key again
1467: in the specified
1.21 nicm 1468: .Ar time
1.1 nicm 1469: milliseconds (the default is 500).
1470: Whether a key repeats may be set when it is bound using the
1471: .Fl r
1472: flag to
1473: .Ic bind-key .
1.52 nicm 1474: Repeat is enabled for the default keys bound to the
1475: .Ic resize-pane
1476: command.
1.1 nicm 1477: .It Xo Ic set-remain-on-exit
1.56 jmc 1478: .Op Ic on | off
1.1 nicm 1479: .Xc
1480: Set the
1481: .Ic remain-on-exit
1482: window option for any windows first created in this session.
1483: .It Xo Ic set-titles
1.56 jmc 1484: .Op Ic on | off
1.1 nicm 1485: .Xc
1.77 stsp 1486: Attempt to set the window title using the \ee]2;...\e007 xterm code if
1.1 nicm 1487: the terminal appears to be an xterm.
1.11 nicm 1488: This option is off by default.
1.6 jmc 1489: Note that elinks
1.1 nicm 1490: will only attempt to set the window title if the STY environment
1491: variable is set.
1.86 nicm 1492: .It Ic set-titles-string Ar string
1493: String used to set the window title if
1494: .Ic set-titles
1495: is on.
1496: Character sequences are replaced as for the
1497: .Ic status-left
1498: option.
1.1 nicm 1499: .It Xo Ic status
1.56 jmc 1500: .Op Ic on | off
1.1 nicm 1501: .Xc
1502: Show or hide the status line.
1503: .It Ic status-attr Ar attributes
1504: Set status line attributes.
1505: .It Ic status-bg Ar colour
1506: Set status line background colour.
1507: .It Ic status-fg Ar colour
1508: Set status line foreground colour.
1509: .It Ic status-interval Ar interval
1510: Update the status bar every
1511: .Ar interval
1512: seconds.
1513: By default, updates will occur every 15 seconds.
1514: A setting of zero disables redrawing at interval.
1.41 nicm 1515: .It Xo Ic status-justify
1.56 jmc 1516: .Op Ic left | centre | right
1.41 nicm 1517: .Xc
1518: Set the position of the window list component of the status line: left, centre
1519: or right justified.
1.1 nicm 1520: .It Xo Ic status-keys
1.56 jmc 1521: .Op Ic vi | emacs
1.1 nicm 1522: .Xc
1.6 jmc 1523: Use vi or emacs-style
1.1 nicm 1524: key bindings in the status line, for example at the command prompt.
1525: Defaults to emacs.
1526: .It Ic status-left Ar string
1527: Display
1528: .Ar string
1529: to the left of the status bar.
1530: .Ar string
1531: will be passed through
1532: .Xr strftime 3
1533: before being used.
1534: By default, the session name is shown.
1535: .Ar string
1.83 nicm 1536: may contain any of the following special character sequences:
1.1 nicm 1537: .Bl -column "Character pair" "Replaced with" -offset indent
1538: .It Sy "Character pair" Ta Sy "Replaced with"
1539: .It Li "#(command)" Ta "First line of command's output"
1.83 nicm 1540: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1 nicm 1541: .It Li "#H" Ta "Hostname of local host"
1.125 nicm 1542: .It Li "#F" Ta "Current window flag"
1.35 nicm 1543: .It Li "#I" Ta "Current window index"
1544: .It Li "#P" Ta "Current pane index"
1.1 nicm 1545: .It Li "#S" Ta "Session name"
1546: .It Li "#T" Ta "Current window title"
1.35 nicm 1547: .It Li "#W" Ta "Current window name"
1.1 nicm 1548: .It Li "##" Ta "A literal" Ql #
1549: .El
1.83 nicm 1550: .Pp
1551: The #(command) form executes
1552: .Ql command
1553: as a shell command and inserts the first line of its output.
1.103 nicm 1554: Note that shell commands are only executed once at the interval specified by
1555: the
1556: .Ic status-interval
1557: option: if the status line is redrawn in the meantime, the previous result is
1558: used.
1.109 nicm 1559: .Pp
1.83 nicm 1560: #[attributes] allows a comma-separated list of attributes to be specified,
1561: these may be
1562: .Ql fg=colour
1563: to set the foreground colour,
1564: .Ql bg=colour
1.131 nicm 1565: to set the background colour, the name of one of the attributes (listed under
1566: the
1.83 nicm 1567: .Ic message-attr
1.109 nicm 1568: option) to turn an attribute on, or an attribute prefixed with
1569: .Ql no
1570: to turn one off, for example
1571: .Ic nobright .
1.83 nicm 1572: Examples are:
1573: .Bd -literal -offset indent
1574: #(sysctl vm.loadavg)
1575: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
1576: .Ed
1.1 nicm 1577: .Pp
1.109 nicm 1578: Where appropriate, special character sequences may be prefixed with a number to
1579: specify the maximum length, for example
1.1 nicm 1580: .Ql #24T .
1.10 nicm 1581: .Pp
1.12 jmc 1582: By default, UTF-8 in
1.10 nicm 1583: .Ar string
1584: is not interpreted, to enable UTF-8, use the
1585: .Ic status-utf8
1586: option.
1.62 nicm 1587: .It Ic status-left-attr Ar attributes
1.66 jmc 1588: Set the attribute of the left part of the status line.
1.62 nicm 1589: .It Ic status-left-fg Ar colour
1590: Set the foreground colour of the left part of the status line.
1591: .It Ic status-left-bg Ar colour
1592: Set the background colour of the left part of the status line.
1.1 nicm 1593: .It Ic status-left-length Ar length
1594: Set the maximum
1595: .Ar length
1596: of the left component of the status bar.
1597: The default is 10.
1598: .It Ic status-right Ar string
1599: Display
1600: .Ar string
1601: to the right of the status bar.
1602: By default, the date and time will be shown.
1603: As with
1604: .Ic status-left ,
1605: .Ar string
1606: will be passed to
1.10 nicm 1607: .Xr strftime 3 ,
1608: character pairs are replaced, and UTF-8 is dependent on the
1609: .Ic status-utf8
1610: option.
1.62 nicm 1611: .It Ic status-right-attr Ar attributes
1.66 jmc 1612: Set the attribute of the right part of the status line.
1.62 nicm 1613: .It Ic status-right-fg Ar colour
1614: Set the foreground colour of the right part of the status line.
1615: .It Ic status-right-bg Ar colour
1616: Set the background colour of the right part of the status line.
1.1 nicm 1617: .It Ic status-right-length Ar length
1618: Set the maximum
1619: .Ar length
1620: of the right component of the status bar.
1621: The default is 40.
1.10 nicm 1622: .Pp
1623: .It Xo Ic status-utf8
1.56 jmc 1624: .Op Ic on | off
1.10 nicm 1625: .Xc
1626: Instruct
1627: .Nm
1628: to treat top-bit-set characters in the
1629: .Ic status-left
1630: and
1631: .Ic status-right
1632: strings as UTF-8; notably, this is important for wide characters.
1633: This option defaults to off.
1.55 jmc 1634: .It Ic terminal-overrides Ar string
1.54 nicm 1635: Contains a list of entries which override terminal descriptions read using
1636: .Xr terminfo 5 .
1637: .Ar string
1638: is a comma-separated list of items each a colon-separated string made up of a
1639: terminal type pattern (matched using
1640: .Xr fnmatch 3 )
1641: and a set of
1642: .Em name=value
1643: entries.
1644: .Pp
1645: For example, to set the
1646: .Ql clear
1647: .Xr terminfo 5
1648: entry to
1649: .Ql \ee[H\ee[2J
1650: for all terminal types and the
1651: .Ql dch1
1652: entry to
1653: .Ql \ee[P
1.55 jmc 1654: for the
1.54 nicm 1655: .Ql rxvt
1656: terminal type, the option could be set to the string:
1657: .Bd -literal -offset indent
1658: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
1659: .Ed
1660: .Pp
1661: The terminal entry value is passed through
1662: .Xr strunvis 3
1663: before interpretation.
1664: The default value forcibly corrects the
1665: .Ql colors
1666: entry for terminals which support 88 or 256 colours:
1667: .Bd -literal -offset indent
1668: "*88col*:colors=88,*256col*:colors=256"
1669: .Ed
1.63 nicm 1670: .It Ic update-environment Ar variables
1671: Set a space-separated string containing a list of environment variables to be
1672: copied into the session environment when a new session is created or an
1673: existing session is attached.
1674: Any variables that do not exist in the source environment are set to be
1675: removed from the session environment (as if
1676: .Fl r
1677: was given to the
1678: .Ic set-environment
1679: command).
1680: The default is
1.75 nicm 1681: "DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION".
1.37 nicm 1682: .It Xo Ic visual-activity
1.56 jmc 1683: .Op Ic on | off
1.37 nicm 1684: .Xc
1685: If on, display a status line message when activity occurs in a window
1.39 jmc 1686: for which the
1.37 nicm 1687: .Ic monitor-activity
1688: window option is enabled.
1689: .It Xo Ic visual-bell
1.56 jmc 1690: .Op Ic on | off
1.37 nicm 1691: .Xc
1692: If this option is on, a message is shown on a bell instead of it being passed
1693: through to the terminal (which normally makes a sound).
1694: Also see the
1695: .Ic bell-action
1696: option.
1697: .It Xo Ic visual-content
1.56 jmc 1698: .Op Ic on | off
1.37 nicm 1699: .Xc
1700: Like
1701: .Ic visual-activity ,
1702: display a message when content is present in a window
1.39 jmc 1703: for which the
1.37 nicm 1704: .Ic monitor-content
1705: window option is enabled.
1.1 nicm 1706: .El
1707: .It Xo Ic set-window-option
1.58 nicm 1708: .Op Fl agu
1.1 nicm 1709: .Op Fl t Ar target-window
1710: .Ar option Ar value
1711: .Xc
1712: .D1 (alias: Ic setw )
1.18 nicm 1713: Set a window option.
1.1 nicm 1714: The
1.58 nicm 1715: .Fl a ,
1.1 nicm 1716: .Fl g
1717: and
1718: .Fl u
1719: flags work similarly to the
1720: .Ic set-option
1721: command.
1722: .Pp
1.18 nicm 1723: Supported window options are:
1.56 jmc 1724: .Pp
1725: .Bl -tag -width Ds -compact
1.1 nicm 1726: .It Xo Ic aggressive-resize
1.56 jmc 1727: .Op Ic on | off
1.1 nicm 1728: .Xc
1729: Aggressively resize the chosen window.
1730: This means that
1731: .Nm
1732: will resize the window to the size of the smallest session for which it is the
1733: current window, rather than the smallest session to which it is attached.
1734: The window may resize when the current window is changed on another sessions;
1.6 jmc 1735: this option is good for full-screen programs which support
1736: .Dv SIGWINCH
1737: and poor for interactive programs such as shells.
1.56 jmc 1738: .Pp
1.1 nicm 1739: .It Xo Ic automatic-rename
1.56 jmc 1740: .Op Ic on | off
1.1 nicm 1741: .Xc
1742: Control automatic window renaming.
1743: When this setting is enabled,
1744: .Nm
1745: will attempt - on supported platforms - to rename the window to reflect the
1746: command currently running in it.
1747: This flag is automatically disabled for an individual window when a name
1748: is specified at creation with
1749: .Ic new-window or
1750: .Ic new-session ,
1751: or later with
1752: .Ic rename-window .
1753: It may be switched off globally with:
1754: .Bd -literal -offset indent
1755: set-window-option -g automatic-rename off
1756: .Ed
1.56 jmc 1757: .Pp
1.1 nicm 1758: .It Ic clock-mode-colour Ar colour
1759: Set clock colour.
1.56 jmc 1760: .Pp
1.1 nicm 1761: .It Xo Ic clock-mode-style
1.56 jmc 1762: .Op Ic 12 | 24
1.1 nicm 1763: .Xc
1764: Set clock hour format.
1.56 jmc 1765: .Pp
1.1 nicm 1766: .It Ic force-height Ar height
1767: .It Ic force-width Ar width
1768: Prevent
1769: .Nm
1770: from resizing a window to greater than
1771: .Ar width
1772: or
1773: .Ar height .
1774: A value of zero restores the default unlimited setting.
1.56 jmc 1775: .Pp
1.2 nicm 1776: .It Ic main-pane-width Ar width
1777: .It Ic main-pane-height Ar height
1778: Set the width or height of the main (left or top) pane in the
1779: .Ic main-horizontal
1780: or
1781: .Ic main-vertical
1782: layouts.
1.56 jmc 1783: .Pp
1.1 nicm 1784: .It Ic mode-attr Ar attributes
1785: Set window modes attributes.
1.56 jmc 1786: .Pp
1.1 nicm 1787: .It Ic mode-bg Ar colour
1788: Set window modes background colour.
1.56 jmc 1789: .Pp
1.1 nicm 1790: .It Ic mode-fg Ar colour
1791: Set window modes foreground colour.
1.56 jmc 1792: .Pp
1.1 nicm 1793: .It Xo Ic mode-keys
1.56 jmc 1794: .Op Ic vi | emacs
1.1 nicm 1795: .Xc
1.105 nicm 1796: Use vi or emacs-style key bindings in copy and choice modes.
1.1 nicm 1797: Key bindings default to emacs.
1.56 jmc 1798: .Pp
1.50 nicm 1799: .It Xo Ic mode-mouse
1.56 jmc 1800: .Op Ic on | off
1.50 nicm 1801: .Xc
1.51 jmc 1802: Mouse state in modes.
1803: If on,
1.50 nicm 1804: .Nm
1805: will respond to mouse clicks by moving the cursor in copy mode or selecting an
1806: option in choice mode.
1.56 jmc 1807: .Pp
1.1 nicm 1808: .It Xo Ic monitor-activity
1.56 jmc 1809: .Op Ic on | off
1.1 nicm 1810: .Xc
1811: Monitor for activity in the window.
1812: Windows with activity are highlighted in the status line.
1.56 jmc 1813: .Pp
1814: .It Ic monitor-content Ar match-string
1.6 jmc 1815: Monitor content in the window.
1816: When
1.16 nicm 1817: .Xr fnmatch 3
1818: pattern
1.1 nicm 1819: .Ar match-string
1820: appears in the window, it is highlighted in the status line.
1.56 jmc 1821: .Pp
1.1 nicm 1822: .It Xo Ic remain-on-exit
1.56 jmc 1823: .Op Ic on | off
1.1 nicm 1824: .Xc
1825: A window with this flag set is not destroyed when the program running in it
1826: exits.
1827: The window may be reactivated with the
1828: .Ic respawn-window
1829: command.
1.56 jmc 1830: .Pp
1.99 nicm 1831: .It Xo Ic synchronize-panes
1832: .Op Ic on | off
1833: .Xc
1834: Duplicate input to any pane to all other panes in the same window, except
1835: for panes that are not in output mode.
1.1 nicm 1836: .It Xo Ic utf8
1.56 jmc 1837: .Op Ic on | off
1.1 nicm 1838: .Xc
1839: Instructs
1840: .Nm
1841: to expect UTF-8 sequences to appear in this window.
1.56 jmc 1842: .Pp
1.1 nicm 1843: .It Ic window-status-attr Ar attributes
1844: Set status line attributes for a single window.
1.56 jmc 1845: .Pp
1.1 nicm 1846: .It Ic window-status-bg Ar colour
1847: Set status line background colour for a single window.
1.56 jmc 1848: .Pp
1.1 nicm 1849: .It Ic window-status-fg Ar colour
1850: Set status line foreground colour for a single window.
1.56 jmc 1851: .Pp
1.125 nicm 1852: .It Ic window-status-format Ar string
1853: Set the format in which the window is displayed in the status line window list.
1854: See the
1855: .Ar status-left
1856: option for details of special character sequences available.
1857: The default is
1858: .Ql #I:#W#F .
1859: .Pp
1.40 nicm 1860: .It Ic window-status-current-attr Ar attributes
1861: Set status line attributes for the currently active window.
1.56 jmc 1862: .Pp
1.40 nicm 1863: .It Ic window-status-current-bg Ar colour
1864: Set status line background colour for the currently active window.
1.56 jmc 1865: .Pp
1.40 nicm 1866: .It Ic window-status-current-fg Ar colour
1867: Set status line foreground colour for the currently active window.
1.56 jmc 1868: .Pp
1.125 nicm 1869: .It Ic window-status-current-format Ar string
1870: Like
1871: .Ar window-status-format ,
1872: but is the format used when the window is the current window.
1873: .Pp
1.1 nicm 1874: .It Xo Ic xterm-keys
1.56 jmc 1875: .Op Ic on | off
1.1 nicm 1876: .Xc
1877: If this option is set,
1878: .Nm
1879: will generate
1.57 jmc 1880: .Xr xterm 1 -style
1881: function key sequences; these have a number included to indicate modifiers such
1882: as Shift, Alt or Ctrl.
1.123 nicm 1883: The default is off.
1.57 jmc 1884: .El
1885: .It Xo Ic show-options
1.133 nicm 1886: .Op Fl gsw
1.129 nicm 1887: .Op Fl t Ar target-session | Ar target-window
1.57 jmc 1888: .Xc
1889: .D1 (alias: Ic show )
1.133 nicm 1890: Show the window options with
1.129 nicm 1891: .Fl w
1.133 nicm 1892: (equivalent to
1.134 ! nicm 1893: .Ic show-window-options ) ,
1.133 nicm 1894: the server options with
1895: .Fl s ,
1896: otherwise the session options for
1897: .Ar target session .
1898: Global session or window options are listed if
1899: .Fl g
1900: is used.
1.57 jmc 1901: .It Xo Ic show-window-options
1902: .Op Fl g
1903: .Op Fl t Ar target-window
1904: .Xc
1905: .D1 (alias: Ic showw )
1906: List the window options for
1907: .Ar target-window ,
1908: or the global window options if
1909: .Fl g
1910: is used.
1.63 nicm 1911: .El
1912: .Sh ENVIRONMENT
1913: When the server is started,
1914: .Nm
1915: copies the environment into the
1916: .Em global environment ;
1917: in addition, each session has a
1918: .Em session environment .
1919: When a window is created, the session and global environments are merged with
1920: the session environment overriding any variable present in both.
1921: This is the initial environment passed to the new process.
1922: .Pp
1923: The
1924: .Ic update-environment
1925: session option may be used to update the session environment from the client
1926: when a new session is created or an old reattached.
1927: .Nm
1928: also initialises the
1929: .Ev TMUX
1930: variable with some internal information to allow commands to be executed
1931: from inside, and the
1932: .Ev TERM
1933: variable with the correct terminal setting of
1934: .Ql screen .
1935: .Pp
1936: Commands to alter and view the environment are:
1937: .Bl -tag -width Ds
1938: .It Xo Ic set-environment
1939: .Op Fl gru
1940: .Op Fl t Ar target-session
1941: .Ar name Op Ar value
1942: .Xc
1.115 nicm 1943: .D1 (alias: Ic setenv )
1.63 nicm 1944: Set or unset an environment variable.
1945: If
1946: .Fl g
1947: is used, the change is made in the global environment; otherwise, it is applied
1948: to the session environment for
1949: .Ar target-session .
1950: The
1951: .Fl u
1952: flag unsets a variable.
1953: .Fl r
1954: indicates the variable is to be removed from the environment before starting a
1955: new process.
1956: .It Xo Ic show-environment
1957: .Op Fl g
1958: .Op Fl t Ar target-session
1959: .Xc
1.115 nicm 1960: .D1 (alias: Ic showenv )
1.63 nicm 1961: Display the environment for
1962: .Ar target-session
1963: or the global environment with
1964: .Fl g .
1965: Variables removed from the environment are prefixed with
1966: .Ql - .
1.57 jmc 1967: .El
1968: .Sh STATUS LINE
1969: .Nm
1970: includes an optional status line which is displayed in the bottom line of each
1971: terminal.
1972: By default, the status line is enabled (it may be disabled with the
1973: .Ic status
1974: session option) and contains, from left-to-right: the name of the current
1975: session in square brackets; the window list; the current window title in double
1976: quotes; and the time and date.
1977: .Pp
1978: The status line is made of three parts: configurable left and right sections
1979: (which may contain dynamic content such as the time or output from a shell
1980: command, see the
1981: .Ic status-left ,
1982: .Ic status-left-length ,
1983: .Ic status-right ,
1984: and
1985: .Ic status-right-length
1986: options below), and a central window list.
1.125 nicm 1987: By default, the window list shows the index, name and (if any) flag of the
1988: windows present in the current session in ascending numerical order.
1989: It may be customised with the
1990: .Ar window-status-format
1991: and
1992: .Ar window-status-current-format
1993: options.
1.57 jmc 1994: The flag is one of the following symbols appended to the window name:
1995: .Bl -column "Symbol" "Meaning" -offset indent
1996: .It Sy "Symbol" Ta Sy "Meaning"
1997: .It Li "*" Ta "Denotes the current window."
1998: .It Li "-" Ta "Marks the last window (previously selected)."
1999: .It Li "#" Ta "Window is monitored and activity has been detected."
2000: .It Li "!" Ta "A bell has occurred in the window."
2001: .It Li "+" Ta "Window is monitored for content and it has appeared."
2002: .El
2003: .Pp
2004: The # symbol relates to the
2005: .Ic monitor-activity
2006: and + to the
2007: .Ic monitor-content
2008: window options.
2009: The window name is printed in inverted colours if an alert (bell, activity or
2010: content) is present.
2011: .Pp
1.131 nicm 2012: The colour and attributes of the status line may be configured, the entire
2013: status line using the
1.57 jmc 2014: .Ic status-attr ,
2015: .Ic status-fg
2016: and
2017: .Ic status-bg
2018: session options and individual windows using the
2019: .Ic window-status-attr ,
2020: .Ic window-status-fg
2021: and
2022: .Ic window-status-bg
2023: window options.
2024: .Pp
1.131 nicm 2025: The status line is automatically refreshed at interval if it has changed, the
2026: interval may be controlled with the
1.57 jmc 2027: .Ic status-interval
2028: session option.
2029: .Pp
2030: Commands related to the status line are as follows:
2031: .Bl -tag -width Ds
2032: .It Xo Ic command-prompt
1.73 nicm 2033: .Op Fl p Ar prompts
1.57 jmc 2034: .Op Fl t Ar target-client
2035: .Op Ar template
2036: .Xc
2037: Open the command prompt in a client.
2038: This may be used from inside
2039: .Nm
2040: to execute commands interactively.
2041: If
2042: .Ar template
1.73 nicm 2043: is specified, it is used as the command.
2044: If
2045: .Fl p
2046: is given,
2047: .Ar prompts
2048: is a comma-separated list of prompts which are displayed in order; otherwise
2049: a single prompt is displayed, constructed from
2050: .Ar template
2051: if it is present, or
2052: .Ql \&:
2053: if not.
2054: Before the command is executed, the first occurrence of the string
2055: .Ql %%
1.74 jmc 2056: and all occurrences of
1.73 nicm 2057: .Ql %1
2058: are replaced by the response to the first prompt, the second
2059: .Ql %%
2060: and all
2061: .Ql %2
2062: are replaced with the response to the second prompt, and so on for further
1.74 jmc 2063: prompts.
2064: Up to nine prompt responses may be replaced
2065: .Po
2066: .Ql %1
1.73 nicm 2067: to
1.74 jmc 2068: .Ql %9
2069: .Pc .
1.57 jmc 2070: .It Xo Ic confirm-before
2071: .Op Fl t Ar target-client
2072: .Ar command
2073: .Xc
2074: .D1 (alias: Ic confirm )
2075: Ask for confirmation before executing
2076: .Ar command .
2077: This command works only from inside
2078: .Nm .
2079: .It Xo Ic display-message
1.127 nicm 2080: .Op Fl p
1.57 jmc 2081: .Op Fl t Ar target-client
2082: .Op Ar message
2083: .Xc
2084: .D1 (alias: Ic display )
1.127 nicm 2085: Display a message.
2086: If
2087: .Fl p
2088: is given, the output is printed to stdout, otherwise it is displayed in the
2089: .Ar target-client
2090: status line.
1.122 nicm 2091: The format of
1.124 jmc 2092: .Ar message
2093: is as for
1.122 nicm 2094: .Ic status-left ,
2095: with the exception that #() are not handled.
1.57 jmc 2096: .It Ic select-prompt Op Fl t Ar target-client
2097: Open a prompt inside
2098: .Ar target-client
2099: allowing a window index to be entered interactively.
2100: .El
2101: .Sh BUFFERS
2102: .Nm
2103: maintains a stack of
2104: .Em paste buffers
2105: for each session.
2106: Up to the value of the
2107: .Ic buffer-limit
2108: option are kept; when a new buffer is added, the buffer at the bottom of the
2109: stack is removed.
2110: Buffers may be added using
2111: .Ic copy-mode
2112: or the
2113: .Ic set-buffer
2114: command, and pasted into a window using the
2115: .Ic paste-buffer
2116: command.
2117: .Pp
2118: A configurable history buffer is also maintained for each window.
2119: By default, up to 2000 lines are kept; this can be altered with the
2120: .Ic history-limit
2121: option (see the
2122: .Ic set-option
2123: command above).
2124: .Pp
2125: The buffer commands are as follows:
2126: .Bl -tag -width Ds
2127: .It Ic clear-history Op Fl t Ar target-pane
2128: .D1 (alias: Ic clearhist )
2129: Remove and free the history for the specified pane.
2130: .It Xo Ic copy-buffer
2131: .Op Fl a Ar src-index
2132: .Op Fl b Ar dst-index
2133: .Op Fl s Ar src-session
2134: .Op Fl t Ar dst-session
2135: .Xc
2136: .D1 (alias: Ic copyb )
2137: Copy a session paste buffer to another session.
2138: If no sessions are specified, the current one is used instead.
2139: .It Xo Ic delete-buffer
2140: .Op Fl b Ar buffer-index
2141: .Op Fl t Ar target-session
2142: .Xc
2143: .D1 (alias: Ic deleteb )
2144: Delete the buffer at
2145: .Ar buffer-index ,
2146: or the top buffer if not specified.
2147: .It Ic list-buffers Op Fl t Ar target-session
2148: .D1 (alias: Ic lsb )
2149: List the buffers in the given session.
2150: .It Xo Ic load-buffer
2151: .Op Fl b Ar buffer-index
2152: .Op Fl t Ar target-session
2153: .Ar path
2154: .Xc
2155: .D1 (alias: Ic loadb )
2156: Load the contents of the specified paste buffer from
2157: .Ar path .
2158: .It Xo Ic paste-buffer
2159: .Op Fl dr
2160: .Op Fl b Ar buffer-index
2161: .Op Fl t Ar target-window
2162: .Xc
2163: .D1 (alias: Ic pasteb )
2164: Insert the contents of a paste buffer into the current window.
2165: With
2166: .Fl d ,
2167: also delete the paste buffer from the stack.
2168: When output, any linefeed (LF) characters in the paste buffer are replaced with
2169: carriage returns (CR).
2170: This translation may be disabled with the
2171: .Fl r
2172: flag.
2173: .It Xo Ic save-buffer
2174: .Op Fl a
2175: .Op Fl b Ar buffer-index
2176: .Op Fl t Ar target-session
2177: .Ar path
2178: .Xc
2179: .D1 (alias: Ic saveb )
2180: Save the contents of the specified paste buffer to
2181: .Ar path .
2182: The
2183: .Fl a
2184: option appends to rather than overwriting the file.
2185: .It Xo Ic set-buffer
2186: .Op Fl b Ar buffer-index
2187: .Op Fl t Ar target-session
2188: .Ar data
2189: .Xc
2190: .D1 (alias: Ic setb )
2191: Set the contents of the specified buffer to
2192: .Ar data .
1.1 nicm 2193: .It Xo Ic show-buffer
2194: .Op Fl b Ar buffer-index
2195: .Op Fl t Ar target-session
2196: .Xc
2197: .D1 (alias: Ic showb )
2198: Display the contents of the specified buffer.
1.57 jmc 2199: .El
2200: .Sh MISCELLANEOUS
2201: .Pp
2202: Miscellaneous commands are as follows:
2203: .Bl -tag -width Ds
1.72 nicm 2204: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 2205: Display a large clock.
2206: .It Ic if-shell Ar shell-command command
2207: .D1 (alias: Ic if )
2208: Execute
2209: .Ar command
2210: if
2211: .Ar shell-command
2212: returns success.
2213: .It Ic lock-server
2214: .D1 (alias: Ic lock )
1.90 nicm 2215: Lock each client individually by running the command specified by the
2216: .Ic lock-command
2217: option.
1.87 nicm 2218: .It Ic run-shell Ar command
2219: .D1 (alias: Ic run )
2220: Execute
2221: .Ar command
1.106 nicm 2222: in the background without creating a window.
2223: After the command finishes, any output to stdout is displayed in output mode.
1.87 nicm 2224: If
1.88 jmc 2225: .Ar command
1.87 nicm 2226: doesn't return success, the exit status is also displayed.
1.57 jmc 2227: .It Ic server-info
2228: .D1 (alias: Ic info )
2229: Show server information and terminal details.
1.1 nicm 2230: .El
2231: .Sh FILES
1.26 nicm 2232: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 2233: .It Pa ~/.tmux.conf
1.6 jmc 2234: Default
1.1 nicm 2235: .Nm
1.6 jmc 2236: configuration file.
1.26 nicm 2237: .It Pa /etc/tmux.conf
2238: System-wide configuration file.
1.1 nicm 2239: .El
1.57 jmc 2240: .Sh EXAMPLES
2241: To create a new
2242: .Nm
2243: session running
2244: .Xr vi 1 :
2245: .Pp
2246: .Dl $ tmux new-session vi
2247: .Pp
2248: Most commands have a shorter form, known as an alias.
2249: For new-session, this is
2250: .Ic new :
2251: .Pp
2252: .Dl $ tmux new vi
2253: .Pp
2254: Alternatively, the shortest unambiguous form of a command is accepted.
2255: If there are several options, they are listed:
2256: .Bd -literal -offset indent
2257: $ tmux n
2258: ambiguous command: n, could be: new-session, new-window, next-window
2259: .Ed
2260: .Pp
2261: Within an active session, a new window may be created by typing
2262: .Ql C-b c
2263: (Ctrl
2264: followed by the
2265: .Ql b
2266: key
2267: followed by the
2268: .Ql c
2269: key).
2270: .Pp
2271: Windows may be navigated with:
2272: .Ql C-b 0
2273: (to select window 0),
2274: .Ql C-b 1
2275: (to select window 1), and so on;
2276: .Ql C-b n
2277: to select the next window; and
2278: .Ql C-b p
2279: to select the previous window.
2280: .Pp
2281: A session may be detached using
2282: .Ql C-b d
1.64 nicm 2283: (or by an external event such as
2284: .Xr ssh 1
2285: disconnection) and reattached with:
1.57 jmc 2286: .Pp
2287: .Dl $ tmux attach-session
2288: .Pp
2289: Typing
2290: .Ql C-b \&?
2291: lists the current key bindings in the current window; up and down may be used
2292: to navigate the list or
2293: .Ql q
2294: to exit from it.
2295: .Pp
2296: Commands to be run when the
2297: .Nm
2298: server is started may be placed in the
2299: .Pa ~/.tmux.conf
2300: configuration file.
2301: Common examples include:
2302: .Pp
2303: Changing the default prefix key:
2304: .Bd -literal -offset indent
2305: set-option -g prefix C-a
2306: unbind-key C-b
2307: bind-key C-a send-prefix
2308: .Ed
2309: .Pp
2310: Turning the status line off, or changing its colour:
2311: .Bd -literal -offset indent
2312: set-option -g status off
2313: set-option -g status-bg blue
2314: .Ed
2315: .Pp
2316: Setting other options, such as the default command,
2317: or locking after 30 minutes of inactivity:
2318: .Bd -literal -offset indent
2319: set-option -g default-command "exec /bin/ksh"
2320: set-option -g lock-after-time 1800
2321: .Ed
2322: .Pp
2323: Creating new key bindings:
2324: .Bd -literal -offset indent
2325: bind-key b set-option status
2326: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 2327: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 2328: .Ed
1.1 nicm 2329: .Sh SEE ALSO
2330: .Xr pty 4
2331: .Sh AUTHORS
2332: .An Nicholas Marriott Aq nicm@users.sourceforge.net