Annotation of src/usr.bin/tmux/tmux.1, Revision 1.51
1.51 ! jmc 1: .\" $OpenBSD: tmux.1,v 1.50 2009/07/30 07:04:50 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.51 ! jmc 17: .Dd $Mdocdate: July 30 2009 $
1.1 nicm 18: .Dt TMUX 1
19: .Os
20: .Sh NAME
21: .Nm tmux
1.6 jmc 22: .Nd terminal multiplexer
1.1 nicm 23: .Sh SYNOPSIS
24: .Nm tmux
25: .Bk -words
26: .Op Fl 28dqUuv
27: .Op Fl f Ar file
28: .Op Fl L Ar socket-name
29: .Op Fl S Ar socket-path
30: .Op Ar command Op Ar flags
31: .Ek
32: .Sh DESCRIPTION
33: .Nm
1.6 jmc 34: is a terminal multiplexer: it enables a number of terminals to be accessed and
1.1 nicm 35: controlled from a single terminal.
36: .Pp
37: .Nm
38: runs as a server-client system.
1.33 nicm 39: A server holds a number of
1.1 nicm 40: .Em sessions ,
41: each of which may have a number of
42: .Em windows
43: linked to it.
1.33 nicm 44: A server is started automatically when the first session is created and exits
45: when all the sessions it contains are destroyed.
1.1 nicm 46: A window may be split on screen into one or more
47: .Em panes ,
48: each of which is a separate terminal.
49: Any number of
50: .Em clients
51: may connect to a session, or the server
52: may be controlled by issuing commands with
53: .Nm .
54: Communication takes place through a socket, by default placed in
55: .Pa /tmp .
56: .Pp
57: The options are as follows:
58: .Bl -tag -width "XXXXXXXXXXXX"
59: .It Fl 2
60: Force
61: .Nm
62: to assume the terminal supports 256 colours.
63: .It Fl 8
64: Like
65: .Fl 2 ,
1.6 jmc 66: but indicates that the terminal supports 88 colours.
1.1 nicm 67: .It Fl d
68: Force
69: .Nm
70: to assume the terminal supports default colours.
71: .It Fl f Ar file
72: Specify an alternative configuration file.
73: By default,
74: .Nm
1.26 nicm 75: loads the system configuration file from
76: .Pa /etc/tmux.conf ,
77: if present, then looks for a user configuration file at
1.1 nicm 78: .Pa ~/.tmux.conf .
79: The configuration file is a set of
80: .Nm
81: commands which are executed in sequence when the server is first started.
82: .It Fl L Ar socket-name
83: .Nm
84: stores the server socket in a directory under
85: .Pa /tmp ;
86: the default socket is named
87: .Em default .
88: This option allows a different socket name to be specified, allowing several
89: independent
90: .Nm
91: servers to be run.
92: Unlike
93: .Fl S
94: a full path is not necessary: the sockets are all created in the same
95: directory.
1.2 nicm 96: .Pp
97: If the socket is accidentally removed, the
1.6 jmc 98: .Dv SIGUSR1
1.2 nicm 99: signal may be sent to the
100: .Nm
101: server process to recreate it.
1.4 sobrado 102: .It Fl q
1.6 jmc 103: Prevent the server sending various informational messages, for example when
1.4 sobrado 104: window flags are altered.
1.1 nicm 105: .It Fl S Ar socket-path
106: Specify a full alternative path to the server socket.
107: If
108: .Fl S
109: is specified, the default socket directory is not used and any
110: .Fl L
111: flag is ignored.
112: .It Fl U
113: Unlock the server.
114: .It Fl u
115: .Nm
1.14 nicm 116: attempts to guess if the terminal is likely to support UTF-8 by checking the
117: first of the
118: .Ev LC_ALL ,
119: .Ev LC_CTYPE
120: and
1.2 nicm 121: .Ev LANG
1.14 nicm 122: environment variables to be set for the string "UTF-8".
1.5 nicm 123: This is not always correct: the
1.2 nicm 124: .Fl u
125: flag explicitly informs
126: .Nm
1.6 jmc 127: that UTF-8 is supported.
1.33 nicm 128: .Pp
129: If the server is started from a client passed
130: .Fl u
131: or where UTF-8 is detected, the
132: .Ic utf8
133: and
134: .Ic status-utf8
135: options are enabled in the global window and session options respectively.
1.1 nicm 136: .It Fl v
137: Request verbose logging.
138: This option may be specified multiple times for increasing verbosity.
139: Log messages will be saved into
140: .Pa tmux-client-PID.log
141: and
142: .Pa tmux-server-PID.log
143: files in the current directory, where
144: .Em PID
1.6 jmc 145: is the PID of the server or client process.
1.1 nicm 146: .It Ar command Op Ar flags
147: This specifies one of a set of commands used to control
148: .Nm ,
1.6 jmc 149: as described in the following sections.
150: If no command and flags are specified, the
1.1 nicm 151: .Ic new-session
152: command is assumed.
153: .El
154: .Sh QUICK START
1.6 jmc 155: To create a new
156: .Nm
157: session running
1.1 nicm 158: .Xr vi 1 :
159: .Pp
160: .Dl $ tmux new-session vi
161: .Pp
162: Most commands have a shorter form, known as an alias.
163: For new-session, this is
164: .Ic new :
165: .Pp
166: .Dl $ tmux new vi
167: .Pp
168: Alternatively, the shortest unambiguous form of a command is accepted.
169: If there are several options, they are listed:
170: .Bd -literal -offset indent
171: $ tmux n
172: ambiguous command: n, could be: new-session, new-window, next-window
173: .Ed
174: .Pp
175: Within an active session, a new window may be created by typing
1.7 jmc 176: .Ql C-b c
177: (Ctrl
1.1 nicm 178: followed by the
1.6 jmc 179: .Ql b
1.7 jmc 180: key
181: followed by the
182: .Ql c
1.6 jmc 183: key).
1.1 nicm 184: .Pp
185: Windows may be navigated with:
186: .Ql C-b 0
187: (to select window 0),
188: .Ql C-b 1
189: (to select window 1), and so on;
190: .Ql C-b n
191: to select the next window; and
192: .Ql C-b p
193: to select the previous window.
194: .Pp
195: A session may be detached using
196: .Ql C-b d
197: and reattached with:
198: .Pp
199: .Dl $ tmux attach-session
200: .Pp
201: Typing
202: .Ql C-b \&?
203: lists the current key bindings in the current window; up and down may be used
204: to navigate the list or
1.6 jmc 205: .Ql q
1.1 nicm 206: to exit from it.
1.13 nicm 207: .Pp
208: Commands to be run when the
209: .Nm
210: server is started may be placed in the
1.15 jmc 211: .Pa ~/.tmux.conf
1.13 nicm 212: configuration file.
213: Common examples include:
1.15 jmc 214: .Pp
215: Changing the default prefix key:
1.13 nicm 216: .Bd -literal -offset indent
217: set-option -g prefix C-a
218: unbind-key C-b
219: bind-key C-a send-prefix
220: .Ed
221: .Pp
222: Turning the status line off, or changing its colour:
223: .Bd -literal -offset indent
224: set-option -g status off
225: set-option -g status-bg blue
226: .Ed
227: .Pp
1.15 jmc 228: Setting other options, such as the default command,
229: or locking after 30 minutes of inactivity:
1.13 nicm 230: .Bd -literal -offset indent
231: set-option -g default-command "exec /bin/ksh"
232: set-option -g lock-after-time 1800
233: .Ed
1.15 jmc 234: .Pp
235: Creating new key bindings:
1.13 nicm 236: .Bd -literal -offset indent
237: bind-key b set-option status
238: bind-key / command-prompt "split-window 'exec man %%'"
239: .Ed
1.1 nicm 240: .Sh KEY BINDINGS
241: .Nm
242: may be controlled from an attached client by using a key combination of a
243: prefix key,
244: .Ql C-b
1.6 jmc 245: (Ctrl-b) by default, followed by a command key.
1.1 nicm 246: .Pp
247: Some of the default key bindings include:
248: .Pp
1.6 jmc 249: .Bl -tag -width Ds -offset 3n -compact
250: .It c
251: Create new window.
252: .It d
1.1 nicm 253: Detach current client.
1.6 jmc 254: .It l
255: Move to last (previously selected) window in the current session.
256: .It n
1.1 nicm 257: Change to next window in the current session.
1.6 jmc 258: .It p
1.1 nicm 259: Change to previous window in the current session.
1.6 jmc 260: .It t
1.1 nicm 261: Display a large clock.
1.6 jmc 262: .It \&?
1.1 nicm 263: List current key bindings.
264: .El
265: .Pp
266: A complete list may be obtained with the
267: .Ic list-keys
268: command (bound to
269: .Ql \&?
270: by default).
271: Key bindings may be changed with the
272: .Ic bind-key
273: and
274: .Ic unbind-key
275: commands.
276: .Sh HISTORY
277: .Nm
278: maintains a configurable history buffer for each window.
1.6 jmc 279: By default, up to 2000 lines are kept; this can be altered with the
1.1 nicm 280: .Ic history-limit
281: option (see the
282: .Ic set-option
283: command below).
284: .Sh MODES
285: A
286: .Nm
287: window may be in one of several modes.
288: The default permits direct access to the terminal attached to the window.
289: The others are:
290: .Bl -tag -width Ds
291: .It Em output mode
292: This is entered when a command which produces output, such as
293: .Ic list-keys ,
294: is executed from a key binding.
295: .It Em scroll mode
296: This is entered with the
297: .Ic scroll-mode
298: command (bound to
299: .Ql =
300: by default) and permits the window history buffer to be inspected.
301: .It Em copy mode
302: This permits a section of a window or its history to be copied to a
303: .Em paste buffer
304: for later insertion into another window.
305: This mode is entered with the
306: .Ic copy-mode
307: command, bound to
308: .Ql [
309: by default.
310: .El
311: .Pp
1.6 jmc 312: The keys available depend on whether emacs or vi mode is selected
313: (see the
1.1 nicm 314: .Ic mode-keys
315: option).
316: The following keys are supported as appropriate for the mode:
317: .Bl -column "FunctionXXXXXXXXXXXX" "viXXXXXX" "emacs" -offset indent
318: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27 nicm 319: .It Li "Start of line" Ta "0" Ta "C-a"
320: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.1 nicm 321: .It Li "Clear selection" Ta "Escape" Ta "C-g"
322: .It Li "Copy selection" Ta "Enter" Ta "M-w"
323: .It Li "Cursor down" Ta "j" Ta "Down"
324: .It Li "End of line" Ta "$" Ta "C-e"
325: .It Li "Cursor left" Ta "h" Ta "Left"
326: .It Li "Next page" Ta "C-f" Ta "Page down"
327: .It Li "Next word" Ta "w" Ta "M-f"
328: .It Li "Previous page" Ta "C-u" Ta "Page up"
329: .It Li "Previous word" Ta "b" Ta "M-b"
330: .It Li "Quit mode" Ta "q" Ta "Escape"
331: .It Li "Cursor right" Ta "l" Ta "Right"
332: .It Li "Start selection" Ta "Space" Ta "C-Space"
333: .It Li "Cursor up" Ta "k" Ta "Up"
1.48 nicm 334: .It Li "Delete to end of line" Ta "D" Ta "C-k"
1.2 nicm 335: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.1 nicm 336: .El
337: .Pp
1.48 nicm 338: These key bindings are defined in a set of named tables:
339: .Em vi-edit
340: and
341: .Em emacs-edit
342: for keys used when line editing at the command prompt;
343: .Em vi-choice
344: and
345: .Em emacs-choice
346: for keys used when choosing from lists (such as produced by the
347: .Ic window-choose
348: command) or in output mode; and
349: .Em vi-copy
350: and
351: .Em emacs-copy
352: used in copy and scroll modes.
353: The tables may be viewed with the
354: .Ic list-keys
1.49 nicm 355: command and keys modified or removed with
356: .Ic bind-key
357: and
358: .Ic unbind-key .
1.48 nicm 359: .Pp
1.2 nicm 360: The paste buffer key pastes the first line from the top paste buffer on the
361: stack.
1.1 nicm 362: .Sh BUFFERS
363: .Nm
364: maintains a stack of
365: .Em paste buffers
366: for each session.
367: Up to the value of the
368: .Ic buffer-limit
369: option are kept; when a new buffer is added, the buffer at the bottom of the
370: stack is removed.
371: Buffers may be added using
372: .Ic copy-mode
373: or the
374: .Ic set-buffer
375: command, and pasted into a window using the
376: .Ic paste-buffer
377: command.
1.18 nicm 378: .Sh OPTIONS
379: The appearance and behaviour of
380: .Nm
381: may be modified by changing the value of various options.
382: There are two types of option:
383: .Em session options
384: and
385: .Em window options .
386: .Pp
387: Each individual session may have a set of session options, and there is a
388: separate set of global session options.
389: Sessions which do not have a particular option configured inherit the value
390: from the global session options.
391: Session options are set or unset with the
392: .Ic set-option
393: command and may be listed with the
394: .Ic show-options
395: command.
396: The available session options are listed under the
397: .Ic set-option
398: command.
399: .Pp
400: Similarly, a set of window options is attached to each window, and there is
401: a set of global window options from which any unset options are inherited.
402: Window options are altered with the
403: .Ic set-window-option
404: command and can be listed with the
405: .Ic show-window-options
406: command.
407: All window options are documented with the
408: .Ic set-window-option
409: command.
1.1 nicm 410: .Sh PANES AND LAYOUTS
411: Each window displayed by
412: .Nm
413: may be split into one or more
414: .Em panes ;
415: each pane takes up a certain area of the display and is a separate terminal.
416: A window may be split into panes using the
417: .Ic split-window
418: command.
1.38 nicm 419: Windows may be split horizontally (with the
420: .Fl h
421: flag) or vertically.
422: Panes may be resized with the
423: .Ic resize-pane
1.1 nicm 424: command (bound to
1.38 nicm 425: .Ql C-up ,
426: .Ql C-down
427: .Ql C-left
428: and
429: .Ql C-right
1.1 nicm 430: by default), the current pane may be changed with the
431: .Ic up-pane
432: and
433: .Ic down-pane
434: commands and the
435: .Ic rotate-window
436: and
437: .Ic swap-pane
1.38 nicm 438: commands may be used to swap panes without changing their position.
439: Panes are numbered beginning from zero in the order they are created.
440: .Pp
441: A number of preset
442: .Em layouts
443: are available.
444: These may be selected with the
445: .Ic select-layout
446: command or cycled with
447: .Ic next-layout
448: (bound to
449: .Ql C-space
450: by default); once a layout is chosen, panes within it may be moved and resized as normal.
1.1 nicm 451: .Pp
452: The following layouts are supported:
453: .Bl -tag -width Ds
454: .It Ic even-horizontal
455: Panes are spread out evenly from left to right across the window.
456: .It Ic even-vertical
457: Panes are spread evenly from top to bottom.
1.2 nicm 458: .It Ic main-horizontal
459: A large (main) pane is shown at the top of the window and the remaining panes are
1.6 jmc 460: spread from left to right in the leftover space at the bottom.
1.2 nicm 461: Use the
462: .Em main-pane-height
463: window option to specify the height of the top pane.
1.1 nicm 464: .It Ic main-vertical
1.2 nicm 465: Similar to
466: .Ic main-horizontal
467: but the large pane is placed on the left and the others spread from top to
468: bottom along the right.
469: See the
470: .Em main-pane-width
471: window option.
1.1 nicm 472: .El
1.8 nicm 473: .Sh STATUS LINE
474: .Nm
475: includes an optional status line which is displayed in the bottom line of each
476: terminal.
477: By default, the status line is enabled (it may be disabled with the
478: .Ic status
479: session option) and contains, from left-to-right: the name of the current
480: session in square brackets; the window list; the current window title in double
481: quotes; and the time and date.
482: .Pp
483: The status line is made of three parts: configurable left and right sections
484: (which may contain dynamic content such as the time or output from a shell
485: command, see the
486: .Ic status-left ,
487: .Ic status-left-length ,
488: .Ic status-right ,
489: and
490: .Ic status-right-length
491: options below), and a central window list.
492: The window list shows the index, name and (if any) flag of the windows
493: present in the current session in ascending numerical order.
494: The flag is one of the following symbols appended to the window name:
495: .Bl -column "Symbol" "Meaning" -offset indent
496: .It Sy "Symbol" Ta Sy "Meaning"
497: .It Li "*" Ta "Denotes the current window."
498: .It Li "-" Ta "Marks the last window (previously selected)."
499: .It Li "#" Ta "Window is monitored and activity has been detected."
500: .It Li "!" Ta "A bell has occurred in the window."
501: .It Li "+" Ta "Window is monitored for content and it has appeared."
502: .El
503: .Pp
504: The # symbol relates to the
505: .Ic monitor-activity
506: and + to the
507: .Ic monitor-content
508: window options.
509: The window name is printed in inverted colours if an alert (bell, activity or
510: content) is present.
511: .Pp
512: The colour and attributes of the status line may be configured, the entire status line using
513: the
514: .Ic status-attr ,
515: .Ic status-fg
516: and
517: .Ic status-bg
518: session options and individual windows using the
519: .Ic window-status-attr ,
520: .Ic window-status-fg
521: and
522: .Ic window-status-bg
523: window options.
524: .Pp
525: The status line is automatically refreshed at interval if it has changed, the interval may be
526: controlled with the
527: .Ic status-interval
528: session option.
1.1 nicm 529: .Sh COMMANDS
530: This section contains a list of the commands supported by
531: .Nm .
532: Most commands accept the optional
533: .Fl t
534: argument with one of
535: .Ar target-client ,
536: .Ar target-session
537: or
538: .Ar target-window .
539: These specify the client, session or window which a command should affect.
540: .Ar target-client
541: is the name of the
542: .Xr pty 4
1.29 nicm 543: file to which the client is connected, for example either of
544: .Pa /dev/ttyp1
545: or
546: .Pa ttyp1
1.30 jmc 547: for the client attached to
1.1 nicm 548: .Pa /dev/ttyp1 .
1.29 nicm 549: If no client is specified, the current client is chosen, if possible, or an
550: error is reported.
1.1 nicm 551: Clients may be listed with the
552: .Ic list-clients
553: command.
554: .Pp
555: .Ar target-session
556: is either the name of a session (as listed by the
557: .Ic list-sessions
1.29 nicm 558: command) or the name of a client with the same syntax as
1.1 nicm 559: .Ar target-client ,
1.6 jmc 560: in which case the session attached to the client is used.
1.30 jmc 561: When looking for the session name,
1.29 nicm 562: .Nm
563: initially searches for an exact match; if none is found, the session names
564: are checked for any for which
565: .Ar target-session
566: is a prefix or for which it matches as an
1.1 nicm 567: .Xr fnmatch 3
1.29 nicm 568: pattern.
569: If a single match is found, it is used as the target session; multiple matches
1.43 nicm 570: produce an error.
1.29 nicm 571: If a session is omitted, the current session is used if available; if no
572: current session is available, the most recently created is chosen.
1.1 nicm 573: .Pp
574: .Ar target-window
575: specifies a window in the form
1.43 nicm 576: .Em session Ns \&: Ns Em window .
577: .Em session
578: follows the same rules as for
579: .Ar target-session ,
580: and
1.29 nicm 581: .Em window
1.43 nicm 582: is looked for in order: as a window index, for example mysession:1; as an exact
583: window name, such as mysession:mywindow; then as an
1.29 nicm 584: .Xr fnmatch 3
1.43 nicm 585: pattern or the start of a window name, such as mysession:mywin* or
586: mysession:mywin.
587: An empty window name specifies the next unused index if appropriate (for
588: example the
589: .Ic new-window
590: and
591: .Ic link-window
592: commands)
593: otherwise the current window in
1.1 nicm 594: .Em session
1.43 nicm 595: is chosen.
1.6 jmc 596: When the argument does not contain a colon,
1.1 nicm 597: .Nm
1.43 nicm 598: first attempts to parse it as window; if that fails, an attempt is made to
599: match a session.
1.1 nicm 600: .Pp
601: Multiple commands may be specified together as part of a
602: .Em command sequence .
1.6 jmc 603: Each command should be separated by spaces and a semicolon;
1.1 nicm 604: commands are executed sequentially from left to right.
605: A literal semicolon may be included by escaping it with a backslash (for
606: example, when specifying a command sequence to
607: .Ic bind-key ) .
608: .Pp
609: Examples include:
610: .Bd -literal -offset indent
611: refresh-client -t/dev/ttyp2
612:
613: rename-session -tfirst newname
614:
615: set-window-option -t:0 monitor-activity on
616:
617: new-window ; split-window -d
618:
619: bind-key D detach-client \e\; lock-server
620: .Ed
621: .Pp
622: The following commands are available:
623: .Bl -tag -width Ds
624: .It Xo Ic attach-session
625: .Op Fl d
626: .Op Fl t Ar target-session
627: .Xc
628: .D1 (alias: Ic attach )
1.34 nicm 629: If run from outside
630: .Nm ,
631: create a new client in the current terminal and attach it to
632: .Ar target-session .
633: If used from inside, switch the current client.
1.1 nicm 634: If
635: .Fl d
636: is specified, any other clients attached to the session are detached.
637: .Pp
638: If no server is started,
639: .Ic attach-session
640: will attempt to start it; this will fail unless sessions are created in the
641: configuration file.
642: .It Xo Ic bind-key
1.49 nicm 643: .Op Fl cnr
644: .Op Fl t Ar key-table
1.1 nicm 645: .Ar key Ar command Op Ar arguments
646: .Xc
647: .D1 (alias: Ic bind )
648: Bind key
649: .Ar key
650: to
651: .Ar command .
652: Keys may be specified prefixed with
653: .Ql C-
654: or
655: .Ql ^
1.6 jmc 656: for Ctrl keys, or
1.1 nicm 657: .Ql M-
1.6 jmc 658: for Alt (meta) keys.
1.49 nicm 659: .Pp
660: By default (without
661: .Fl t )
662: the primary key bindings are modified (those normally activated with the prefix
663: key); in this case, if
1.45 nicm 664: .Fl n
665: is specified, it is not necessary to use the prefix key,
666: .Ar command
667: is bound to
668: .Ar key
669: alone.
1.1 nicm 670: The
671: .Fl r
672: flag indicates this key may repeat, see the
673: .Ic repeat-time
674: option.
1.49 nicm 675: .Pp
676: If
677: .Fl t
678: is present,
679: .Ar key
680: is bound in
681: .Ar key-table :
682: the binding for command mode with
683: .Fl c
684: or for normal mode without.
685: To view the default bindings and possible commands, see the
686: .Ic list-keys
687: command.
1.1 nicm 688: .It Xo Ic break-pane
689: .Op Fl d
690: .Op Fl p Ar pane-index
691: .Op Fl t Ar target-window
692: .Xc
1.17 nicm 693: .D1 (alias: Ic breakp )
1.1 nicm 694: Break the current pane off from its containing window to make it the only pane
695: in a new window.
696: If
697: .Fl d
698: is given, the new window does not become the current window.
699: .It Xo Ic choose-session
700: .Op Fl t Ar target-window
701: .Xc
702: Put a window into session choice mode, where the session for the current
703: client may be selected interactively from a list.
704: This command works only from inside
705: .Nm .
706: .It Xo Ic choose-window
707: .Op Fl t Ar target-window
708: .Xc
709: Put a window into window choice mode, where the window for the session
710: attached to the current client may be selected interactively from a list.
711: This command works only from inside
712: .Nm .
1.2 nicm 713: .It Xo Ic clear-history
714: .Op Fl p Ar pane-index
715: .Op Fl t Ar target-window
716: .Xc
1.17 nicm 717: .D1 (alias: Ic clearhist )
1.2 nicm 718: Remove and free the history for the specified pane.
1.1 nicm 719: .It Xo Ic clock-mode
720: .Op Fl t Ar target-window
721: .Xc
722: Display a large clock.
723: .It Xo Ic command-prompt
724: .Op Fl t Ar target-client
725: .Op Ar template
726: .Xc
727: Open the command prompt in a client.
728: This may be used from inside
729: .Nm
730: to execute commands interactively.
731: If
732: .Ar template
733: is specified, it is used as the command; any %% in the template will be
734: replaced by what is entered at the prompt.
735: .It Xo Ic confirm-before
736: .Op Fl t Ar target-client
737: .Ar command
738: .Xc
1.17 nicm 739: .D1 (alias: Ic confirm )
1.1 nicm 740: Ask for confirmation before executing
741: .Ar command .
742: This command works only from inside
743: .Nm .
744: .It Xo Ic copy-buffer
745: .Op Fl a Ar src-index
746: .Op Fl b Ar dst-index
747: .Op Fl s Ar src-session
748: .Op Fl t Ar dst-session
749: .Xc
1.17 nicm 750: .D1 (alias: Ic copyb )
1.1 nicm 751: Copy a session paste buffer to another session.
752: If no sessions are specified, the current one is used instead.
753: .It Xo Ic copy-mode
754: .Op Fl u
755: .Op Fl t Ar target-window
756: .Xc
757: Enter copy mode.
758: The
759: .Fl u
760: option scrolls one page up.
761: .It Xo Ic delete-buffer
762: .Op Fl b Ar buffer-index
763: .Op Fl t Ar target-session
764: .Xc
765: .D1 (alias: Ic deleteb )
766: Delete the buffer at
767: .Ar buffer-index ,
768: or the top buffer if not specified.
769: .It Xo Ic detach-client
770: .Op Fl t Ar target-client
771: .Xc
772: .D1 (alias: Ic detach )
773: Detach the current client if bound to a key, or the specified client with
774: .Fl t .
1.35 nicm 775: .It Xo Ic display-message
776: .Op Fl t Ar target-client
777: .Op Ar message
778: .Xc
779: .D1 (alias: Ic display )
780: Display a message (see the
781: .Ic status-left
782: option below)
783: in the status line.
1.1 nicm 784: .It Xo Ic down-pane
785: .Op Fl p Ar pane-index
786: .Op Fl t Ar target-window
787: .Xc
788: .D1 (alias: Ic downp )
789: Move down a pane.
790: .It Xo Ic find-window
791: .Op Fl t Ar target-window
792: .Ar match-string
793: .Xc
794: .D1 (alias: Ic findw )
1.16 nicm 795: Search for the
796: .Xr fnmatch 3
797: pattern
1.1 nicm 798: .Ar match-string
799: in window names, titles, and visible content (but not history).
800: If only one window is matched, it'll be automatically selected, otherwise a
801: choice list is shown.
802: This command only works from inside
803: .Nm .
804: .It Xo Ic has-session
805: .Op Fl t Ar target-session
806: .Xc
807: .D1 (alias: Ic has )
808: Report an error and exit with 1 if the specified session does not exist.
809: If it does exist, exit with 0.
1.20 nicm 810: .It Xo Ic if-shell
811: .Ar shell-command
812: .Ar command
813: .Xc
814: .D1 (alias: Ic if )
815: Execute
816: .Ar command
817: if
818: .Ar shell-command
819: returns success.
1.1 nicm 820: .It Xo Ic kill-pane
821: .Op Fl p Ar pane-index
822: .Op Fl t Ar target-window
823: .Xc
824: .D1 (alias: Ic killp )
825: Destroy the given pane.
1.36 nicm 826: If no panes remain in the containing window, it is also destroyed.
1.1 nicm 827: .It Xo Ic kill-server
828: .Xc
829: Kill the
830: .Nm
831: server and clients and destroy all sessions.
832: .It Xo Ic kill-session
833: .Op Fl t Ar target-session
834: .Xc
835: Destroy the given session, closing any windows linked to it and no other
836: sessions, and detaching all clients attached to it.
837: .It Xo Ic kill-window
838: .Op Fl t Ar target-window
839: .Xc
840: .D1 (alias: Ic killw )
841: Kill the current window or the window at
842: .Ar target-window ,
843: removing it from any sessions to which it is linked.
844: .It Xo Ic last-window
845: .Op Fl t Ar target-session
846: .Xc
847: .D1 (alias: Ic last )
848: Select the last (previously selected) window.
849: If no
850: .Ar target-session
851: is specified, select the last window of the current session.
852: .It Xo Ic link-window
853: .Op Fl dk
854: .Op Fl s Ar src-window
855: .Op Fl t Ar dst-window
856: .Xc
857: .D1 (alias: Ic linkw )
858: Link the window at
859: .Ar src-window
860: to the specified
861: .Ar dst-window .
862: If
863: .Ar dst-window
864: is specified and no such window exists, the
865: .Ar src-window
866: is linked there.
867: If
868: .Fl k
869: is given and
870: .Ar dst-window
871: exists, it is killed, otherwise an error is generated.
872: If
873: .Fl d
874: is given, the newly linked window is not selected.
875: .It Xo Ic list-buffers
876: .Op Fl t Ar target-session
877: .Xc
878: .D1 (alias: Ic lsb )
879: List the buffers in the given session.
880: .It Xo Ic list-clients
881: .Xc
882: .D1 (alias: Ic lsc )
883: List all clients attached to the server.
884: .It Xo Ic list-commands
885: .Xc
886: .D1 (alias: Ic lscm )
887: List the syntax of all commands supported by
888: .Nm .
889: .It Xo Ic list-keys
1.49 nicm 890: .Op Fl t Ar key-table
1.1 nicm 891: .Xc
892: .D1 (alias: Ic lsk )
893: List all key bindings.
1.48 nicm 894: Without
895: .Fl t
896: the primary key bindings - those executed when preceded by the prefix key -
897: are printed.
1.45 nicm 898: Keys bound without the prefix key (see
899: .Ic bind-key
900: .Fl n )
901: are enclosed in square brackets.
1.48 nicm 902: .Pp
903: With
904: .Fl t ,
905: the key bindings in
906: .Ar key-table
907: are listed; this may be one of:
908: .Em vi-edit ,
909: .Em emacs-edit ,
910: .Em vi-choice ,
911: .Em emacs-choice ,
912: .Em vi-copy
913: or
914: .Em emacs-copy .
1.1 nicm 915: .It Xo Ic list-sessions
916: .Xc
917: .D1 (alias: Ic ls )
918: List all sessions managed by the server.
919: .It Xo Ic list-windows
920: .Op Fl t Ar target-session
921: .Xc
922: .D1 (alias: Ic lsw )
923: List windows in the current session or in
924: .Ar target-session .
925: .It Xo Ic load-buffer
926: .Op Fl b Ar buffer-index
927: .Op Fl t Ar target-session
928: .Ar path
929: .Xc
930: .D1 (alias: Ic loadb )
931: Load the contents of the specified paste buffer from
932: .Ar path .
933: .It Xo Ic lock-server
934: .Xc
935: .D1 (alias: Ic lock )
936: Lock the server until a password is entered.
937: .It Xo Ic move-window
938: .Op Fl d
939: .Op Fl s Ar src-window
940: .Op Fl t Ar dst-window
941: .Xc
942: .D1 (alias: Ic movew )
943: This is similar to
944: .Ic link-window ,
945: except the window at
946: .Ar src-window
947: is moved to
948: .Ar dst-window .
949: .It Xo Ic new-session
950: .Op Fl d
951: .Op Fl n Ar window-name
952: .Op Fl s Ar session-name
953: .Op Ar command
954: .Xc
955: .D1 (alias: Ic new )
956: Create a new session with name
957: .Ar session-name .
958: The new session is attached to the current terminal unless
959: .Fl d
960: is given.
961: .Ar window-name
962: and
963: .Ar command
964: are the name of and command to execute in the initial window.
965: .It Xo Ic new-window
1.28 nicm 966: .Op Fl dk
1.1 nicm 967: .Op Fl n Ar window-name
968: .Op Fl t Ar target-window
969: .Op Ar command
970: .Xc
971: .D1 (alias: Ic neww )
972: Create a new window.
973: If
974: .Fl d
975: is given, the session does not make the new window the current window.
976: .Ar target-window
1.28 nicm 977: represents the window to be created; if the target already exists an error is
978: shown, unless the
979: .Fl k
980: flag is used, in which case it is destroyed.
1.1 nicm 981: .Ar command
982: is the command to execute.
983: If
984: .Ar command
985: is not specified, the default command is used.
986: .Pp
987: The
988: .Ev TERM
989: environment variable must be set to
990: .Dq screen
991: for all programs running
992: .Em inside
993: .Nm .
994: New windows will automatically have
995: .Dq TERM=screen
996: added to their environment, but care must be taken not to reset this in shell
997: start-up files.
998: .It Xo Ic next-layout
999: .Op Fl t Ar target-window
1000: .Xc
1001: .D1 (alias: Ic nextl )
1002: Move a window to the next layout and rearrange the panes to fit.
1003: .It Xo Ic next-window
1.9 nicm 1004: .Op Fl a
1.1 nicm 1005: .Op Fl t Ar target-session
1006: .Xc
1007: .D1 (alias: Ic next )
1008: Move to the next window in the session.
1.9 nicm 1009: If
1.12 jmc 1010: .Fl a
1.9 nicm 1011: is used, move to the next window with a bell, activity or content alert.
1.1 nicm 1012: .It Xo Ic paste-buffer
1.25 nicm 1013: .Op Fl dr
1.1 nicm 1014: .Op Fl b Ar buffer-index
1015: .Op Fl t Ar target-window
1016: .Xc
1017: .D1 (alias: Ic pasteb )
1018: Insert the contents of a paste buffer into the current window.
1.23 nicm 1019: With
1020: .Fl d ,
1021: also delete the paste buffer from the stack.
1.24 nicm 1022: When output, any linefeed (LF) characters in the paste buffer are replaced with
1023: carriage returns (CR).
1024: This translation may be disabled with the
1025: .Fl r
1026: flag.
1.1 nicm 1027: .It Xo Ic previous-window
1.9 nicm 1028: .Op Fl a
1.1 nicm 1029: .Op Fl t Ar target-session
1030: .Xc
1031: .D1 (alias: Ic prev )
1032: Move to the previous window in the session.
1.9 nicm 1033: With
1034: .Fl a ,
1035: move to the previous window with a bell, activity or content alert.
1.1 nicm 1036: .It Xo Ic refresh-client
1037: .Op Fl t Ar target-client
1038: .Xc
1039: .D1 (alias: Ic refresh )
1040: Refresh the current client if bound to a key, or a single client if one is given
1041: with
1042: .Fl t .
1043: .It Xo Ic rename-session
1044: .Op Fl t Ar target-session
1045: .Ar new-name
1046: .Xc
1047: .D1 (alias: Ic rename )
1048: Rename the session to
1049: .Ar new-name .
1050: .It Xo Ic rename-window
1051: .Op Fl t Ar target-window
1052: .Ar new-name
1053: .Xc
1054: .D1 (alias: Ic renamew )
1055: Rename the current window, or the window at
1056: .Ar target-window
1057: if specified, to
1058: .Ar new-name .
1059: .It Xo Ic resize-pane
1.39 jmc 1060: .Op Fl DLRU
1.1 nicm 1061: .Op Fl p Ar pane-index
1062: .Op Fl t Ar target-window
1063: .Op Ar adjustment
1064: .Xc
1065: .D1 (alias: Ic resizep )
1066: Resize a pane, upward with
1067: .Fl U
1.38 nicm 1068: (the default), downward with
1069: .Fl D ,
1070: to the left with
1071: .Fl L
1072: and to the right with
1.39 jmc 1073: .Fl R .
1.1 nicm 1074: The
1075: .Ar adjustment
1.38 nicm 1076: is given in lines or cells (the default is 1).
1.1 nicm 1077: .It Xo Ic respawn-window
1078: .Op Fl k
1079: .Op Fl t Ar target-window
1080: .Op Ar command
1081: .Xc
1082: .D1 (alias: Ic respawnw )
1083: Reactive a window in which the command has exited (see the
1084: .Ic remain-on-exit
1085: window option).
1086: If
1087: .Ar command
1088: is not given, the command used when the window was created is executed.
1089: The window must be already inactive, unless
1090: .Fl k
1091: is given, in which case any existing command is killed.
1092: .It Xo Ic rotate-window
1093: .Op Fl DU
1094: .Op Fl t Ar target-window
1095: .Xc
1096: .D1 (alias: Ic rotatew )
1097: Rotate the positions of the panes within a window, either upward (numerically
1098: lower) with
1099: .Fl U
1100: or downward (numerically higher).
1101: .It Xo Ic save-buffer
1102: .Op Fl a
1103: .Op Fl b Ar buffer-index
1104: .Op Fl t Ar target-session
1105: .Ar path
1106: .Xc
1107: .D1 (alias: Ic saveb )
1108: Save the contents of the specified paste buffer to
1109: .Ar path .
1110: The
1111: .Fl a
1112: option appends to rather than overwriting the file.
1113: .It Xo Ic scroll-mode
1114: .Op Fl u
1115: .Op Fl t Ar target-window
1116: .Xc
1117: Enter scroll mode.
1118: The
1119: .Fl u
1120: has the same meaning as in the
1121: .Ic copy-mode
1122: command.
1.2 nicm 1123: .It Xo Ic select-layout
1124: .Op Fl t Ar target-window
1.47 nicm 1125: .Op Ar layout-name
1.2 nicm 1126: .Xc
1.17 nicm 1127: .D1 (alias: selectl )
1.2 nicm 1128: Choose a specific layout for a window.
1.47 nicm 1129: If
1130: .Ar layout-name
1131: is not given, the last layout used (if any) is reapplied.
1.1 nicm 1132: .It Xo Ic select-pane
1133: .Op Fl p Ar pane-index
1134: .Op Fl t Ar target-window
1135: .Xc
1136: .D1 (alias: Ic selectp )
1137: Make pane
1138: .Ar pane-index
1139: the active pane in window
1140: .Ar target-window .
1141: .It Xo Ic select-prompt
1142: .Op Fl t Ar target-client
1143: .Xc
1144: Open a prompt inside
1145: .Ar target-client
1146: allowing a window index to be entered interactively.
1147: .It Xo Ic select-window
1148: .Op Fl t Ar target-window
1149: .Xc
1150: .D1 (alias: Ic selectw )
1151: Select the window at
1152: .Ar target-window .
1153: .It Xo Ic send-keys
1154: .Op Fl t Ar target-window
1155: .Ar key Ar ...
1156: .Xc
1157: .D1 (alias: Ic send )
1158: Send a key or keys to a window.
1159: Each argument
1160: .Ar key
1161: is the name of the key (such as
1162: .Ql C-a
1163: or
1164: .Ql npage
1165: ) to send; if the string is not recognised as a key, it is sent as a series of
1166: characters.
1167: All arguments are sent sequentially from first to last.
1168: .It Xo Ic send-prefix
1169: .Op Fl t Ar target-window
1170: .Xc
1171: Send the prefix key to a window as if it was pressed.
1172: .It Xo Ic server-info
1173: .Xc
1174: .D1 (alias: Ic info )
1175: Show server information and terminal details.
1176: .It Xo Ic set-buffer
1177: .Op Fl b Ar buffer-index
1178: .Op Fl t Ar target-session
1179: .Ar data
1180: .Xc
1181: .D1 (alias: Ic setb )
1182: Set the contents of the specified buffer to
1183: .Ar data .
1184: .It Xo Ic set-option
1185: .Op Fl gu
1186: .Op Fl t Ar target-session
1187: .Ar option Ar value
1188: .Xc
1189: .D1 (alias: Ic set )
1.18 nicm 1190: Set a session option.
1.1 nicm 1191: If
1192: .Fl g
1.18 nicm 1193: is specified, the global session option is set.
1.1 nicm 1194: The
1195: .Fl u
1196: flag unsets an option, so a session inherits the option from the global
1197: options - it is not possible to unset a global option.
1198: .Pp
1.18 nicm 1199: Available session options are:
1.1 nicm 1200: .Bl -tag -width Ds
1201: .It Xo Ic bell-action
1202: .Op Ic any | Ic none | Ic current
1203: .Xc
1204: Set action on window bell.
1205: .Ic any
1206: means a bell in any window linked to a session causes a bell in the current
1207: window of that session,
1208: .Ic none
1209: means all bells are ignored and
1210: .Ic current
1211: means only bell in windows other than the current window are ignored.
1212: .It Ic buffer-limit Ar number
1213: Set the number of buffers kept for each session; as new buffers are added to
1214: the top of the stack, old ones are removed from the bottom if necessary to
1215: maintain this maximum length.
1216: .It Ic default-command Ar command
1217: Set the command used for new windows (if not specified when the window is
1218: created) to
1219: .Ar command .
1.19 nicm 1220: The default is an empty string, which instructs
1221: .Nm
1222: to create a login shell using the
1223: .Ev SHELL
1224: environment variable or, if it is unset, the user's shell returned by
1225: .Xr getpwuid 3 .
1.1 nicm 1226: .It Ic default-path Ar path
1227: Set the default working directory for processes created from keys, or
1228: interactively from the prompt.
1229: The default is the current working directory when the server is started.
1.22 nicm 1230: .It Ic default-terminal Ar terminal
1231: Set the default terminal for new windows created in this session - the
1232: default value of the
1233: .Ev TERM
1234: environment variable.
1235: For
1236: .Nm
1237: to work correctly, this
1238: .Em must
1239: be set to
1240: .Ql screen
1241: or a derivative of it.
1.21 nicm 1242: .It Ic display-time Ar time
1243: Set the amount of time for which status line messages are displayed.
1244: .Ar time
1245: is in milliseconds.
1.1 nicm 1246: .It Ic history-limit Ar lines
1247: Set the maximum number of lines held in window history.
1248: This setting applies only to new windows - existing window histories are not
1249: resized and retain the limit at the point they were created.
1250: .It Ic lock-after-time Ar number
1251: Lock the server after
1252: .Ar number
1253: seconds of inactivity.
1254: The default is off (set to 0).
1255: This has no effect as a session option; it must be set as a global option using
1256: .Fl g .
1257: .It Ic message-attr Ar attributes
1258: Set status line message attributes, where
1259: .Ar attributes
1260: is either
1261: .Ic default
1262: or a comma-delimited list of one or more of:
1263: .Ic bright
1264: (or
1265: .Ic bold ) ,
1266: .Ic dim ,
1267: .Ic underscore ,
1268: .Ic blink ,
1269: .Ic reverse ,
1270: .Ic hidden ,
1271: or
1272: .Ic italics .
1273: .It Ic message-bg Ar colour
1274: Set status line message background colour, where
1275: .Ar colour
1276: is one of:
1277: .Ic black ,
1278: .Ic red ,
1279: .Ic green ,
1280: .Ic yellow ,
1281: .Ic blue ,
1282: .Ic magenta ,
1283: .Ic cyan ,
1284: .Ic white
1285: or
1286: .Ic default .
1287: .It Ic message-fg Ar colour
1288: Set status line message foreground colour.
1289: .It Ic prefix Ar key
1290: Set the current prefix key.
1.21 nicm 1291: .It Ic repeat-time Ar time
1.1 nicm 1292: Allow multiple commands to be entered without pressing the prefix-key again
1293: in the specified
1.21 nicm 1294: .Ar time
1.1 nicm 1295: milliseconds (the default is 500).
1296: Whether a key repeats may be set when it is bound using the
1297: .Fl r
1298: flag to
1299: .Ic bind-key .
1300: Repeat is enabled for the default keys of the
1.44 sthen 1301: .Ic resize-pane-up
1.1 nicm 1302: and
1303: .Ic resize-pane-down
1304: commands.
1305: .It Xo Ic set-remain-on-exit
1306: .Op Ic on | Ic off
1307: .Xc
1308: Set the
1309: .Ic remain-on-exit
1310: window option for any windows first created in this session.
1311: .It Xo Ic set-titles
1312: .Op Ic on | Ic off
1313: .Xc
1314: Attempt to set the window title using the \ee]2;...\e007 xterm code and
1315: the terminal appears to be an xterm.
1.11 nicm 1316: This option is off by default.
1.6 jmc 1317: Note that elinks
1.1 nicm 1318: will only attempt to set the window title if the STY environment
1319: variable is set.
1320: .It Xo Ic status
1321: .Op Ic on | Ic off
1322: .Xc
1323: Show or hide the status line.
1324: .It Ic status-attr Ar attributes
1325: Set status line attributes.
1326: .It Ic status-bg Ar colour
1327: Set status line background colour.
1328: .It Ic status-fg Ar colour
1329: Set status line foreground colour.
1330: .It Ic status-interval Ar interval
1331: Update the status bar every
1332: .Ar interval
1333: seconds.
1334: By default, updates will occur every 15 seconds.
1335: A setting of zero disables redrawing at interval.
1.41 nicm 1336: .It Xo Ic status-justify
1337: .Op Ic left | Ic centre | Ic right
1338: .Xc
1339: Set the position of the window list component of the status line: left, centre
1340: or right justified.
1.1 nicm 1341: .It Xo Ic status-keys
1342: .Op Ic vi | Ic emacs
1343: .Xc
1.6 jmc 1344: Use vi or emacs-style
1.1 nicm 1345: key bindings in the status line, for example at the command prompt.
1346: Defaults to emacs.
1347: .It Ic status-left Ar string
1348: Display
1349: .Ar string
1350: to the left of the status bar.
1351: .Ar string
1352: will be passed through
1353: .Xr strftime 3
1354: before being used.
1355: By default, the session name is shown.
1356: .Ar string
1357: may contain any of the following special character pairs:
1358: .Bl -column "Character pair" "Replaced with" -offset indent
1359: .It Sy "Character pair" Ta Sy "Replaced with"
1360: .It Li "#(command)" Ta "First line of command's output"
1361: .It Li "#H" Ta "Hostname of local host"
1.35 nicm 1362: .It Li "#I" Ta "Current window index"
1363: .It Li "#P" Ta "Current pane index"
1.1 nicm 1364: .It Li "#S" Ta "Session name"
1365: .It Li "#T" Ta "Current window title"
1.35 nicm 1366: .It Li "#W" Ta "Current window name"
1.1 nicm 1367: .It Li "##" Ta "A literal" Ql #
1368: .El
1369: .Pp
1370: Where appropriate, these may be prefixed with a number to specify the maximum
1371: length, for example
1372: .Ql #24T .
1.10 nicm 1373: .Pp
1.12 jmc 1374: By default, UTF-8 in
1.10 nicm 1375: .Ar string
1376: is not interpreted, to enable UTF-8, use the
1377: .Ic status-utf8
1378: option.
1.1 nicm 1379: .It Ic status-left-length Ar length
1380: Set the maximum
1381: .Ar length
1382: of the left component of the status bar.
1383: The default is 10.
1384: .It Ic status-right Ar string
1385: Display
1386: .Ar string
1387: to the right of the status bar.
1388: By default, the date and time will be shown.
1389: As with
1390: .Ic status-left ,
1391: .Ar string
1392: will be passed to
1.10 nicm 1393: .Xr strftime 3 ,
1394: character pairs are replaced, and UTF-8 is dependent on the
1395: .Ic status-utf8
1396: option.
1.1 nicm 1397: .It Ic status-right-length Ar length
1398: Set the maximum
1399: .Ar length
1400: of the right component of the status bar.
1401: The default is 40.
1.10 nicm 1402: .Pp
1403: .It Xo Ic status-utf8
1404: .Op Ic on | Ic off
1405: .Xc
1406: Instruct
1407: .Nm
1408: to treat top-bit-set characters in the
1409: .Ic status-left
1410: and
1411: .Ic status-right
1412: strings as UTF-8; notably, this is important for wide characters.
1413: This option defaults to off.
1.37 nicm 1414: .It Xo Ic visual-activity
1415: .Op Ic on | Ic off
1416: .Xc
1417: If on, display a status line message when activity occurs in a window
1.39 jmc 1418: for which the
1.37 nicm 1419: .Ic monitor-activity
1420: window option is enabled.
1421: .It Xo Ic visual-bell
1422: .Op Ic on | Ic off
1423: .Xc
1424: If this option is on, a message is shown on a bell instead of it being passed
1425: through to the terminal (which normally makes a sound).
1426: Also see the
1427: .Ic bell-action
1428: option.
1429: .It Xo Ic visual-content
1430: .Op Ic on | Ic off
1431: .Xc
1432: Like
1433: .Ic visual-activity ,
1434: display a message when content is present in a window
1.39 jmc 1435: for which the
1.37 nicm 1436: .Ic monitor-content
1437: window option is enabled.
1.1 nicm 1438: .El
1439: .It Xo Ic set-password
1440: .Op Fl c
1441: .Ar password
1442: .Xc
1443: .D1 (alias: Ic pass )
1444: Set the server password.
1445: If the
1446: .Fl c
1447: option is given, a pre-encrypted password may be specified.
1448: By default, the password is blank, thus any entered password will be accepted
1449: when unlocking the server (see the
1450: .Ic lock-server
1451: command).
1452: To prevent variable expansion when an encrypted password is read from a
1453: configuration file, enclose it in single quotes (').
1454: .It Xo Ic set-window-option
1455: .Op Fl gu
1456: .Op Fl t Ar target-window
1457: .Ar option Ar value
1458: .Xc
1459: .D1 (alias: Ic setw )
1.18 nicm 1460: Set a window option.
1.1 nicm 1461: The
1462: .Fl g
1463: and
1464: .Fl u
1465: flags work similarly to the
1466: .Ic set-option
1467: command.
1468: .Pp
1.18 nicm 1469: Supported window options are:
1.1 nicm 1470: .Bl -tag -width Ds
1471: .It Xo Ic aggressive-resize
1472: .Op Ic on | Ic off
1473: .Xc
1474: Aggressively resize the chosen window.
1475: This means that
1476: .Nm
1477: will resize the window to the size of the smallest session for which it is the
1478: current window, rather than the smallest session to which it is attached.
1479: The window may resize when the current window is changed on another sessions;
1.6 jmc 1480: this option is good for full-screen programs which support
1481: .Dv SIGWINCH
1482: and poor for interactive programs such as shells.
1.1 nicm 1483: .It Xo Ic automatic-rename
1484: .Op Ic on | Ic off
1485: .Xc
1486: Control automatic window renaming.
1487: When this setting is enabled,
1488: .Nm
1489: will attempt - on supported platforms - to rename the window to reflect the
1490: command currently running in it.
1491: This flag is automatically disabled for an individual window when a name
1492: is specified at creation with
1493: .Ic new-window or
1494: .Ic new-session ,
1495: or later with
1496: .Ic rename-window .
1497: It may be switched off globally with:
1498: .Bd -literal -offset indent
1499: set-window-option -g automatic-rename off
1500: .Ed
1501: .It Ic clock-mode-colour Ar colour
1502: Set clock colour.
1503: .It Xo Ic clock-mode-style
1504: .Op Ic 12 | Ic 24
1505: .Xc
1506: Set clock hour format.
1507: .It Ic force-height Ar height
1508: .It Ic force-width Ar width
1509: Prevent
1510: .Nm
1511: from resizing a window to greater than
1512: .Ar width
1513: or
1514: .Ar height .
1515: A value of zero restores the default unlimited setting.
1.2 nicm 1516: .It Ic main-pane-width Ar width
1517: .It Ic main-pane-height Ar height
1518: Set the width or height of the main (left or top) pane in the
1519: .Ic main-horizontal
1520: or
1521: .Ic main-vertical
1522: layouts.
1.1 nicm 1523: .It Ic mode-attr Ar attributes
1524: Set window modes attributes.
1525: .It Ic mode-bg Ar colour
1526: Set window modes background colour.
1527: .It Ic mode-fg Ar colour
1528: Set window modes foreground colour.
1529: .It Xo Ic mode-keys
1530: .Op Ic vi | Ic emacs
1531: .Xc
1.50 nicm 1532: Use vi or emacs-style key bindings in scroll, copy and choice modes.
1.1 nicm 1533: Key bindings default to emacs.
1.50 nicm 1534: .It Xo Ic mode-mouse
1535: .Op Ic on | Ic off
1536: .Xc
1.51 ! jmc 1537: Mouse state in modes.
! 1538: If on,
1.50 nicm 1539: .Nm
1540: will respond to mouse clicks by moving the cursor in copy mode or selecting an
1541: option in choice mode.
1.1 nicm 1542: .It Xo Ic monitor-activity
1543: .Op Ic on | Ic off
1544: .Xc
1545: Monitor for activity in the window.
1546: Windows with activity are highlighted in the status line.
1547: .It Xo Ic monitor-content Ar match-string
1548: .Xc
1.6 jmc 1549: Monitor content in the window.
1550: When
1.16 nicm 1551: .Xr fnmatch 3
1552: pattern
1.1 nicm 1553: .Ar match-string
1554: appears in the window, it is highlighted in the status line.
1555: .It Xo Ic remain-on-exit
1556: .Op Ic on | Ic off
1557: .Xc
1558: A window with this flag set is not destroyed when the program running in it
1559: exits.
1560: The window may be reactivated with the
1561: .Ic respawn-window
1562: command.
1563: .It Xo Ic utf8
1564: .Op Ic on | Ic off
1565: .Xc
1566: Instructs
1567: .Nm
1568: to expect UTF-8 sequences to appear in this window.
1569: .It Ic window-status-attr Ar attributes
1570: Set status line attributes for a single window.
1571: .It Ic window-status-bg Ar colour
1572: Set status line background colour for a single window.
1573: .It Ic window-status-fg Ar colour
1574: Set status line foreground colour for a single window.
1.40 nicm 1575: .It Ic window-status-current-attr Ar attributes
1576: Set status line attributes for the currently active window.
1577: .It Ic window-status-current-bg Ar colour
1578: Set status line background colour for the currently active window.
1579: .It Ic window-status-current-fg Ar colour
1580: Set status line foreground colour for the currently active window.
1.1 nicm 1581: .It Xo Ic xterm-keys
1582: .Op Ic on | Ic off
1583: .Xc
1584: If this option is set,
1585: .Nm
1586: will generate
1587: .Xr xterm 1 -style
1588: function key sequences; these have a number included to indicate modifiers such
1.6 jmc 1589: as Shift, Alt or Ctrl.
1.1 nicm 1590: .El
1591: .It Xo Ic show-buffer
1592: .Op Fl b Ar buffer-index
1593: .Op Fl t Ar target-session
1594: .Xc
1595: .D1 (alias: Ic showb )
1596: Display the contents of the specified buffer.
1597: .It Xo Ic show-options
1.18 nicm 1598: .Op Fl g
1.1 nicm 1599: .Op Fl t Ar target-session
1600: .Xc
1601: .D1 (alias: Ic show )
1.18 nicm 1602: Show the session options for
1603: .Ar target session ,
1604: or the global session options with
1605: .Fl g .
1.1 nicm 1606: .It Xo Ic show-window-options
1.18 nicm 1607: .Op Fl g
1.1 nicm 1608: .Op Fl t Ar target-window
1609: .Xc
1610: .D1 (alias: Ic showw )
1.18 nicm 1611: List the window options for
1612: .Ar target-window ,
1613: or the global window options if
1614: .Fl g
1615: is used.
1.1 nicm 1616: .It Xo Ic source-file
1617: .Ar path
1618: .Xc
1619: .D1 (alias: Ic source )
1620: Execute commands from
1621: .Ar path .
1622: .It Xo Ic split-window
1.38 nicm 1623: .Op Fl dhv
1.1 nicm 1624: .Oo Fl l
1.38 nicm 1625: .Ar size |
1.1 nicm 1626: .Fl p Ar percentage Oc
1627: .Op Fl t Ar target-window
1628: .Op Ar command
1629: .Xc
1630: .D1 (alias: splitw )
1.38 nicm 1631: Creates a new pane by splitting the active pane:
1632: .Fl h
1633: does a horizontal split and
1634: .Fl v
1635: a vertical split; if neither is specified,
1636: .Fl v
1637: is assumed.
1.1 nicm 1638: The
1639: .Fl l
1640: and
1641: .Fl p
1.38 nicm 1642: options specify the size of the new window in lines (for vertical split) or in
1643: cells (for horizontal split), or as a percentage, respectively.
1.1 nicm 1644: All other options have the same meaning as in the
1645: .Ic new-window
1646: command.
1647: .It Xo Ic start-server
1648: .Xc
1649: .D1 (alias: Ic start )
1650: Start the
1651: .Nm
1652: server, if not already running, without creating any sessions.
1653: .It Xo Ic suspend-client
1654: .Op Fl c target-client
1655: .Xc
1656: .D1 (alias: Ic suspendc )
1.6 jmc 1657: Suspend a client by sending
1658: .Dv SIGTSTP
1659: (tty stop).
1.1 nicm 1660: .It Xo Ic swap-pane
1661: .Op Fl dDU
1662: .Op Fl p Ar src-index
1663: .Op Fl t Ar target-window
1664: .Op Fl q Ar dst-index
1665: .Xc
1666: .D1 (alias: Ic swapp )
1667: Swap two panes within a window.
1668: If
1669: .Fl U
1670: is used, the pane is swapped with the pane above (before it numerically);
1671: .Fl D
1672: swaps with the pane below (the next numerically); or
1673: .Ar dst-index
1674: may be give to swap with a specific pane.
1675: .It Xo Ic swap-window
1676: .Op Fl d
1677: .Op Fl s Ar src-window
1678: .Op Fl t Ar dst-window
1679: .Xc
1680: .D1 (alias: Ic swapw )
1681: This is similar to
1682: .Ic link-window ,
1683: except the source and destination windows are swapped.
1684: It is an error if no window exists at
1685: .Ar src-window .
1686: .It Xo Ic switch-client
1.32 nicm 1687: .Op Fl c Ar target-client
1688: .Op Fl t Ar target-session
1.1 nicm 1689: .Xc
1690: .D1 (alias: Ic switchc )
1691: Switch the current session for client
1692: .Ar target-client
1693: to
1694: .Ar target-session .
1695: .It Xo Ic unbind-key
1.49 nicm 1696: .Op Fl cn
1697: .Op Fl t Ar key-table
1.1 nicm 1698: .Ar key
1699: .Xc
1700: .D1 (alias: Ic unbind )
1.42 nicm 1701: Unbind the command bound to
1.1 nicm 1702: .Ar key .
1.49 nicm 1703: Without
1704: .Fl t
1705: the primary key bindings are modified; in this case, if
1.45 nicm 1706: .Fl n
1707: is specified, the command bound to
1708: .Ar key
1709: without a prefix (if any) is removed.
1.49 nicm 1710: .Pp
1711: If
1712: .Fl t
1713: is present,
1714: .Ar key
1715: in
1716: .Ar key-table
1717: is unbound: the binding for command mode with
1718: .Fl c
1719: or for normal mode without.
1.1 nicm 1720: .It Xo Ic unlink-window
1.31 nicm 1721: .Op Fl k
1.1 nicm 1722: .Op Fl t Ar target-window
1723: .Xc
1724: .D1 (alias: Ic unlinkw )
1725: Unlink
1726: .Ar target-window .
1.31 nicm 1727: Unless
1728: .Fl k
1729: is given, a window may be unlinked only if it is linked to multiple sessions -
1730: windows may not be linked to no sessions;
1731: if
1732: .Fl k
1733: is specified and the window is linked to only one session, it is unlinked and
1734: destroyed.
1.1 nicm 1735: .It Xo Ic up-pane
1736: .Op Fl p Ar pane-index
1737: .Op Fl t Ar target-window
1738: .Xc
1739: .D1 (alias: Ic upp )
1740: Move up a pane.
1741: .El
1742: .Sh FILES
1.26 nicm 1743: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 1744: .It Pa ~/.tmux.conf
1.6 jmc 1745: Default
1.1 nicm 1746: .Nm
1.6 jmc 1747: configuration file.
1.26 nicm 1748: .It Pa /etc/tmux.conf
1749: System-wide configuration file.
1.1 nicm 1750: .El
1751: .Sh SEE ALSO
1752: .Xr pty 4
1753: .Sh AUTHORS
1754: .An Nicholas Marriott Aq nicm@users.sourceforge.net