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