Annotation of src/usr.bin/tmux/tmux.1, Revision 1.771
1.771 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.770 2020/05/16 16:26:34 nicm Exp $
1.1 nicm 2: .\"
1.477 nicm 3: .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
1.1 nicm 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.752 nicm 17: .Dd $Mdocdate: May 16 2020 $
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.767 nicm 26: .Op Fl 2CDluvV
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
1.744 nicm 31: .Op Fl T Ar features
1.1 nicm 32: .Op Ar command Op Ar flags
33: .Ek
34: .Sh DESCRIPTION
35: .Nm
1.59 jmc 36: is a terminal multiplexer:
37: it enables a number of terminals to be created, accessed, and
38: controlled from a single screen.
1.67 jmc 39: .Nm
40: may be detached from a screen
41: and continue running in the background,
42: then later reattached.
1.1 nicm 43: .Pp
1.60 nicm 44: When
45: .Nm
46: is started it creates a new
47: .Em session
48: with a single
49: .Em window
50: and displays it on screen.
51: A status line at the bottom of the screen
52: shows information on the current session
53: and is used to enter interactive commands.
54: .Pp
55: A session is a single collection of
56: .Em pseudo terminals
57: under the management of
58: .Nm .
59: Each session has one or more
60: windows linked to it.
61: A window occupies the entire screen
62: and may be split into rectangular panes,
63: each of which is a separate pseudo terminal
64: (the
65: .Xr pty 4
66: manual page documents the technical details of pseudo terminals).
67: Any number of
68: .Nm
69: instances may connect to the same session,
70: and any number of windows may be present in the same session.
71: Once all sessions are killed,
72: .Nm
73: exits.
74: .Pp
1.64 nicm 75: Each session is persistent and will survive accidental disconnection
1.66 jmc 76: (such as
1.64 nicm 77: .Xr ssh 1
1.67 jmc 78: connection timeout) or intentional detaching (with the
1.64 nicm 79: .Ql C-b d
80: key strokes).
81: .Nm
82: may be reattached using:
83: .Pp
84: .Dl $ tmux attach
1.60 nicm 85: .Pp
1.64 nicm 86: In
87: .Nm ,
88: a session is displayed on screen by a
89: .Em client
90: and all sessions are managed by a single
91: .Em server .
92: The server and each client are separate processes which communicate through a
93: socket in
94: .Pa /tmp .
1.65 nicm 95: .Pp
1.1 nicm 96: The options are as follows:
97: .Bl -tag -width "XXXXXXXXXXXX"
98: .It Fl 2
99: Force
100: .Nm
101: to assume the terminal supports 256 colours.
1.744 nicm 102: This is equivalent to
103: .Fl T Ar 256 .
1.345 nicm 104: .It Fl C
1.369 nicm 105: Start in control mode (see the
106: .Sx CONTROL MODE
107: section).
1.345 nicm 108: Given twice
109: .Xo ( Fl CC ) Xc
110: disables echo.
1.91 nicm 111: .It Fl c Ar shell-command
112: Execute
113: .Ar shell-command
114: using the default shell.
115: If necessary, the
116: .Nm
117: server will be started to retrieve the
118: .Ic default-shell
119: option.
1.153 nicm 120: This option is for compatibility with
121: .Xr sh 1
122: when
123: .Nm
124: is used as a login shell.
1.767 nicm 125: .It Fl D
126: Do not start the
127: .Nm
128: server as a daemon.
129: This also turns the
130: .Ic exit-empty
131: option off.
132: With
133: .Fl D ,
134: .Ar command
135: may not be specified.
1.1 nicm 136: .It Fl f Ar file
137: Specify an alternative configuration file.
138: By default,
139: .Nm
1.26 nicm 140: loads the system configuration file from
141: .Pa /etc/tmux.conf ,
142: if present, then looks for a user configuration file at
1.1 nicm 143: .Pa ~/.tmux.conf .
1.306 nicm 144: .Pp
1.1 nicm 145: The configuration file is a set of
146: .Nm
147: commands which are executed in sequence when the server is first started.
1.306 nicm 148: .Nm
149: loads configuration files once when the server process has started.
150: The
151: .Ic source-file
152: command may be used to load a file later.
1.61 nicm 153: .Pp
154: .Nm
1.306 nicm 155: shows any error messages from commands in configuration files in the first
156: session created, and continues to process the rest of the configuration file.
1.1 nicm 157: .It Fl L Ar socket-name
158: .Nm
159: stores the server socket in a directory under
1.455 nicm 160: .Ev TMUX_TMPDIR
161: or
1.208 nicm 162: .Pa /tmp
1.455 nicm 163: if it is unset.
1.355 nicm 164: The default socket is named
1.1 nicm 165: .Em default .
166: This option allows a different socket name to be specified, allowing several
167: independent
168: .Nm
169: servers to be run.
170: Unlike
171: .Fl S
172: a full path is not necessary: the sockets are all created in the same
173: directory.
1.2 nicm 174: .Pp
175: If the socket is accidentally removed, the
1.6 jmc 176: .Dv SIGUSR1
1.2 nicm 177: signal may be sent to the
178: .Nm
1.422 nicm 179: server process to recreate it (note that this will fail if any parent
180: directories are missing).
1.166 sobrado 181: .It Fl l
182: Behave as a login shell.
183: This flag currently has no effect and is for compatibility with other shells
184: when using tmux as a login shell.
1.1 nicm 185: .It Fl S Ar socket-path
186: Specify a full alternative path to the server socket.
187: If
188: .Fl S
189: is specified, the default socket directory is not used and any
190: .Fl L
191: flag is ignored.
192: .It Fl u
1.644 schwarze 193: Write UTF-8 output to the terminal even if the first environment
194: variable of
1.14 nicm 195: .Ev LC_ALL ,
1.644 schwarze 196: .Ev LC_CTYPE ,
197: or
1.2 nicm 198: .Ev LANG
1.644 schwarze 199: that is set does not contain
200: .Qq UTF-8
201: or
202: .Qq UTF8 .
1.744 nicm 203: This is equivalent to
204: .Fl T Ar UTF-8 .
205: .It Fl T Ar features
206: Set terminal features for the client.
207: This is a comma-separated list of features.
208: See the
209: .Ic terminal-features
210: option.
1.1 nicm 211: .It Fl v
212: Request verbose logging.
213: Log messages will be saved into
214: .Pa tmux-client-PID.log
215: and
216: .Pa tmux-server-PID.log
217: files in the current directory, where
218: .Em PID
1.6 jmc 219: is the PID of the server or client process.
1.558 nicm 220: If
221: .Fl v
222: is specified twice, an additional
223: .Pa tmux-out-PID.log
224: file is generated with a copy of everything
225: .Nm
226: writes to the terminal.
227: .Pp
228: The
229: .Dv SIGUSR2
230: signal may be sent to the
231: .Nm
232: server process to toggle logging between on (as if
233: .Fl v
234: was given) and off.
1.708 nicm 235: .It Fl V
236: Report the
237: .Nm
238: version.
1.1 nicm 239: .It Ar command Op Ar flags
240: This specifies one of a set of commands used to control
241: .Nm ,
1.6 jmc 242: as described in the following sections.
1.59 jmc 243: If no commands are specified, the
1.1 nicm 244: .Ic new-session
245: command is assumed.
1.57 jmc 246: .El
1.627 nicm 247: .Sh DEFAULT KEY BINDINGS
1.64 nicm 248: .Nm
249: may be controlled from an attached client by using a key combination of a
250: prefix key,
251: .Ql C-b
252: (Ctrl-b) by default, followed by a command key.
253: .Pp
1.172 nicm 254: The default command key bindings are:
1.64 nicm 255: .Pp
1.171 nicm 256: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
257: .It C-b
258: Send the prefix key (C-b) through to the application.
259: .It C-o
260: Rotate the panes in the current window forwards.
261: .It C-z
262: Suspend the
263: .Nm
264: client.
265: .It !
266: Break the current pane out of the window.
267: .It \&"
1.625 nicm 268: .\" "
1.171 nicm 269: Split the current pane into two, top and bottom.
270: .It #
271: List all paste buffers.
1.236 nicm 272: .It $
273: Rename the current session.
1.171 nicm 274: .It %
275: Split the current pane into two, left and right.
276: .It &
277: Kill the current window.
278: .It '
279: Prompt for a window index to select.
1.412 nicm 280: .It \&(
281: Switch the attached client to the previous session.
282: .It \&)
283: Switch the attached client to the next session.
1.171 nicm 284: .It ,
285: Rename the current window.
286: .It -
287: Delete the most recently copied buffer of text.
288: .It .
289: Prompt for an index to move the current window.
290: .It 0 to 9
291: Select windows 0 to 9.
292: .It :
293: Enter the
294: .Nm
295: command prompt.
1.187 nicm 296: .It ;
297: Move to the previously active pane.
1.178 nicm 298: .It =
299: Choose which buffer to paste interactively from a list.
1.171 nicm 300: .It \&?
301: List all key bindings.
302: .It D
303: Choose a client to detach.
1.412 nicm 304: .It L
305: Switch the attached client back to the last session.
1.182 jmc 306: .It \&[
1.171 nicm 307: Enter copy mode to copy text or view the history.
1.182 jmc 308: .It \&]
1.171 nicm 309: Paste the most recently copied buffer of text.
1.64 nicm 310: .It c
1.65 nicm 311: Create a new window.
1.64 nicm 312: .It d
1.65 nicm 313: Detach the current client.
1.171 nicm 314: .It f
315: Prompt to search for text in open windows.
316: .It i
317: Display some information about the current window.
1.64 nicm 318: .It l
1.65 nicm 319: Move to the previously selected window.
1.684 nicm 320: .It m
321: Mark the current pane (see
322: .Ic select-pane
323: .Fl m ) .
324: .It M
325: Clear the marked pane.
1.64 nicm 326: .It n
1.65 nicm 327: Change to the next window.
1.171 nicm 328: .It o
329: Select the next pane in the current window.
1.64 nicm 330: .It p
1.65 nicm 331: Change to the previous window.
1.171 nicm 332: .It q
333: Briefly display pane indexes.
334: .It r
335: Force redraw of the attached client.
336: .It s
337: Select a new session for the attached client interactively.
338: .It t
339: Show the time.
340: .It w
341: Choose the current window interactively.
342: .It x
343: Kill the current pane.
1.412 nicm 344: .It z
345: Toggle zoom state of the current pane.
1.171 nicm 346: .It {
347: Swap the current pane with the previous pane.
348: .It }
349: Swap the current pane with the next pane.
350: .It ~
351: Show previous messages from
352: .Nm ,
353: if any.
354: .It Page Up
355: Enter copy mode and scroll one page up.
356: .It Up, Down
357: .It Left, Right
358: Change to the pane above, below, to the left, or to the right of the current
359: pane.
360: .It M-1 to M-5
361: Arrange panes in one of the five preset layouts: even-horizontal,
362: even-vertical, main-horizontal, main-vertical, or tiled.
1.412 nicm 363: .It Space
364: Arrange the current window in the next preset layout.
1.171 nicm 365: .It M-n
366: Move to the next window with a bell or activity marker.
367: .It M-o
368: Rotate the panes in the current window backwards.
369: .It M-p
370: Move to the previous window with a bell or activity marker.
371: .It C-Up, C-Down
372: .It C-Left, C-Right
373: Resize the current pane in steps of one cell.
374: .It M-Up, M-Down
375: .It M-Left, M-Right
376: Resize the current pane in steps of five cells.
1.64 nicm 377: .El
378: .Pp
379: Key bindings may be changed with the
380: .Ic bind-key
381: and
382: .Ic unbind-key
383: commands.
1.651 nicm 384: .Sh COMMAND PARSING AND EXECUTION
385: .Nm
386: supports a large number of commands which can be used to control its
387: behaviour.
388: Each command is named and can accept zero or more flags and arguments.
389: They may be bound to a key with the
390: .Ic bind-key
391: command or run from the shell prompt, a shell script, a configuration file or
392: the command prompt.
393: For example, the same
394: .Ic set-option
395: command run from the shell prompt, from
396: .Pa ~/.tmux.conf
397: and bound to a key may look like:
398: .Bd -literal -offset indent
399: $ tmux set-option -g status-style bg=cyan
400:
401: set-option -g status-style bg=cyan
402:
403: bind-key C set-option -g status-style bg=cyan
404: .Ed
405: .Pp
406: Here, the command name is
407: .Ql set-option ,
408: .Ql Fl g
409: is a flag and
410: .Ql status-style
411: and
412: .Ql bg=cyan
413: are arguments.
414: .Pp
415: .Nm
416: distinguishes between command parsing and execution.
417: In order to execute a command,
418: .Nm
419: needs it to be split up into its name and arguments.
420: This is command parsing.
421: If a command is run from the shell, the shell parses it; from inside
422: .Nm
423: or from a configuration file,
424: .Nm
425: does.
426: Examples of when
427: .Nm
428: parses commands are:
429: .Bl -dash -offset indent
430: .It
431: in a configuration file;
432: .It
433: typed at the command prompt (see
434: .Ic command-prompt ) ;
435: .It
436: given to
437: .Ic bind-key ;
438: .It
439: passed as arguments to
440: .Ic if-shell
441: or
442: .Ic confirm-before .
443: .El
444: .Pp
445: To execute commands, each client has a
446: .Ql command queue .
447: A global command queue not attached to any client is used on startup
448: for configuration files like
449: .Pa ~/.tmux.conf .
450: Parsed commands added to the queue are executed in order.
451: Some commands, like
452: .Ic if-shell
453: and
454: .Ic confirm-before ,
455: parse their argument to create a new command which is inserted immediately
456: after themselves.
457: This means that arguments can be parsed twice or more - once when the parent command (such as
458: .Ic if-shell )
459: is parsed and again when it parses and executes its command.
460: Commands like
461: .Ic if-shell ,
462: .Ic run-shell
463: and
464: .Ic display-panes
465: stop execution of subsequent commands on the queue until something happens -
466: .Ic if-shell
467: and
468: .Ic run-shell
469: until a shell command finishes and
470: .Ic display-panes
471: until a key is pressed.
472: For example, the following commands:
473: .Bd -literal -offset indent
474: new-session; new-window
475: if-shell "true" "split-window"
476: kill-session
477: .Ed
478: .Pp
479: Will execute
480: .Ic new-session ,
481: .Ic new-window ,
482: .Ic if-shell ,
483: the shell command
484: .Xr true 1 ,
1.671 nicm 485: .Ic split-window
1.651 nicm 486: and
487: .Ic kill-session
488: in that order.
489: .Pp
490: The
491: .Sx COMMANDS
492: section lists the
493: .Nm
494: commands and their arguments.
495: .Sh PARSING SYNTAX
496: This section describes the syntax of commands parsed by
497: .Nm ,
498: for example in a configuration file or at the command prompt.
1.671 nicm 499: Note that when commands are entered into the shell, they are parsed by the shell
1.651 nicm 500: - see for example
501: .Xr ksh 1
502: or
503: .Xr csh 1 .
504: .Pp
505: Each command is terminated by a newline or a semicolon (;).
506: Commands separated by semicolons together form a
507: .Ql command sequence
508: - if a command in the sequence encounters an error, no subsequent commands are
509: executed.
510: .Pp
511: Comments are marked by the unquoted # character - any remaining text after a
512: comment is ignored until the end of the line.
513: .Pp
514: If the last character of a line is \e, the line is joined with the following
515: line (the \e and the newline are completely removed).
516: This is called line continuation and applies both inside and outside quoted
1.656 nicm 517: strings and in comments, but not inside braces.
1.651 nicm 518: .Pp
1.655 nicm 519: Command arguments may be specified as strings surrounded by single (') quotes,
520: double quotes (") or braces ({}).
1.651 nicm 521: .\" "
522: This is required when the argument contains any special character.
1.655 nicm 523: Single and double quoted strings cannot span multiple lines except with line
524: continuation.
525: Braces can span multiple lines.
1.651 nicm 526: .Pp
527: Outside of quotes and inside double quotes, these replacements are performed:
528: .Bl -dash -offset indent
529: .It
530: Environment variables preceded by $ are replaced with their value from the
531: global environment (see the
532: .Sx GLOBAL AND SESSION ENVIRONMENT
533: section).
534: .It
535: A leading ~ or ~user is expanded to the home directory of the current or
536: specified user.
537: .It
538: \euXXXX or \euXXXXXXXX is replaced by the Unicode codepoint corresponding to
539: the given four or eight digit hexadecimal number.
540: .It
541: When preceded (escaped) by a \e, the following characters are replaced: \ee by
542: the escape character; \er by a carriage return; \en by a newline; and \et by a
543: tab.
1.660 nicm 544: .It
545: \eooo is replaced by a character of the octal value ooo.
546: Three octal digits are required, for example \e001.
547: The largest valid character is \e377.
548: .It
1.651 nicm 549: Any other characters preceded by \e are replaced by themselves (that is, the \e
550: is removed) and are not treated as having any special meaning - so for example
551: \e; will not mark a command sequence and \e$ will not expand an environment
552: variable.
553: .El
554: .Pp
1.655 nicm 555: Braces are similar to single quotes in that the text inside is taken literally
1.656 nicm 556: without any replacements but this also includes line continuation.
557: Braces can span multiple lines in which case a literal newline is included in the
558: string.
1.655 nicm 559: They are designed to avoid the need for additional escaping when passing a group
560: of
561: .Nm
562: or shell commands as an argument (for example to
563: .Ic if-shell
564: or
565: .Ic pipe-pane ) .
566: These two examples produce an identical command - note that no escaping is
567: needed when using {}:
568: .Bd -literal -offset indent
569: if-shell true {
570: display -p 'brace-dollar-foo: }$foo'
571: }
572:
573: if-shell true "\en display -p 'brace-dollar-foo: }\e$foo'\en"
574: .Ed
575: .Pp
576: Braces may be enclosed inside braces, for example:
577: .Bd -literal -offset indent
578: bind x if-shell "true" {
579: if-shell "true" {
1.706 nicm 580: display "true!"
1.655 nicm 581: }
582: }
583: .Ed
584: .Pp
1.651 nicm 585: Environment variables may be set by using the syntax
586: .Ql name=value ,
587: for example
588: .Ql HOME=/home/user .
589: Variables set during parsing are added to the global environment.
1.728 nicm 590: A hidden variable may be set with
591: .Ql %hidden ,
592: for example:
593: .Bd -literal -offset indent
594: %hidden MYVAR=42
595: .Ed
596: .Pp
597: Hidden variables are not passed to the environment of processes created
598: by tmux.
599: See the
600: .Sx GLOBAL AND SESSION ENVIRONMENT
601: section.
1.651 nicm 602: .Pp
603: Commands may be parsed conditionally by surrounding them with
604: .Ql %if ,
605: .Ql %elif ,
606: .Ql %else
607: and
608: .Ql %endif .
609: The argument to
610: .Ql %if
611: and
612: .Ql %elif
613: is expanded as a format (see
614: .Sx FORMATS )
615: and if it evaluates to false (zero or empty), subsequent text is ignored until
616: the closing
617: .Ql %elif ,
618: .Ql %else
619: or
620: .Ql %endif .
621: For example:
622: .Bd -literal -offset indent
1.666 nicm 623: %if "#{==:#{host},myhost}"
1.651 nicm 624: set -g status-style bg=red
1.666 nicm 625: %elif "#{==:#{host},myotherhost}"
1.651 nicm 626: set -g status-style bg=green
627: %else
628: set -g status-style bg=blue
629: %endif
630: .Ed
631: .Pp
632: Will change the status line to red if running on
633: .Ql myhost ,
634: green if running on
635: .Ql myotherhost ,
636: or blue if running on another host.
637: Conditionals may be given on one line, for example:
638: .Bd -literal -offset indent
639: %if #{==:#{host},myhost} set -g status-style bg=red %endif
640: .Ed
1.57 jmc 641: .Sh COMMANDS
1.651 nicm 642: This section describes the commands supported by
1.57 jmc 643: .Nm .
644: Most commands accept the optional
645: .Fl t
1.432 nicm 646: (and sometimes
647: .Fl s )
1.57 jmc 648: argument with one of
649: .Ar target-client ,
1.678 nicm 650: .Ar target-session ,
1.57 jmc 651: .Ar target-window ,
652: or
653: .Ar target-pane .
654: These specify the client, session, window or pane which a command should affect.
1.423 nicm 655: .Pp
1.57 jmc 656: .Ar target-client
1.540 nicm 657: should be the name of the client,
658: typically the
1.57 jmc 659: .Xr pty 4
660: file to which the client is connected, for example either of
661: .Pa /dev/ttyp1
662: or
663: .Pa ttyp1
664: for the client attached to
665: .Pa /dev/ttyp1 .
1.423 nicm 666: If no client is specified,
667: .Nm
668: attempts to work out the client currently in use; if that fails, an error is
669: reported.
1.57 jmc 670: Clients may be listed with the
671: .Ic list-clients
672: command.
1.1 nicm 673: .Pp
1.57 jmc 674: .Ar target-session
1.423 nicm 675: is tried as, in order:
676: .Bl -enum -offset Ds
677: .It
678: A session ID prefixed with a $.
679: .It
680: An exact name of a session (as listed by the
1.57 jmc 681: .Ic list-sessions
1.423 nicm 682: command).
683: .It
684: The start of a session name, for example
685: .Ql mysess
686: would match a session named
687: .Ql mysession .
688: .It
689: An
1.57 jmc 690: .Xr fnmatch 3
1.423 nicm 691: pattern which is matched against the session name.
692: .El
693: .Pp
1.441 nicm 694: If the session name is prefixed with an
695: .Ql = ,
1.435 nicm 696: only an exact match is accepted (so
697: .Ql =mysess
698: will only match exactly
699: .Ql mysess ,
700: not
701: .Ql mysession ) .
1.441 nicm 702: .Pp
1.423 nicm 703: If a single session is found, it is used as the target session; multiple matches
1.57 jmc 704: produce an error.
705: If a session is omitted, the current session is used if available; if no
1.117 nicm 706: current session is available, the most recently used is chosen.
1.1 nicm 707: .Pp
1.57 jmc 708: .Ar target-window
1.472 nicm 709: (or
710: .Ar src-window
711: or
712: .Ar dst-window )
1.57 jmc 713: specifies a window in the form
714: .Em session Ns \&: Ns Em window .
715: .Em session
716: follows the same rules as for
717: .Ar target-session ,
718: and
719: .Em window
1.423 nicm 720: is looked for in order as:
721: .Bl -enum -offset Ds
722: .It
723: A special token, listed below.
724: .It
725: A window index, for example
726: .Ql mysession:1
727: is window 1 in session
728: .Ql mysession .
729: .It
730: A window ID, such as @1.
731: .It
732: An exact window name, such as
733: .Ql mysession:mywindow .
734: .It
735: The start of a window name, such as
736: .Ql mysession:mywin .
737: .It
738: As an
1.57 jmc 739: .Xr fnmatch 3
1.423 nicm 740: pattern matched against the window name.
741: .El
742: .Pp
1.435 nicm 743: Like sessions, a
744: .Ql =
745: prefix will do an exact match only.
1.57 jmc 746: An empty window name specifies the next unused index if appropriate (for
747: example the
748: .Ic new-window
749: and
750: .Ic link-window
751: commands)
752: otherwise the current window in
753: .Em session
754: is chosen.
1.423 nicm 755: .Pp
1.424 nicm 756: The following special tokens are available to indicate particular windows.
757: Each has a single-character alternative form.
1.423 nicm 758: .Bl -column "XXXXXXXXXX" "X"
759: .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
760: .It Li "{start}" Ta "^" Ta "The lowest-numbered window"
761: .It Li "{end}" Ta "$" Ta "The highest-numbered window"
762: .It Li "{last}" Ta "!" Ta "The last (previously current) window"
763: .It Li "{next}" Ta "+" Ta "The next window by number"
764: .It Li "{previous}" Ta "-" Ta "The previous window by number"
765: .El
1.1 nicm 766: .Pp
1.57 jmc 767: .Ar target-pane
1.472 nicm 768: (or
769: .Ar src-pane
770: or
771: .Ar dst-pane )
772: may be a pane ID or takes a similar form to
1.57 jmc 773: .Ar target-window
1.423 nicm 774: but with the optional addition of a period followed by a pane index or pane ID,
775: for example:
776: .Ql mysession:mywindow.1 .
1.57 jmc 777: If the pane index is omitted, the currently active pane in the specified
778: window is used.
1.423 nicm 779: The following special tokens are available for the pane index:
780: .Bl -column "XXXXXXXXXXXXXX" "X"
781: .It Sy "Token" Ta Sy "" Ta Sy "Meaning"
782: .It Li "{last}" Ta "!" Ta "The last (previously active) pane"
783: .It Li "{next}" Ta "+" Ta "The next pane by number"
784: .It Li "{previous}" Ta "-" Ta "The previous pane by number"
785: .It Li "{top}" Ta "" Ta "The top pane"
786: .It Li "{bottom}" Ta "" Ta "The bottom pane"
787: .It Li "{left}" Ta "" Ta "The leftmost pane"
788: .It Li "{right}" Ta "" Ta "The rightmost pane"
789: .It Li "{top-left}" Ta "" Ta "The top-left pane"
790: .It Li "{top-right}" Ta "" Ta "The top-right pane"
791: .It Li "{bottom-left}" Ta "" Ta "The bottom-left pane"
792: .It Li "{bottom-right}" Ta "" Ta "The bottom-right pane"
1.447 nicm 793: .It Li "{up-of}" Ta "" Ta "The pane above the active pane"
794: .It Li "{down-of}" Ta "" Ta "The pane below the active pane"
795: .It Li "{left-of}" Ta "" Ta "The pane to the left of the active pane"
796: .It Li "{right-of}" Ta "" Ta "The pane to the right of the active pane"
1.423 nicm 797: .El
1.177 nicm 798: .Pp
1.423 nicm 799: The tokens
1.177 nicm 800: .Ql +
801: and
802: .Ql -
803: may be followed by an offset, for example:
804: .Bd -literal -offset indent
805: select-window -t:+2
806: .Ed
807: .Pp
1.432 nicm 808: In addition,
809: .Em target-session ,
810: .Em target-window
811: or
812: .Em target-pane
813: may consist entirely of the token
814: .Ql {mouse}
815: (alternative form
816: .Ql = )
1.678 nicm 817: to specify the session, window or pane where the most recent mouse event occurred
1.432 nicm 818: (see the
819: .Sx MOUSE SUPPORT
820: section)
821: or
822: .Ql {marked}
823: (alternative form
824: .Ql ~ )
825: to specify the marked pane (see
826: .Ic select-pane
827: .Fl m ) .
828: .Pp
1.423 nicm 829: Sessions, window and panes are each numbered with a unique ID; session IDs are
830: prefixed with a
831: .Ql $ ,
832: windows with a
833: .Ql @ ,
834: and panes with a
835: .Ql % .
836: These are unique and are unchanged for the life of the session, window or pane
837: in the
1.212 nicm 838: .Nm
1.423 nicm 839: server.
840: The pane ID is passed to the child process of the pane in the
1.212 nicm 841: .Ev TMUX_PANE
842: environment variable.
1.423 nicm 843: IDs may be displayed using the
844: .Ql session_id ,
845: .Ql window_id ,
846: or
847: .Ql pane_id
848: formats (see the
849: .Sx FORMATS
850: section) and the
851: .Ic display-message ,
852: .Ic list-sessions ,
853: .Ic list-windows
854: or
855: .Ic list-panes
856: commands.
1.15 jmc 857: .Pp
1.153 nicm 858: .Ar shell-command
859: arguments are
860: .Xr sh 1
861: commands.
1.394 nicm 862: This may be a single argument passed to the shell, for example:
1.153 nicm 863: .Bd -literal -offset indent
864: new-window 'vi /etc/passwd'
865: .Ed
1.394 nicm 866: .Pp
867: Will run:
868: .Bd -literal -offset indent
869: /bin/sh -c 'vi /etc/passwd'
870: .Ed
871: .Pp
872: Additionally, the
873: .Ic new-window ,
874: .Ic new-session ,
875: .Ic split-window ,
876: .Ic respawn-window
877: and
878: .Ic respawn-pane
879: commands allow
880: .Ar shell-command
881: to be given as multiple arguments and executed directly (without
882: .Ql sh -c ) .
883: This can avoid issues with shell quoting.
884: For example:
885: .Bd -literal -offset indent
886: $ tmux new-window vi /etc/passwd
887: .Ed
888: .Pp
889: Will run
890: .Xr vi 1
891: directly without invoking the shell.
1.153 nicm 892: .Pp
893: .Ar command
894: .Op Ar arguments
895: refers to a
896: .Nm
1.655 nicm 897: command, either passed with the command and arguments separately, for example:
1.153 nicm 898: .Bd -literal -offset indent
1.629 nicm 899: bind-key F1 set-option status off
1.153 nicm 900: .Ed
901: .Pp
1.655 nicm 902: Or passed as a single string argument in
903: .Pa .tmux.conf ,
904: for example:
1.153 nicm 905: .Bd -literal -offset indent
1.655 nicm 906: bind-key F1 { set-option status off }
1.153 nicm 907: .Ed
908: .Pp
909: Example
910: .Nm
911: commands include:
1.13 nicm 912: .Bd -literal -offset indent
1.57 jmc 913: refresh-client -t/dev/ttyp2
914:
915: rename-session -tfirst newname
916:
1.668 nicm 917: set-option -wt:0 monitor-activity on
1.57 jmc 918:
919: new-window ; split-window -d
1.244 nicm 920:
921: bind-key R source-file ~/.tmux.conf \e; \e
922: display-message "source-file done"
1.13 nicm 923: .Ed
1.153 nicm 924: .Pp
925: Or from
926: .Xr sh 1 :
927: .Bd -literal -offset indent
928: $ tmux kill-window -t :1
929:
1.159 jmc 930: $ tmux new-window \e; split-window -d
1.153 nicm 931:
1.159 jmc 932: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153 nicm 933: .Ed
1.57 jmc 934: .Sh CLIENTS AND SESSIONS
1.153 nicm 935: The
936: .Nm
937: server manages clients, sessions, windows and panes.
938: Clients are attached to sessions to interact with them, either
939: when they are created with the
940: .Ic new-session
941: command, or later with the
942: .Ic attach-session
943: command.
1.188 nicm 944: Each session has one or more windows
1.153 nicm 945: .Em linked
946: into it.
947: Windows may be linked to multiple sessions and are made up of one or
948: more panes,
949: each of which contains a pseudo terminal.
950: Commands for creating, linking and otherwise manipulating windows
951: are covered
952: in the
953: .Sx WINDOWS AND PANES
954: section.
955: .Pp
956: The following commands are available to manage clients and sessions:
1.57 jmc 957: .Bl -tag -width Ds
958: .It Xo Ic attach-session
1.662 nicm 959: .Op Fl dErx
1.372 nicm 960: .Op Fl c Ar working-directory
1.762 nicm 961: .Op Fl f Ar flags
1.57 jmc 962: .Op Fl t Ar target-session
963: .Xc
964: .D1 (alias: Ic attach )
965: If run from outside
966: .Nm ,
967: create a new client in the current terminal and attach it to
968: .Ar target-session .
969: If used from inside, switch the current client.
970: If
971: .Fl d
972: is specified, any other clients attached to the session are detached.
1.662 nicm 973: If
974: .Fl x
1.703 nicm 975: is given, send
976: .Dv SIGHUP
977: to the parent process of the client as well as
1.662 nicm 978: detaching the client, typically causing it to exit.
1.762 nicm 979: .Fl f
980: sets a comma-separated list of client flags.
981: The flags are:
982: .Bl -tag -width Ds
983: .It read-only
984: the client is read-only
985: .It ignore-size
986: the client does not affect the size of other clients
987: .It no-output
988: the client does not receive pane output in control mode
1.769 nicm 989: .It active-pane
990: the client has an independent active pane
1.762 nicm 991: .El
992: .Pp
993: A leading
994: .Ql !
995: turns a flag off if the client is already attached.
1.148 nicm 996: .Fl r
1.762 nicm 997: is an alias for
998: .Fl f
999: .Ar read-only,ignore-size .
1000: When a client is read-only, only keys bound to the
1.148 nicm 1001: .Ic detach-client
1.242 nicm 1002: or
1003: .Ic switch-client
1.762 nicm 1004: commands have any effect.
1.769 nicm 1005: A client with the
1006: .Ar active-pane
1007: flag allows the active pane to be selected independently of the window's active
1008: pane used by clients without the flag.
1009: This only affects the cursor position and commands issued from the client;
1010: other features such as hooks and styles continue to use the window's active
1011: pane.
1.13 nicm 1012: .Pp
1.57 jmc 1013: If no server is started,
1014: .Ic attach-session
1015: will attempt to start it; this will fail unless sessions are created in the
1016: configuration file.
1.217 nicm 1017: .Pp
1018: The
1019: .Ar target-session
1020: rules for
1021: .Ic attach-session
1022: are slightly adjusted: if
1023: .Nm
1024: needs to select the most recently used session, it will prefer the most
1025: recently used
1026: .Em unattached
1027: session.
1.372 nicm 1028: .Pp
1029: .Fl c
1030: will set the session working directory (used for new windows) to
1031: .Ar working-directory .
1.436 nicm 1032: .Pp
1033: If
1034: .Fl E
1.480 nicm 1035: is used, the
1.436 nicm 1036: .Ic update-environment
1037: option will not be applied.
1.211 nicm 1038: .It Xo Ic detach-client
1.463 nicm 1039: .Op Fl aP
1.525 nicm 1040: .Op Fl E Ar shell-command
1.219 nicm 1041: .Op Fl s Ar target-session
1.211 nicm 1042: .Op Fl t Ar target-client
1043: .Xc
1.57 jmc 1044: .D1 (alias: Ic detach )
1.218 nicm 1045: Detach the current client if bound to a key, the client specified with
1046: .Fl t ,
1.258 jmc 1047: or all clients currently attached to the session specified by
1.218 nicm 1048: .Fl s .
1.296 nicm 1049: The
1050: .Fl a
1051: option kills all but the client given with
1052: .Fl t .
1.211 nicm 1053: If
1054: .Fl P
1.703 nicm 1055: is given, send
1056: .Dv SIGHUP
1057: to the parent process of the client, typically causing it
1.211 nicm 1058: to exit.
1.525 nicm 1059: With
1060: .Fl E ,
1061: run
1062: .Ar shell-command
1063: to replace the client.
1.57 jmc 1064: .It Ic has-session Op Fl t Ar target-session
1065: .D1 (alias: Ic has )
1066: Report an error and exit with 1 if the specified session does not exist.
1067: If it does exist, exit with 0.
1068: .It Ic kill-server
1069: Kill the
1.1 nicm 1070: .Nm
1.57 jmc 1071: server and clients and destroy all sessions.
1.369 nicm 1072: .It Xo Ic kill-session
1.464 nicm 1073: .Op Fl aC
1.297 nicm 1074: .Op Fl t Ar target-session
1.369 nicm 1075: .Xc
1.57 jmc 1076: Destroy the given session, closing any windows linked to it and no other
1077: sessions, and detaching all clients attached to it.
1.297 nicm 1078: If
1079: .Fl a
1080: is given, all sessions but the specified one is killed.
1.464 nicm 1081: The
1082: .Fl C
1.467 nicm 1083: flag clears alerts (bell, activity, or silence) in all windows linked to the
1.464 nicm 1084: session.
1.250 nicm 1085: .It Xo Ic list-clients
1086: .Op Fl F Ar format
1087: .Op Fl t Ar target-session
1088: .Xc
1.57 jmc 1089: .D1 (alias: Ic lsc )
1.221 jmc 1090: List all clients attached to the server.
1.250 nicm 1091: For the meaning of the
1092: .Fl F
1093: flag, see the
1.252 jmc 1094: .Sx FORMATS
1095: section.
1.221 jmc 1096: If
1.220 nicm 1097: .Ar target-session
1098: is specified, list only clients connected to that session.
1.489 nicm 1099: .It Xo Ic list-commands
1100: .Op Fl F Ar format
1.731 nicm 1101: .Op Ar command
1.489 nicm 1102: .Xc
1.57 jmc 1103: .D1 (alias: Ic lscm )
1.731 nicm 1104: List the syntax of
1105: .Ar command
1106: or - if omitted - of all commands supported by
1.57 jmc 1107: .Nm .
1.738 nicm 1108: .It Xo Ic list-sessions
1109: .Op Fl F Ar format
1110: .Op Fl f Ar filter
1111: .Xc
1.57 jmc 1112: .D1 (alias: Ic ls )
1113: List all sessions managed by the server.
1.247 nicm 1114: .Fl F
1.738 nicm 1115: specifies the format of each line and
1116: .Fl f
1117: a filter.
1118: Only sessions for which the filter is true are shown.
1119: See the
1.247 nicm 1120: .Sx FORMATS
1121: section.
1.175 nicm 1122: .It Ic lock-client Op Fl t Ar target-client
1123: .D1 (alias: Ic lockc )
1.92 nicm 1124: Lock
1125: .Ar target-client ,
1126: see the
1127: .Ic lock-server
1128: command.
1.175 nicm 1129: .It Ic lock-session Op Fl t Ar target-session
1130: .D1 (alias: Ic locks )
1.92 nicm 1131: Lock all clients attached to
1132: .Ar target-session .
1.57 jmc 1133: .It Xo Ic new-session
1.662 nicm 1134: .Op Fl AdDEPX
1.371 nicm 1135: .Op Fl c Ar start-directory
1.760 nicm 1136: .Op Fl e Ar environment
1.762 nicm 1137: .Op Fl f Ar flags
1.351 nicm 1138: .Op Fl F Ar format
1.57 jmc 1139: .Op Fl n Ar window-name
1140: .Op Fl s Ar session-name
1.536 nicm 1141: .Op Fl t Ar group-name
1.210 nicm 1142: .Op Fl x Ar width
1143: .Op Fl y Ar height
1.153 nicm 1144: .Op Ar shell-command
1.57 jmc 1145: .Xc
1146: .D1 (alias: Ic new )
1147: Create a new session with name
1148: .Ar session-name .
1.153 nicm 1149: .Pp
1.57 jmc 1150: The new session is attached to the current terminal unless
1151: .Fl d
1152: is given.
1153: .Ar window-name
1.1 nicm 1154: and
1.153 nicm 1155: .Ar shell-command
1156: are the name of and shell command to execute in the initial window.
1.552 nicm 1157: With
1158: .Fl d ,
1.642 nicm 1159: the initial size comes from the global
1160: .Ic default-size
1161: option;
1.210 nicm 1162: .Fl x
1163: and
1164: .Fl y
1.602 nicm 1165: can be used to specify a different size.
1166: .Ql -
1167: uses the size of the current client if any.
1.642 nicm 1168: If
1169: .Fl x
1170: or
1171: .Fl y
1172: is given, the
1173: .Ic default-size
1174: option is set for the session.
1.762 nicm 1175: .Fl f
1176: sets a comma-separated list of client flags (see
1177: .Ic attach-session ) .
1.68 nicm 1178: .Pp
1179: If run from a terminal, any
1180: .Xr termios 4
1181: special characters are saved and used for new windows in the new session.
1.338 nicm 1182: .Pp
1183: The
1184: .Fl A
1185: flag makes
1186: .Ic new-session
1187: behave like
1188: .Ic attach-session
1189: if
1190: .Ar session-name
1.416 nicm 1191: already exists; in this case,
1.338 nicm 1192: .Fl D
1193: behaves like
1194: .Fl d
1.662 nicm 1195: to
1196: .Ic attach-session ,
1197: and
1198: .Fl X
1199: behaves like
1200: .Fl x
1.338 nicm 1201: to
1202: .Ic attach-session .
1.101 nicm 1203: .Pp
1204: If
1205: .Fl t
1.536 nicm 1206: is given, it specifies a
1207: .Ic session group .
1208: Sessions in the same group share the same set of windows - new windows are
1.537 nicm 1209: linked to all sessions in the group and any windows closed removed from all
1.536 nicm 1210: sessions.
1.101 nicm 1211: The current and previous window and any session options remain independent and
1.536 nicm 1212: any session in a group may be killed without affecting the others.
1213: The
1214: .Ar group-name
1215: argument may be:
1216: .Bl -enum -width Ds
1217: .It
1218: the name of an existing group, in which case the new session is added to that
1219: group;
1220: .It
1221: the name of an existing session - the new session is added to the same group
1222: as that session, creating a new group if necessary;
1223: .It
1224: the name for a new group containing only the new session.
1225: .El
1226: .Pp
1.101 nicm 1227: .Fl n
1.480 nicm 1228: and
1.153 nicm 1229: .Ar shell-command
1.101 nicm 1230: are invalid if
1231: .Fl t
1232: is used.
1.351 nicm 1233: .Pp
1234: The
1235: .Fl P
1236: option prints information about the new session after it has been created.
1237: By default, it uses the format
1.683 nicm 1238: .Ql #{session_name}:\&
1.351 nicm 1239: but a different format may be specified with
1240: .Fl F .
1.436 nicm 1241: .Pp
1242: If
1243: .Fl E
1.480 nicm 1244: is used, the
1.436 nicm 1245: .Ic update-environment
1246: option will not be applied.
1.760 nicm 1247: .Fl e
1248: takes the form
1249: .Ql VARIABLE=value
1250: and sets an environment variable for the newly created session; it may be
1251: specified multiple times.
1.248 nicm 1252: .It Xo Ic refresh-client
1.613 nicm 1253: .Op Fl cDlLRSU
1.677 nicm 1254: .Op Fl C Ar XxY
1.762 nicm 1255: .Op Fl f Ar flags
1.248 nicm 1256: .Op Fl t Ar target-client
1.613 nicm 1257: .Op Ar adjustment
1.248 nicm 1258: .Xc
1.57 jmc 1259: .D1 (alias: Ic refresh )
1260: Refresh the current client if bound to a key, or a single client if one is given
1261: with
1262: .Fl t .
1.248 nicm 1263: If
1264: .Fl S
1.538 nicm 1265: is specified, only update the client's status line.
1.535 nicm 1266: .Pp
1.642 nicm 1267: The
1268: .Fl U ,
1269: .Fl D ,
1270: .Fl L
1271: .Fl R ,
1272: and
1273: .Fl c
1274: flags allow the visible portion of a window which is larger than the client
1275: to be changed.
1276: .Fl U
1277: moves the visible part up by
1278: .Ar adjustment
1279: rows and
1280: .Fl D
1281: down,
1282: .Fl L
1283: left by
1284: .Ar adjustment
1285: columns and
1286: .Fl R
1287: right.
1288: .Fl c
1289: returns to tracking the cursor automatically.
1290: If
1291: .Ar adjustment
1292: is omitted, 1 is used.
1293: Note that the visible position is a property of the client not of the
1294: window, changing the current window in the attached session will reset
1295: it.
1296: .Pp
1.535 nicm 1297: .Fl C
1.762 nicm 1298: sets the width and height of a control client.
1299: .Fl f
1300: sets a comma-separated list of client flags, see
1301: .Ic attach-session .
1.677 nicm 1302: .Pp
1.612 nicm 1303: .Fl l
1304: requests the clipboard from the client using the
1305: .Xr xterm 1
1306: escape sequence and stores it in a new paste buffer.
1.613 nicm 1307: .Pp
1308: .Fl L ,
1309: .Fl R ,
1310: .Fl U
1311: and
1312: .Fl D
1313: move the visible portion of the window left, right, up or down
1314: by
1315: .Ar adjustment ,
1316: if the window is larger than the client.
1317: .Fl c
1318: resets so that the position follows the cursor.
1319: See the
1320: .Ic window-size
1321: option.
1.57 jmc 1322: .It Xo Ic rename-session
1323: .Op Fl t Ar target-session
1324: .Ar new-name
1325: .Xc
1326: .D1 (alias: Ic rename )
1327: Rename the session to
1328: .Ar new-name .
1.121 nicm 1329: .It Xo Ic show-messages
1.465 nicm 1330: .Op Fl JT
1.120 nicm 1331: .Op Fl t Ar target-client
1332: .Xc
1333: .D1 (alias: Ic showmsgs )
1.764 nicm 1334: Show server messages or information.
1335: Messages are stored, up to a maximum of the limit set by the
1.120 nicm 1336: .Ar message-limit
1.384 nicm 1337: server option.
1.377 nicm 1338: .Fl J
1339: and
1340: .Fl T
1.465 nicm 1341: show debugging information about jobs and terminals.
1.488 tim 1342: .It Xo Ic source-file
1.663 nicm 1343: .Op Fl nqv
1.488 tim 1344: .Ar path
1.659 nicm 1345: .Ar ...
1.488 tim 1346: .Xc
1.57 jmc 1347: .D1 (alias: Ic source )
1.659 nicm 1348: Execute commands from one or more files specified by
1.519 nicm 1349: .Ar path
1.659 nicm 1350: (which may be
1.607 kn 1351: .Xr glob 7
1.659 nicm 1352: patterns).
1.488 tim 1353: If
1354: .Fl q
1355: is given, no error will be returned if
1356: .Ar path
1357: does not exist.
1.651 nicm 1358: With
1359: .Fl n ,
1360: the file is parsed but no commands are executed.
1.663 nicm 1361: .Fl v
1362: shows the parsed commands and line numbers if possible.
1.57 jmc 1363: .It Ic start-server
1364: .D1 (alias: Ic start )
1365: Start the
1.1 nicm 1366: .Nm
1.57 jmc 1367: server, if not already running, without creating any sessions.
1.707 nicm 1368: .Pp
1369: Note that as by default the
1370: .Nm
1371: server will exit with no sessions, this is only useful if a session is created in
1372: .Pa ~/.tmux.conf ,
1373: .Ic exit-empty
1374: is turned off, or another command is run as part of the same command sequence.
1375: For example:
1376: .Bd -literal -offset indent
1377: $ tmux start \\; show -g
1378: .Ed
1.57 jmc 1379: .It Xo Ic suspend-client
1.202 nicm 1380: .Op Fl t Ar target-client
1.57 jmc 1381: .Xc
1382: .D1 (alias: Ic suspendc )
1383: Suspend a client by sending
1384: .Dv SIGTSTP
1385: (tty stop).
1386: .It Xo Ic switch-client
1.681 nicm 1387: .Op Fl ElnprZ
1.57 jmc 1388: .Op Fl c Ar target-client
1389: .Op Fl t Ar target-session
1.421 nicm 1390: .Op Fl T Ar key-table
1.57 jmc 1391: .Xc
1392: .D1 (alias: Ic switchc )
1393: Switch the current session for client
1394: .Ar target-client
1395: to
1396: .Ar target-session .
1.635 nicm 1397: As a special case,
1398: .Fl t
1399: may refer to a pane (a target that contains
1.636 jmc 1400: .Ql \&: ,
1401: .Ql \&.
1.635 nicm 1402: or
1.636 jmc 1403: .Ql % ) ,
1.681 nicm 1404: to change session, window and pane.
1405: In that case,
1406: .Fl Z
1407: keeps the window zoomed if it was zoomed.
1.183 nicm 1408: If
1.197 jmc 1409: .Fl l ,
1.183 nicm 1410: .Fl n
1411: or
1412: .Fl p
1.194 nicm 1413: is used, the client is moved to the last, next or previous session
1414: respectively.
1.242 nicm 1415: .Fl r
1.762 nicm 1416: toggles the client
1417: .Ic read-only
1418: and
1419: .Ic ignore-size
1420: flags (see the
1.242 nicm 1421: .Ic attach-session
1422: command).
1.436 nicm 1423: .Pp
1424: If
1425: .Fl E
1426: is used,
1427: .Ic update-environment
1428: option will not be applied.
1.421 nicm 1429: .Pp
1430: .Fl T
1.706 nicm 1431: sets the client's key table; the next key from the client will be interpreted
1432: from
1.421 nicm 1433: .Ar key-table .
1434: This may be used to configure multiple prefix keys, or to bind commands to
1435: sequences of keys.
1436: For example, to make typing
1437: .Ql abc
1438: run the
1439: .Ic list-keys
1440: command:
1441: .Bd -literal -offset indent
1442: bind-key -Ttable2 c list-keys
1443: bind-key -Ttable1 b switch-client -Ttable2
1444: bind-key -Troot a switch-client -Ttable1
1445: .Ed
1.57 jmc 1446: .El
1447: .Sh WINDOWS AND PANES
1.679 nicm 1448: Each window displayed by
1449: .Nm
1450: may be split into one or more
1451: .Em panes ;
1452: each pane takes up a certain area of the display and is a separate terminal.
1453: A window may be split into panes using the
1454: .Ic split-window
1455: command.
1456: Windows may be split horizontally (with the
1457: .Fl h
1458: flag) or vertically.
1459: Panes may be resized with the
1460: .Ic resize-pane
1461: command (bound to
1462: .Ql C-Up ,
1463: .Ql C-Down
1464: .Ql C-Left
1465: and
1466: .Ql C-Right
1467: by default), the current pane may be changed with the
1468: .Ic select-pane
1469: command and the
1470: .Ic rotate-window
1471: and
1472: .Ic swap-pane
1473: commands may be used to swap panes without changing their position.
1474: Panes are numbered beginning from zero in the order they are created.
1475: .Pp
1476: By default, a
1.1 nicm 1477: .Nm
1.679 nicm 1478: pane permits direct access to the terminal contained in the pane.
1479: A pane may also be put into one of several modes:
1480: .Bl -dash -offset indent
1481: .It
1482: Copy mode, which permits a section of a window or its
1.164 nicm 1483: history to be copied to a
1.1 nicm 1484: .Em paste buffer
1485: for later insertion into another window.
1486: This mode is entered with the
1487: .Ic copy-mode
1488: command, bound to
1.113 nicm 1489: .Ql \&[
1.1 nicm 1490: by default.
1.734 nicm 1491: Copied text can be pasted with the
1492: .Ic paste-buffer
1493: command, bound to
1494: .Ql \&] .
1.679 nicm 1495: .It
1496: View mode, which is like copy mode but is entered when a command that produces
1497: output, such as
1.164 nicm 1498: .Ic list-keys ,
1499: is executed from a key binding.
1.679 nicm 1500: .It
1501: Choose mode, which allows an item to be chosen from a list.
1502: This may be a client, a session or window or pane, or a buffer.
1503: This mode is entered with the
1504: .Ic choose-buffer ,
1505: .Ic choose-client
1506: and
1507: .Ic choose-tree
1508: commands.
1509: .El
1.1 nicm 1510: .Pp
1.678 nicm 1511: In copy mode an indicator is displayed in the top-right corner of the pane with
1512: the current position and the number of lines in the history.
1513: .Pp
1.497 nicm 1514: Commands are sent to copy mode using the
1515: .Fl X
1516: flag to the
1517: .Ic send-keys
1518: command.
1519: When a key is pressed, copy mode automatically uses one of two key tables,
1520: depending on the
1.1 nicm 1521: .Ic mode-keys
1.497 nicm 1522: option:
1523: .Ic copy-mode
1524: for emacs, or
1525: .Ic copy-mode-vi
1526: for vi.
1527: Key tables may be viewed with the
1528: .Ic list-keys
1529: command.
1530: .Pp
1531: The following commands are supported in copy mode:
1.648 nicm 1532: .Bl -column "CommandXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.497 nicm 1533: .It Sy "Command" Ta Sy "vi" Ta Sy "emacs"
1534: .It Li "append-selection" Ta "" Ta ""
1535: .It Li "append-selection-and-cancel" Ta "A" Ta ""
1536: .It Li "back-to-indentation" Ta "^" Ta "M-m"
1537: .It Li "begin-selection" Ta "Space" Ta "C-Space"
1538: .It Li "bottom-line" Ta "L" Ta ""
1539: .It Li "cancel" Ta "q" Ta "Escape"
1540: .It Li "clear-selection" Ta "Escape" Ta "C-g"
1.633 nicm 1541: .It Li "copy-end-of-line [<prefix>]" Ta "D" Ta "C-k"
1542: .It Li "copy-line [<prefix>]" Ta "" Ta ""
1.742 nicm 1543: .It Li "copy-pipe [<command>] [<prefix>]" Ta "" Ta ""
1544: .It Li "copy-pipe-no-clear [<command>] [<prefix>]" Ta "" Ta ""
1545: .It Li "copy-pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta ""
1.633 nicm 1546: .It Li "copy-selection [<prefix>]" Ta "" Ta ""
1.638 nicm 1547: .It Li "copy-selection-no-clear [<prefix>]" Ta "" Ta ""
1.633 nicm 1548: .It Li "copy-selection-and-cancel [<prefix>]" Ta "Enter" Ta "M-w"
1.497 nicm 1549: .It Li "cursor-down" Ta "j" Ta "Down"
1.685 nicm 1550: .It Li "cursor-down-and-cancel" Ta "" Ta ""
1.497 nicm 1551: .It Li "cursor-left" Ta "h" Ta "Left"
1552: .It Li "cursor-right" Ta "l" Ta "Right"
1553: .It Li "cursor-up" Ta "k" Ta "Up"
1554: .It Li "end-of-line" Ta "$" Ta "C-e"
1555: .It Li "goto-line <line>" Ta ":" Ta "g"
1556: .It Li "halfpage-down" Ta "C-d" Ta "M-Down"
1.589 nicm 1557: .It Li "halfpage-down-and-cancel" Ta "" Ta ""
1.497 nicm 1558: .It Li "halfpage-up" Ta "C-u" Ta "M-Up"
1.589 nicm 1559: .It Li "history-bottom" Ta "G" Ta "M->"
1560: .It Li "history-top" Ta "g" Ta "M-<"
1.497 nicm 1561: .It Li "jump-again" Ta ";" Ta ";"
1562: .It Li "jump-backward <to>" Ta "F" Ta "F"
1563: .It Li "jump-forward <to>" Ta "f" Ta "f"
1564: .It Li "jump-reverse" Ta "," Ta ","
1565: .It Li "jump-to-backward <to>" Ta "T" Ta ""
1566: .It Li "jump-to-forward <to>" Ta "t" Ta ""
1.768 nicm 1567: .It Li "jump-to-mark" Ta "M-x" Ta "M-x"
1.497 nicm 1568: .It Li "middle-line" Ta "M" Ta "M-r"
1.678 nicm 1569: .It Li "next-matching-bracket" Ta "%" Ta "M-C-f"
1.497 nicm 1570: .It Li "next-paragraph" Ta "}" Ta "M-}"
1571: .It Li "next-space" Ta "W" Ta ""
1572: .It Li "next-space-end" Ta "E" Ta ""
1573: .It Li "next-word" Ta "w" Ta ""
1574: .It Li "next-word-end" Ta "e" Ta "M-f"
1575: .It Li "other-end" Ta "o" Ta ""
1576: .It Li "page-down" Ta "C-f" Ta "PageDown"
1.589 nicm 1577: .It Li "page-down-and-cancel" Ta "" Ta ""
1.497 nicm 1578: .It Li "page-up" Ta "C-b" Ta "PageUp"
1.678 nicm 1579: .It Li "previous-matching-bracket" Ta "" Ta "M-C-b"
1.497 nicm 1580: .It Li "previous-paragraph" Ta "{" Ta "M-{"
1581: .It Li "previous-space" Ta "B" Ta ""
1582: .It Li "previous-word" Ta "b" Ta "M-b"
1583: .It Li "rectangle-toggle" Ta "v" Ta "R"
1.732 nicm 1584: .It Li "refresh-from-pane" Ta "r" Ta "r"
1.497 nicm 1585: .It Li "scroll-down" Ta "C-e" Ta "C-Down"
1.589 nicm 1586: .It Li "scroll-down-and-cancel" Ta "" Ta ""
1.497 nicm 1587: .It Li "scroll-up" Ta "C-y" Ta "C-Up"
1588: .It Li "search-again" Ta "n" Ta "n"
1.517 nicm 1589: .It Li "search-backward <for>" Ta "?" Ta ""
1.726 nicm 1590: .It Li "search-backward-incremental <for>" Ta "" Ta "C-r"
1591: .It Li "search-backward-text <for>" Ta "" Ta ""
1.517 nicm 1592: .It Li "search-forward <for>" Ta "/" Ta ""
1593: .It Li "search-forward-incremental <for>" Ta "" Ta "C-s"
1.726 nicm 1594: .It Li "search-forward-text <for>" Ta "" Ta ""
1.497 nicm 1595: .It Li "search-reverse" Ta "N" Ta "N"
1596: .It Li "select-line" Ta "V" Ta ""
1.634 nicm 1597: .It Li "select-word" Ta "" Ta ""
1.768 nicm 1598: .It Li "set-mark" Ta "X" Ta "X"
1.497 nicm 1599: .It Li "start-of-line" Ta "0" Ta "C-a"
1.515 nicm 1600: .It Li "stop-selection" Ta "" Ta ""
1.497 nicm 1601: .It Li "top-line" Ta "H" Ta "M-R"
1.1 nicm 1602: .El
1.726 nicm 1603: .Pp
1604: The search commands come in several varieties:
1605: .Ql search-forward
1606: and
1607: .Ql search-backward
1608: search for a regular expression;
1609: the
1610: .Ql -text
1611: variants search for a plain text string rather than a regular expression;
1612: .Ql -incremental
1613: perform an incremental search and expect to be used with the
1614: .Fl i
1615: flag to the
1616: .Ic command-prompt
1617: command.
1618: .Ql search-again
1619: repeats the last search and
1620: .Ql search-reverse
1621: does the same but reverses the direction (forward becomes backward and backward
1622: becomes forward).
1.589 nicm 1623: .Pp
1.633 nicm 1624: Copy commands may take an optional buffer prefix argument which is used
1625: to generate the buffer name (the default is
1626: .Ql buffer
1627: so buffers are named
1628: .Ql buffer0 ,
1629: .Ql buffer1
1630: and so on).
1631: Pipe commands take a command argument which is the command to which the
1632: copied text is piped.
1.589 nicm 1633: The
1634: .Ql -and-cancel
1635: variants of some commands exit copy mode after they have completed (for copy
1636: commands) or when the cursor reaches the bottom (for scrolling commands).
1.638 nicm 1637: .Ql -no-clear
1638: variants do not clear the selection.
1.146 nicm 1639: .Pp
1640: The next and previous word keys use space and the
1641: .Ql - ,
1.154 nicm 1642: .Ql _
1.146 nicm 1643: and
1644: .Ql @
1.154 nicm 1645: characters as word delimiters by default, but this can be adjusted by
1646: setting the
1647: .Em word-separators
1.255 nicm 1648: session option.
1.146 nicm 1649: Next word moves to the start of the next word, next word end to the end of the
1650: next word and previous word to the start of the previous word.
1651: The three next and previous space keys work similarly but use a space alone as
1652: the word separator.
1.157 nicm 1653: .Pp
1654: The jump commands enable quick movement within a line.
1655: For instance, typing
1656: .Ql f
1657: followed by
1658: .Ql /
1659: will move the cursor to the next
1660: .Ql /
1661: character on the current line.
1662: A
1663: .Ql \&;
1664: will then jump to the next occurrence.
1.1 nicm 1665: .Pp
1.155 nicm 1666: Commands in copy mode may be prefaced by an optional repeat count.
1667: With vi key bindings, a prefix is entered using the number keys; with
1668: emacs, the Alt (meta) key and a number begins prefix entry.
1669: .Pp
1.164 nicm 1670: The synopsis for the
1671: .Ic copy-mode
1672: command is:
1.57 jmc 1673: .Bl -tag -width Ds
1674: .It Xo Ic copy-mode
1.720 nicm 1675: .Op Fl eHMqu
1.735 nicm 1676: .Op Fl s Ar src-pane
1.72 nicm 1677: .Op Fl t Ar target-pane
1.57 jmc 1678: .Xc
1679: Enter copy mode.
1680: The
1681: .Fl u
1682: option scrolls one page up.
1.419 nicm 1683: .Fl M
1684: begins a mouse drag (only valid if bound to a mouse key binding, see
1.420 jmc 1685: .Sx MOUSE SUPPORT ) .
1.716 nicm 1686: .Fl H
1687: hides the position indicator in the top right.
1.720 nicm 1688: .Fl q
1689: cancels copy mode and any other modes.
1.735 nicm 1690: .Fl s
1691: copies from
1692: .Ar src-pane
1693: instead of
1.736 nicm 1694: .Ar target-pane .
1.716 nicm 1695: .Pp
1.450 nicm 1696: .Fl e
1697: specifies that scrolling to the bottom of the history (to the visible screen)
1698: should exit copy mode.
1699: While in copy mode, pressing a key other than those used for scrolling will
1700: disable this behaviour.
1701: This is intended to allow fast scrolling through a pane's history, for
1702: example with:
1703: .Bd -literal -offset indent
1704: bind PageUp copy-mode -eu
1705: .Ed
1.57 jmc 1706: .El
1.18 nicm 1707: .Pp
1.679 nicm 1708: A number of preset arrangements of panes are available, these are called layouts.
1.38 nicm 1709: These may be selected with the
1710: .Ic select-layout
1711: command or cycled with
1712: .Ic next-layout
1713: (bound to
1.149 nicm 1714: .Ql Space
1.131 nicm 1715: by default); once a layout is chosen, panes within it may be moved and resized
1716: as normal.
1.1 nicm 1717: .Pp
1718: The following layouts are supported:
1719: .Bl -tag -width Ds
1720: .It Ic even-horizontal
1721: Panes are spread out evenly from left to right across the window.
1722: .It Ic even-vertical
1723: Panes are spread evenly from top to bottom.
1.2 nicm 1724: .It Ic main-horizontal
1.131 nicm 1725: A large (main) pane is shown at the top of the window and the remaining panes
1726: are spread from left to right in the leftover space at the bottom.
1.2 nicm 1727: Use the
1728: .Em main-pane-height
1729: window option to specify the height of the top pane.
1.1 nicm 1730: .It Ic main-vertical
1.2 nicm 1731: Similar to
1732: .Ic main-horizontal
1733: but the large pane is placed on the left and the others spread from top to
1734: bottom along the right.
1735: See the
1736: .Em main-pane-width
1737: window option.
1.165 nicm 1738: .It Ic tiled
1739: Panes are spread out as evenly as possible over the window in both rows and
1740: columns.
1.1 nicm 1741: .El
1.8 nicm 1742: .Pp
1.181 nicm 1743: In addition,
1744: .Ic select-layout
1745: may be used to apply a previously used layout - the
1746: .Ic list-windows
1747: command displays the layout of each window in a form suitable for use with
1748: .Ic select-layout .
1749: For example:
1750: .Bd -literal -offset indent
1751: $ tmux list-windows
1752: 0: ksh [159x48]
1753: layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1754: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
1755: .Ed
1.196 nicm 1756: .Pp
1.181 nicm 1757: .Nm
1758: automatically adjusts the size of the layout for the current window size.
1759: Note that a layout cannot be applied to a window with more panes than that
1760: from which the layout was originally defined.
1761: .Pp
1.57 jmc 1762: Commands related to windows and panes are as follows:
1763: .Bl -tag -width Ds
1764: .It Xo Ic break-pane
1.749 nicm 1765: .Op Fl adP
1.280 nicm 1766: .Op Fl F Ar format
1.532 nicm 1767: .Op Fl n Ar window-name
1.440 nicm 1768: .Op Fl s Ar src-pane
1.480 nicm 1769: .Op Fl t Ar dst-window
1.57 jmc 1770: .Xc
1771: .D1 (alias: Ic breakp )
1772: Break
1.440 nicm 1773: .Ar src-pane
1774: off from its containing window to make it the only pane in
1775: .Ar dst-window .
1.749 nicm 1776: With
1777: .Fl a ,
1778: the window is moved to the next index up (following windows
1779: are moved if necessary).
1.57 jmc 1780: If
1781: .Fl d
1782: is given, the new window does not become the current window.
1.280 nicm 1783: The
1784: .Fl P
1785: option prints information about the new window after it has been created.
1786: By default, it uses the format
1787: .Ql #{session_name}:#{window_index}
1788: but a different format may be specified with
1789: .Fl F .
1.128 nicm 1790: .It Xo Ic capture-pane
1.680 nicm 1791: .Op Fl aepPqCJN
1.392 nicm 1792: .Op Fl b Ar buffer-name
1.213 nicm 1793: .Op Fl E Ar end-line
1794: .Op Fl S Ar start-line
1.128 nicm 1795: .Op Fl t Ar target-pane
1796: .Xc
1797: .D1 (alias: Ic capturep )
1.322 nicm 1798: Capture the contents of a pane.
1799: If
1800: .Fl p
1.325 nicm 1801: is given, the output goes to stdout, otherwise to the buffer specified with
1.322 nicm 1802: .Fl b
1803: or a new buffer if omitted.
1.339 nicm 1804: If
1805: .Fl a
1806: is given, the alternate screen is used, and the history is not accessible.
1.340 nicm 1807: If no alternate screen exists, an error will be returned unless
1808: .Fl q
1809: is given.
1.326 nicm 1810: If
1811: .Fl e
1.328 nicm 1812: is given, the output includes escape sequences for text and background
1813: attributes.
1814: .Fl C
1.330 nicm 1815: also escapes non-printable characters as octal \exxx.
1.680 nicm 1816: .Fl N
1817: preserves trailing spaces at each line's end and
1.328 nicm 1818: .Fl J
1.680 nicm 1819: preserves trailing spaces and joins any wrapped lines.
1.346 nicm 1820: .Fl P
1821: captures only any output that the pane has received that is the beginning of an
1822: as-yet incomplete escape sequence.
1.213 nicm 1823: .Pp
1824: .Fl S
1825: and
1826: .Fl E
1827: specify the starting and ending line numbers, zero is the first line of the
1828: visible pane and negative numbers are lines in the history.
1.397 nicm 1829: .Ql -
1830: to
1831: .Fl S
1832: is the start of the history and to
1833: .Fl E
1834: the end of the visible pane.
1.213 nicm 1835: The default is to capture only the visible contents of the pane.
1.76 nicm 1836: .It Xo
1837: .Ic choose-client
1.682 nicm 1838: .Op Fl NrZ
1.572 nicm 1839: .Op Fl F Ar format
1.562 nicm 1840: .Op Fl f Ar filter
1.561 nicm 1841: .Op Fl O Ar sort-order
1.555 nicm 1842: .Op Fl t Ar target-pane
1.76 nicm 1843: .Op Ar template
1844: .Xc
1.555 nicm 1845: Put a pane into client mode, allowing a client to be selected interactively from
1846: a list.
1.593 nicm 1847: .Fl Z
1848: zooms the pane.
1.555 nicm 1849: The following keys may be used in client mode:
1850: .Bl -column "Key" "Function" -offset indent
1851: .It Sy "Key" Ta Sy "Function"
1852: .It Li "Enter" Ta "Choose selected client"
1853: .It Li "Up" Ta "Select previous client"
1854: .It Li "Down" Ta "Select next client"
1.559 nicm 1855: .It Li "C-s" Ta "Search by name"
1856: .It Li "n" Ta "Repeat last search"
1.555 nicm 1857: .It Li "t" Ta "Toggle if client is tagged"
1858: .It Li "T" Ta "Tag no clients"
1859: .It Li "C-t" Ta "Tag all clients"
1860: .It Li "d" Ta "Detach selected client"
1861: .It Li "D" Ta "Detach tagged clients"
1862: .It Li "x" Ta "Detach and HUP selected client"
1863: .It Li "X" Ta "Detach and HUP tagged clients"
1864: .It Li "z" Ta "Suspend selected client"
1865: .It Li "Z" Ta "Suspend tagged clients"
1.562 nicm 1866: .It Li "f" Ta "Enter a format to filter items"
1.682 nicm 1867: .It Li "O" Ta "Change sort field"
1868: .It Li "r" Ta "Reverse sort order"
1.576 nicm 1869: .It Li "v" Ta "Toggle preview"
1.555 nicm 1870: .It Li "q" Ta "Exit mode"
1871: .El
1872: .Pp
1.76 nicm 1873: After a client is chosen,
1874: .Ql %%
1.555 nicm 1875: is replaced by the client name in
1.76 nicm 1876: .Ar template
1877: and the result executed as a command.
1878: If
1879: .Ar template
1880: is not given, "detach-client -t '%%'" is used.
1.555 nicm 1881: .Pp
1.561 nicm 1882: .Fl O
1.682 nicm 1883: specifies the initial sort field: one of
1.561 nicm 1884: .Ql name ,
1885: .Ql size ,
1886: .Ql creation ,
1887: or
1888: .Ql activity .
1.682 nicm 1889: .Fl r
1890: reverses the sort order.
1.562 nicm 1891: .Fl f
1.579 nicm 1892: specifies an initial filter: the filter is a format - if it evaluates to zero,
1893: the item in the list is not shown, otherwise it is shown.
1894: If a filter would lead to an empty list, it is ignored.
1.572 nicm 1895: .Fl F
1896: specifies the format for each item in the list.
1.576 nicm 1897: .Fl N
1898: starts without the preview.
1.314 nicm 1899: This command works only if at least one client is attached.
1.76 nicm 1900: .It Xo
1.555 nicm 1901: .Ic choose-tree
1.682 nicm 1902: .Op Fl GNrswZ
1.572 nicm 1903: .Op Fl F Ar format
1.562 nicm 1904: .Op Fl f Ar filter
1.561 nicm 1905: .Op Fl O Ar sort-order
1.555 nicm 1906: .Op Fl t Ar target-pane
1.76 nicm 1907: .Op Ar template
1908: .Xc
1.555 nicm 1909: Put a pane into tree mode, where a session, window or pane may be chosen
1.76 nicm 1910: interactively from a list.
1.298 nicm 1911: .Fl s
1.555 nicm 1912: starts with sessions collapsed and
1.298 nicm 1913: .Fl w
1.555 nicm 1914: with windows collapsed.
1.593 nicm 1915: .Fl Z
1916: zooms the pane.
1.555 nicm 1917: The following keys may be used in tree mode:
1918: .Bl -column "Key" "Function" -offset indent
1919: .It Sy "Key" Ta Sy "Function"
1920: .It Li "Enter" Ta "Choose selected item"
1921: .It Li "Up" Ta "Select previous item"
1922: .It Li "Down" Ta "Select next item"
1.763 nicm 1923: .It Li "+" Ta "Expand selected item"
1924: .It Li "-" Ta "Collapse selected item"
1925: .It Li "M-+" Ta "Expand all items"
1926: .It Li "M--" Ta "Collapse all items"
1.594 nicm 1927: .It Li "x" Ta "Kill selected item"
1928: .It Li "X" Ta "Kill tagged items"
1.566 nicm 1929: .It Li "<" Ta "Scroll list of previews left"
1930: .It Li ">" Ta "Scroll list of previews right"
1.559 nicm 1931: .It Li "C-s" Ta "Search by name"
1.749 nicm 1932: .It Li "m" Ta "Set the marked pane"
1933: .It Li "M" Ta "Clear the marked pane"
1.559 nicm 1934: .It Li "n" Ta "Repeat last search"
1.555 nicm 1935: .It Li "t" Ta "Toggle if item is tagged"
1936: .It Li "T" Ta "Tag no items"
1937: .It Li "C-t" Ta "Tag all items"
1.557 nicm 1938: .It Li "\&:" Ta "Run a command for each tagged item"
1.555 nicm 1939: .It Li "f" Ta "Enter a format to filter items"
1.749 nicm 1940: .It Li "H" Ta "Jump to the starting pane"
1.682 nicm 1941: .It Li "O" Ta "Change sort field"
1942: .It Li "r" Ta "Reverse sort order"
1.576 nicm 1943: .It Li "v" Ta "Toggle preview"
1.555 nicm 1944: .It Li "q" Ta "Exit mode"
1945: .El
1.320 nicm 1946: .Pp
1.555 nicm 1947: After a session, window or pane is chosen,
1.76 nicm 1948: .Ql %%
1.555 nicm 1949: is replaced by the target in
1.76 nicm 1950: .Ar template
1951: and the result executed as a command.
1952: If
1953: .Ar template
1.555 nicm 1954: is not given, "switch-client -t '%%'" is used.
1955: .Pp
1.561 nicm 1956: .Fl O
1.682 nicm 1957: specifies the initial sort field: one of
1.561 nicm 1958: .Ql index ,
1959: .Ql name ,
1960: or
1961: .Ql time .
1.682 nicm 1962: .Fl r
1963: reverses the sort order.
1.562 nicm 1964: .Fl f
1.579 nicm 1965: specifies an initial filter: the filter is a format - if it evaluates to zero,
1966: the item in the list is not shown, otherwise it is shown.
1967: If a filter would lead to an empty list, it is ignored.
1.572 nicm 1968: .Fl F
1969: specifies the format for each item in the tree.
1.576 nicm 1970: .Fl N
1971: starts without the preview.
1.586 nicm 1972: .Fl G
1973: includes all sessions in any session groups in the tree rather than only the
1974: first.
1.766 nicm 1975: This command works only if at least one client is attached.
1976: .It Xo
1977: .Ic customize-mode
1978: .Op Fl NZ
1979: .Op Fl F Ar format
1980: .Op Fl f Ar filter
1981: .Op Fl t Ar target-pane
1982: .Op Ar template
1983: .Xc
1984: Put a pane into customize mode, where options and key bindings may be browsed
1985: and modified from a list.
1986: Option values in the list are shown for the active pane in the current window.
1987: .Fl Z
1988: zooms the pane.
1989: The following keys may be used in customize mode:
1990: .Bl -column "Key" "Function" -offset indent
1991: .It Sy "Key" Ta Sy "Function"
1992: .It Li "Enter" Ta "Set pane, window, session or global option value"
1993: .It Li "Up" Ta "Select previous item"
1994: .It Li "Down" Ta "Select next item"
1995: .It Li "+" Ta "Expand selected item"
1996: .It Li "-" Ta "Collapse selected item"
1997: .It Li "M-+" Ta "Expand all items"
1998: .It Li "M--" Ta "Collapse all items"
1999: .It Li "s" Ta "Set option value or key attribute"
2000: .It Li "S" Ta "Set global option value"
2001: .It Li "w" Ta "Set window option value, if option is for pane and window"
2002: .It Li "u" Ta "Unset an option (set to default value if global) or unbind a key"
2003: .It Li "U" Ta "Unset tagged options and unbind tagged keys"
2004: .It Li "C-s" Ta "Search by name"
2005: .It Li "n" Ta "Repeat last search"
2006: .It Li "t" Ta "Toggle if item is tagged"
2007: .It Li "T" Ta "Tag no items"
2008: .It Li "C-t" Ta "Tag all items"
2009: .It Li "f" Ta "Enter a format to filter items"
2010: .It Li "v" Ta "Toggle option information"
2011: .It Li "q" Ta "Exit mode"
2012: .El
2013: .Pp
2014: .Fl f
2015: specifies an initial filter: the filter is a format - if it evaluates to zero,
2016: the item in the list is not shown, otherwise it is shown.
2017: If a filter would lead to an empty list, it is ignored.
2018: .Fl F
2019: specifies the format for each item in the tree.
2020: .Fl N
2021: starts without the option information.
1.314 nicm 2022: This command works only if at least one client is attached.
1.491 nicm 2023: .It Xo
2024: .Ic display-panes
1.616 nicm 2025: .Op Fl b
1.573 nicm 2026: .Op Fl d Ar duration
1.491 nicm 2027: .Op Fl t Ar target-client
2028: .Op Ar template
2029: .Xc
1.398 nicm 2030: .D1 (alias: Ic displayp )
1.78 nicm 2031: Display a visible indicator of each pane shown by
2032: .Ar target-client .
2033: See the
1.573 nicm 2034: .Ic display-panes-colour
1.78 nicm 2035: and
1.145 nicm 2036: .Ic display-panes-active-colour
1.78 nicm 2037: session options.
1.573 nicm 2038: The indicator is closed when a key is pressed or
2039: .Ar duration
2040: milliseconds have passed.
2041: If
2042: .Fl d
2043: is not given,
2044: .Ic display-panes-time
2045: is used.
2046: A duration of zero means the indicator stays until a key is pressed.
1.491 nicm 2047: While the indicator is on screen, a pane may be chosen with the
1.84 nicm 2048: .Ql 0
2049: to
2050: .Ql 9
1.491 nicm 2051: keys, which will cause
2052: .Ar template
2053: to be executed as a command with
2054: .Ql %%
2055: substituted by the pane ID.
2056: The default
2057: .Ar template
2058: is "select-pane -t '%%'".
1.616 nicm 2059: With
2060: .Fl b ,
2061: other commands are not blocked from running until the indicator is closed.
1.57 jmc 2062: .It Xo Ic find-window
1.670 nicm 2063: .Op Fl rCNTZ
1.555 nicm 2064: .Op Fl t Ar target-pane
1.57 jmc 2065: .Ar match-string
2066: .Xc
2067: .D1 (alias: Ic findw )
1.670 nicm 2068: Search for a
1.57 jmc 2069: .Xr fnmatch 3
1.670 nicm 2070: pattern or, with
2071: .Fl r ,
2072: regular expression
1.57 jmc 2073: .Ar match-string
2074: in window names, titles, and visible content (but not history).
1.285 nicm 2075: The flags control matching behavior:
2076: .Fl C
2077: matches only visible window contents,
2078: .Fl N
2079: matches only the window name and
2080: .Fl T
2081: matches only the window title.
2082: The default is
2083: .Fl CNT .
1.608 nicm 2084: .Fl Z
2085: zooms the pane.
1.555 nicm 2086: .Pp
1.314 nicm 2087: This command works only if at least one client is attached.
1.137 nicm 2088: .It Xo Ic join-pane
1.697 nicm 2089: .Op Fl bdfhv
1.690 nicm 2090: .Op Fl l Ar size
1.137 nicm 2091: .Op Fl s Ar src-pane
2092: .Op Fl t Ar dst-pane
2093: .Xc
2094: .D1 (alias: Ic joinp )
2095: Like
2096: .Ic split-window ,
2097: but instead of splitting
2098: .Ar dst-pane
2099: and creating a new pane, split it and move
2100: .Ar src-pane
2101: into the space.
2102: This can be used to reverse
2103: .Ic break-pane .
1.277 nicm 2104: The
2105: .Fl b
2106: option causes
2107: .Ar src-pane
2108: to be joined to left of or above
2109: .Ar dst-pane .
1.432 nicm 2110: .Pp
2111: If
2112: .Fl s
2113: is omitted and a marked pane is present (see
2114: .Ic select-pane
2115: .Fl m ) ,
2116: the marked pane is used rather than the current pane.
1.112 nicm 2117: .It Xo Ic kill-pane
2118: .Op Fl a
2119: .Op Fl t Ar target-pane
2120: .Xc
1.57 jmc 2121: .D1 (alias: Ic killp )
2122: Destroy the given pane.
2123: If no panes remain in the containing window, it is also destroyed.
1.112 nicm 2124: The
2125: .Fl a
2126: option kills all but the pane given with
2127: .Fl t .
1.289 nicm 2128: .It Xo Ic kill-window
2129: .Op Fl a
2130: .Op Fl t Ar target-window
2131: .Xc
1.57 jmc 2132: .D1 (alias: Ic killw )
2133: Kill the current window or the window at
2134: .Ar target-window ,
1.1 nicm 2135: removing it from any sessions to which it is linked.
1.289 nicm 2136: The
2137: .Fl a
2138: option kills all but the window given with
2139: .Fl t .
1.398 nicm 2140: .It Xo Ic last-pane
1.681 nicm 2141: .Op Fl deZ
1.398 nicm 2142: .Op Fl t Ar target-window
2143: .Xc
1.187 nicm 2144: .D1 (alias: Ic lastp )
2145: Select the last (previously selected) pane.
1.681 nicm 2146: .Fl Z
2147: keeps the window zoomed if it was zoomed.
1.398 nicm 2148: .Fl e
2149: enables or
2150: .Fl d
2151: disables input to the pane.
1.56 jmc 2152: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 2153: .D1 (alias: Ic last )
2154: Select the last (previously selected) window.
2155: If no
2156: .Ar target-session
2157: is specified, select the last window of the current session.
2158: .It Xo Ic link-window
1.439 nicm 2159: .Op Fl adk
1.1 nicm 2160: .Op Fl s Ar src-window
2161: .Op Fl t Ar dst-window
2162: .Xc
2163: .D1 (alias: Ic linkw )
2164: Link the window at
2165: .Ar src-window
2166: to the specified
2167: .Ar dst-window .
2168: If
2169: .Ar dst-window
2170: is specified and no such window exists, the
2171: .Ar src-window
2172: is linked there.
1.439 nicm 2173: With
2174: .Fl a ,
2175: the window is moved to the next index up (following windows
2176: are moved if necessary).
1.1 nicm 2177: If
2178: .Fl k
2179: is given and
2180: .Ar dst-window
2181: exists, it is killed, otherwise an error is generated.
2182: If
2183: .Fl d
2184: is given, the newly linked window is not selected.
1.214 nicm 2185: .It Xo Ic list-panes
2186: .Op Fl as
1.245 nicm 2187: .Op Fl F Ar format
1.738 nicm 2188: .Op Fl f Ar filter
1.214 nicm 2189: .Op Fl t Ar target
2190: .Xc
1.104 nicm 2191: .D1 (alias: Ic lsp )
1.214 nicm 2192: If
2193: .Fl a
2194: is given,
2195: .Ar target
2196: is ignored and all panes on the server are listed.
2197: If
2198: .Fl s
2199: is given,
2200: .Ar target
2201: is a session (or the current session).
2202: If neither is given,
2203: .Ar target
2204: is a window (or the current window).
1.247 nicm 2205: .Fl F
1.738 nicm 2206: specifies the format of each line and
2207: .Fl f
2208: a filter.
2209: Only panes for which the filter is true are shown.
2210: See the
1.247 nicm 2211: .Sx FORMATS
2212: section.
1.214 nicm 2213: .It Xo Ic list-windows
2214: .Op Fl a
1.245 nicm 2215: .Op Fl F Ar format
1.738 nicm 2216: .Op Fl f Ar filter
1.214 nicm 2217: .Op Fl t Ar target-session
2218: .Xc
1.1 nicm 2219: .D1 (alias: Ic lsw )
1.214 nicm 2220: If
2221: .Fl a
2222: is given, list all windows on the server.
2223: Otherwise, list windows in the current session or in
1.1 nicm 2224: .Ar target-session .
1.245 nicm 2225: .Fl F
1.738 nicm 2226: specifies the format of each line and
2227: .Fl f
2228: a filter.
2229: Only windows for which the filter is true are shown.
2230: See the
1.245 nicm 2231: .Sx FORMATS
2232: section.
1.277 nicm 2233: .It Xo Ic move-pane
1.749 nicm 2234: .Op Fl bdfhv
1.690 nicm 2235: .Op Fl l Ar size
1.277 nicm 2236: .Op Fl s Ar src-pane
2237: .Op Fl t Ar dst-pane
2238: .Xc
2239: .D1 (alias: Ic movep )
1.749 nicm 2240: Does the same as
2241: .Ic join-pane .
1.1 nicm 2242: .It Xo Ic move-window
1.439 nicm 2243: .Op Fl ardk
1.1 nicm 2244: .Op Fl s Ar src-window
2245: .Op Fl t Ar dst-window
2246: .Xc
2247: .D1 (alias: Ic movew )
2248: This is similar to
2249: .Ic link-window ,
2250: except the window at
2251: .Ar src-window
2252: is moved to
2253: .Ar dst-window .
1.291 nicm 2254: With
2255: .Fl r ,
2256: all windows in the session are renumbered in sequential order, respecting
2257: the
2258: .Ic base-index
2259: option.
1.1 nicm 2260: .It Xo Ic new-window
1.201 nicm 2261: .Op Fl adkP
1.272 nicm 2262: .Op Fl c Ar start-directory
1.641 nicm 2263: .Op Fl e Ar environment
1.351 nicm 2264: .Op Fl F Ar format
1.1 nicm 2265: .Op Fl n Ar window-name
2266: .Op Fl t Ar target-window
1.153 nicm 2267: .Op Ar shell-command
1.1 nicm 2268: .Xc
2269: .D1 (alias: Ic neww )
2270: Create a new window.
1.160 nicm 2271: With
2272: .Fl a ,
2273: the new window is inserted at the next index up from the specified
2274: .Ar target-window ,
2275: moving windows up if necessary,
2276: otherwise
2277: .Ar target-window
2278: is the new window location.
2279: .Pp
1.1 nicm 2280: If
2281: .Fl d
2282: is given, the session does not make the new window the current window.
2283: .Ar target-window
1.28 nicm 2284: represents the window to be created; if the target already exists an error is
2285: shown, unless the
2286: .Fl k
2287: flag is used, in which case it is destroyed.
1.153 nicm 2288: .Ar shell-command
1.1 nicm 2289: is the command to execute.
2290: If
1.153 nicm 2291: .Ar shell-command
2292: is not specified, the value of the
2293: .Ic default-command
2294: option is used.
1.272 nicm 2295: .Fl c
2296: specifies the working directory in which the new window is created.
1.153 nicm 2297: .Pp
2298: When the shell command completes, the window closes.
2299: See the
2300: .Ic remain-on-exit
2301: option to change this behaviour.
1.1 nicm 2302: .Pp
1.641 nicm 2303: .Fl e
2304: takes the form
2305: .Ql VARIABLE=value
2306: and sets an environment variable for the newly created window; it may be
2307: specified multiple times.
2308: .Pp
1.1 nicm 2309: The
2310: .Ev TERM
2311: environment variable must be set to
1.523 nicm 2312: .Ql screen
2313: or
2314: .Ql tmux
1.1 nicm 2315: for all programs running
2316: .Em inside
2317: .Nm .
2318: New windows will automatically have
1.523 nicm 2319: .Ql TERM=screen
1.1 nicm 2320: added to their environment, but care must be taken not to reset this in shell
1.641 nicm 2321: start-up files or by the
2322: .Fl e
2323: option.
1.201 nicm 2324: .Pp
2325: The
2326: .Fl P
1.279 nicm 2327: option prints information about the new window after it has been created.
2328: By default, it uses the format
2329: .Ql #{session_name}:#{window_index}
2330: but a different format may be specified with
2331: .Fl F .
1.56 jmc 2332: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 2333: .D1 (alias: Ic nextl )
2334: Move a window to the next layout and rearrange the panes to fit.
2335: .It Xo Ic next-window
1.9 nicm 2336: .Op Fl a
1.1 nicm 2337: .Op Fl t Ar target-session
2338: .Xc
2339: .D1 (alias: Ic next )
2340: Move to the next window in the session.
1.9 nicm 2341: If
1.12 jmc 2342: .Fl a
1.295 nicm 2343: is used, move to the next window with an alert.
1.107 nicm 2344: .It Xo Ic pipe-pane
1.591 nicm 2345: .Op Fl IOo
1.107 nicm 2346: .Op Fl t Ar target-pane
1.153 nicm 2347: .Op Ar shell-command
1.107 nicm 2348: .Xc
2349: .D1 (alias: Ic pipep )
1.591 nicm 2350: Pipe output sent by the program in
1.107 nicm 2351: .Ar target-pane
1.591 nicm 2352: to a shell command or vice versa.
2353: A pane may only be connected to one command at a time, any existing pipe is
1.107 nicm 2354: closed before
1.153 nicm 2355: .Ar shell-command
1.107 nicm 2356: is executed.
1.174 nicm 2357: The
2358: .Ar shell-command
2359: string may contain the special character sequences supported by the
2360: .Ic status-left
1.231 nicm 2361: option.
1.107 nicm 2362: If no
1.153 nicm 2363: .Ar shell-command
1.107 nicm 2364: is given, the current pipe (if any) is closed.
1.591 nicm 2365: .Pp
2366: .Fl I
2367: and
2368: .Fl O
2369: specify which of the
2370: .Ar shell-command
2371: output streams are connected to the pane:
2372: with
2373: .Fl I
2374: stdout is connected (so anything
2375: .Ar shell-command
2376: prints is written to the pane as if it were typed);
2377: with
2378: .Fl O
2379: stdin is connected (so any output in the pane is piped to
2380: .Ar shell-command ) .
2381: Both may be used together and if neither are specified,
2382: .Fl O
2383: is used.
1.107 nicm 2384: .Pp
2385: The
2386: .Fl o
2387: option only opens a new pipe if no previous pipe exists, allowing a pipe to
2388: be toggled with a single key, for example:
2389: .Bd -literal -offset indent
1.174 nicm 2390: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107 nicm 2391: .Ed
1.176 nicm 2392: .It Xo Ic previous-layout
2393: .Op Fl t Ar target-window
2394: .Xc
2395: .D1 (alias: Ic prevl )
2396: Move to the previous layout in the session.
1.1 nicm 2397: .It Xo Ic previous-window
1.9 nicm 2398: .Op Fl a
1.1 nicm 2399: .Op Fl t Ar target-session
2400: .Xc
2401: .D1 (alias: Ic prev )
2402: Move to the previous window in the session.
1.9 nicm 2403: With
2404: .Fl a ,
1.295 nicm 2405: move to the previous window with an alert.
1.1 nicm 2406: .It Xo Ic rename-window
2407: .Op Fl t Ar target-window
2408: .Ar new-name
2409: .Xc
2410: .D1 (alias: Ic renamew )
2411: Rename the current window, or the window at
2412: .Ar target-window
2413: if specified, to
2414: .Ar new-name .
2415: .It Xo Ic resize-pane
1.727 nicm 2416: .Op Fl DLMRTUZ
1.52 nicm 2417: .Op Fl t Ar target-pane
1.324 nicm 2418: .Op Fl x Ar width
2419: .Op Fl y Ar height
1.1 nicm 2420: .Op Ar adjustment
2421: .Xc
2422: .D1 (alias: Ic resizep )
1.324 nicm 2423: Resize a pane, up, down, left or right by
2424: .Ar adjustment
2425: with
2426: .Fl U ,
1.57 jmc 2427: .Fl D ,
2428: .Fl L
1.324 nicm 2429: or
2430: .Fl R ,
2431: or
2432: to an absolute size
2433: with
2434: .Fl x
2435: or
2436: .Fl y .
1.57 jmc 2437: The
2438: .Ar adjustment
1.690 nicm 2439: is given in lines or columns (the default is 1);
2440: .Fl x
2441: and
2442: .Fl y
2443: may be a given as a number of lines or columns or followed by
2444: .Ql %
2445: for a percentage of the window size (for example
2446: .Ql -x 10% ) .
1.337 nicm 2447: With
2448: .Fl Z ,
1.349 nicm 2449: the active pane is toggled between zoomed (occupying the whole of the window)
2450: and unzoomed (its normal position in the layout).
1.419 nicm 2451: .Pp
2452: .Fl M
2453: begins mouse resizing (only valid if bound to a mouse key binding, see
1.420 jmc 2454: .Sx MOUSE SUPPORT ) .
1.729 nicm 2455: .Pp
2456: .Fl T
1.727 nicm 2457: trims all lines below the current cursor position and moves lines out of the
2458: history to replace them.
1.629 nicm 2459: .It Xo Ic resize-window
2460: .Op Fl aADLRU
2461: .Op Fl t Ar target-window
2462: .Op Fl x Ar width
2463: .Op Fl y Ar height
2464: .Op Ar adjustment
2465: .Xc
2466: .D1 (alias: Ic resizew )
2467: Resize a window, up, down, left or right by
2468: .Ar adjustment
2469: with
2470: .Fl U ,
2471: .Fl D ,
2472: .Fl L
2473: or
2474: .Fl R ,
2475: or
2476: to an absolute size
2477: with
2478: .Fl x
2479: or
2480: .Fl y .
2481: The
2482: .Ar adjustment
2483: is given in lines or cells (the default is 1).
2484: .Fl A
2485: sets the size of the largest session containing the window;
2486: .Fl a
2487: the size of the smallest.
2488: This command will automatically set
2489: .Ic window-size
2490: to manual in the window options.
1.234 nicm 2491: .It Xo Ic respawn-pane
1.641 nicm 2492: .Op Fl k
1.568 nicm 2493: .Op Fl c Ar start-directory
1.641 nicm 2494: .Op Fl e Ar environment
1.234 nicm 2495: .Op Fl t Ar target-pane
2496: .Op Ar shell-command
2497: .Xc
2498: .D1 (alias: Ic respawnp )
2499: Reactivate a pane in which the command has exited (see the
2500: .Ic remain-on-exit
2501: window option).
2502: If
2503: .Ar shell-command
2504: is not given, the command used when the pane was created is executed.
2505: The pane must be already inactive, unless
2506: .Fl k
2507: is given, in which case any existing command is killed.
1.568 nicm 2508: .Fl c
2509: specifies a new working directory for the pane.
1.641 nicm 2510: The
2511: .Fl e
2512: option has the same meaning as for the
2513: .Ic new-window
2514: command.
1.57 jmc 2515: .It Xo Ic respawn-window
1.641 nicm 2516: .Op Fl k
1.568 nicm 2517: .Op Fl c Ar start-directory
1.641 nicm 2518: .Op Fl e Ar environment
1.57 jmc 2519: .Op Fl t Ar target-window
1.153 nicm 2520: .Op Ar shell-command
1.57 jmc 2521: .Xc
2522: .D1 (alias: Ic respawnw )
1.153 nicm 2523: Reactivate a window in which the command has exited (see the
1.57 jmc 2524: .Ic remain-on-exit
2525: window option).
2526: If
1.153 nicm 2527: .Ar shell-command
1.57 jmc 2528: is not given, the command used when the window was created is executed.
2529: The window must be already inactive, unless
2530: .Fl k
2531: is given, in which case any existing command is killed.
1.568 nicm 2532: .Fl c
2533: specifies a new working directory for the window.
1.641 nicm 2534: The
2535: .Fl e
2536: option has the same meaning as for the
2537: .Ic new-window
2538: command.
1.57 jmc 2539: .It Xo Ic rotate-window
1.681 nicm 2540: .Op Fl DUZ
1.57 jmc 2541: .Op Fl t Ar target-window
2542: .Xc
2543: .D1 (alias: Ic rotatew )
2544: Rotate the positions of the panes within a window, either upward (numerically
2545: lower) with
2546: .Fl U
2547: or downward (numerically higher).
1.681 nicm 2548: .Fl Z
2549: keeps the window zoomed if it was zoomed.
1.57 jmc 2550: .It Xo Ic select-layout
1.588 nicm 2551: .Op Fl Enop
2552: .Op Fl t Ar target-pane
1.57 jmc 2553: .Op Ar layout-name
2554: .Xc
1.176 nicm 2555: .D1 (alias: Ic selectl )
1.57 jmc 2556: Choose a specific layout for a window.
2557: If
2558: .Ar layout-name
1.181 nicm 2559: is not given, the last preset layout used (if any) is reapplied.
1.204 nicm 2560: .Fl n
2561: and
2562: .Fl p
2563: are equivalent to the
2564: .Ic next-layout
2565: and
2566: .Ic previous-layout
2567: commands.
1.424 nicm 2568: .Fl o
2569: applies the last set layout if possible (undoes the most recent layout change).
1.588 nicm 2570: .Fl E
2571: spreads the current pane and any panes next to it out evenly.
1.156 nicm 2572: .It Xo Ic select-pane
1.681 nicm 2573: .Op Fl DdeLlMmRUZ
1.577 nicm 2574: .Op Fl T Ar title
1.156 nicm 2575: .Op Fl t Ar target-pane
2576: .Xc
1.57 jmc 2577: .D1 (alias: Ic selectp )
2578: Make pane
2579: .Ar target-pane
2580: the active pane in window
1.673 jmc 2581: .Ar target-window .
1.156 nicm 2582: If one of
2583: .Fl D ,
2584: .Fl L ,
2585: .Fl R ,
2586: or
2587: .Fl U
2588: is used, respectively the pane below, to the left, to the right, or above the
2589: target pane is used.
1.681 nicm 2590: .Fl Z
2591: keeps the window zoomed if it was zoomed.
1.204 nicm 2592: .Fl l
2593: is the same as using the
2594: .Ic last-pane
2595: command.
1.398 nicm 2596: .Fl e
2597: enables or
2598: .Fl d
2599: disables input to the pane.
1.668 nicm 2600: .Fl T
2601: sets the pane title.
1.418 nicm 2602: .Pp
1.432 nicm 2603: .Fl m
2604: and
2605: .Fl M
2606: are used to set and clear the
2607: .Em marked pane .
2608: There is one marked pane at a time, setting a new marked pane clears the last.
2609: The marked pane is the default target for
2610: .Fl s
2611: to
2612: .Ic join-pane ,
2613: .Ic swap-pane
2614: and
2615: .Ic swap-window .
1.204 nicm 2616: .It Xo Ic select-window
1.310 nicm 2617: .Op Fl lnpT
1.204 nicm 2618: .Op Fl t Ar target-window
2619: .Xc
1.57 jmc 2620: .D1 (alias: Ic selectw )
2621: Select the window at
2622: .Ar target-window .
1.204 nicm 2623: .Fl l ,
2624: .Fl n
2625: and
2626: .Fl p
2627: are equivalent to the
2628: .Ic last-window ,
2629: .Ic next-window
2630: and
2631: .Ic previous-window
2632: commands.
1.310 nicm 2633: If
2634: .Fl T
2635: is given and the selected window is already the current window,
2636: the command behaves like
2637: .Ic last-window .
1.57 jmc 2638: .It Xo Ic split-window
1.643 nicm 2639: .Op Fl bdfhIvP
1.272 nicm 2640: .Op Fl c Ar start-directory
1.641 nicm 2641: .Op Fl e Ar environment
1.690 nicm 2642: .Op Fl l Ar size
1.136 nicm 2643: .Op Fl t Ar target-pane
1.153 nicm 2644: .Op Ar shell-command
1.279 nicm 2645: .Op Fl F Ar format
1.57 jmc 2646: .Xc
1.176 nicm 2647: .D1 (alias: Ic splitw )
1.136 nicm 2648: Create a new pane by splitting
2649: .Ar target-pane :
1.57 jmc 2650: .Fl h
2651: does a horizontal split and
2652: .Fl v
2653: a vertical split; if neither is specified,
2654: .Fl v
2655: is assumed.
2656: The
2657: .Fl l
1.690 nicm 2658: option specifies the size of the new pane in lines (for vertical split) or in
2659: columns (for horizontal split);
2660: .Ar size
2661: may be followed by
2662: .Ql %
2663: to specify a percentage of the available space.
1.408 nicm 2664: The
2665: .Fl b
2666: option causes the new pane to be created to the left of or above
2667: .Ar target-pane .
1.494 nicm 2668: The
2669: .Fl f
2670: option creates a new pane spanning the full window height (with
2671: .Fl h )
2672: or full window width (with
2673: .Fl v ) ,
2674: instead of splitting the active pane.
1.643 nicm 2675: .Pp
2676: An empty
2677: .Ar shell-command
2678: ('') will create a pane with no command running in it.
2679: Output can be sent to such a pane with the
2680: .Ic display-message
2681: command.
2682: The
2683: .Fl I
2684: flag (if
2685: .Ar shell-command
2686: is not specified or empty)
2687: will create an empty pane and forward any output from stdin to it.
2688: For example:
2689: .Bd -literal -offset indent
2690: $ make 2>&1|tmux splitw -dI &
2691: .Ed
2692: .Pp
1.136 nicm 2693: All other options have the same meaning as for the
1.57 jmc 2694: .Ic new-window
2695: command.
2696: .It Xo Ic swap-pane
1.681 nicm 2697: .Op Fl dDUZ
1.57 jmc 2698: .Op Fl s Ar src-pane
2699: .Op Fl t Ar dst-pane
2700: .Xc
2701: .D1 (alias: Ic swapp )
2702: Swap two panes.
2703: If
2704: .Fl U
2705: is used and no source pane is specified with
2706: .Fl s ,
2707: .Ar dst-pane
2708: is swapped with the previous pane (before it numerically);
2709: .Fl D
2710: swaps with the next pane (after it numerically).
1.138 nicm 2711: .Fl d
2712: instructs
2713: .Nm
1.681 nicm 2714: not to change the active pane and
2715: .Fl Z
2716: keeps the window zoomed if it was zoomed.
1.432 nicm 2717: .Pp
2718: If
2719: .Fl s
2720: is omitted and a marked pane is present (see
2721: .Ic select-pane
2722: .Fl m ) ,
2723: the marked pane is used rather than the current pane.
1.57 jmc 2724: .It Xo Ic swap-window
2725: .Op Fl d
2726: .Op Fl s Ar src-window
2727: .Op Fl t Ar dst-window
2728: .Xc
2729: .D1 (alias: Ic swapw )
2730: This is similar to
2731: .Ic link-window ,
2732: except the source and destination windows are swapped.
2733: It is an error if no window exists at
2734: .Ar src-window .
1.705 nicm 2735: If
2736: .Fl d
2737: is given, the new window does not become the current window.
1.432 nicm 2738: .Pp
1.705 nicm 2739: If
1.432 nicm 2740: .Fl s
2741: is omitted and a marked pane is present (see
2742: .Ic select-pane
2743: .Fl m ) ,
2744: the window containing the marked pane is used rather than the current window.
1.57 jmc 2745: .It Xo Ic unlink-window
1.1 nicm 2746: .Op Fl k
2747: .Op Fl t Ar target-window
2748: .Xc
1.57 jmc 2749: .D1 (alias: Ic unlinkw )
2750: Unlink
2751: .Ar target-window .
2752: Unless
2753: .Fl k
2754: is given, a window may be unlinked only if it is linked to multiple sessions -
2755: windows may not be linked to no sessions;
2756: if
1.1 nicm 2757: .Fl k
1.57 jmc 2758: is specified and the window is linked to only one session, it is unlinked and
2759: destroyed.
2760: .El
2761: .Sh KEY BINDINGS
1.93 nicm 2762: .Nm
2763: allows a command to be bound to most keys, with or without a prefix key.
2764: When specifying keys, most represent themselves (for example
2765: .Ql A
2766: to
1.95 jmc 2767: .Ql Z ) .
1.93 nicm 2768: Ctrl keys may be prefixed with
2769: .Ql C-
2770: or
1.95 jmc 2771: .Ql ^ ,
2772: and Alt (meta) with
1.93 nicm 2773: .Ql M- .
2774: In addition, the following special key names are accepted:
1.126 nicm 2775: .Em Up ,
2776: .Em Down ,
2777: .Em Left ,
2778: .Em Right ,
1.93 nicm 2779: .Em BSpace ,
2780: .Em BTab ,
2781: .Em DC
2782: (Delete),
2783: .Em End ,
2784: .Em Enter ,
2785: .Em Escape ,
2786: .Em F1
2787: to
1.402 nicm 2788: .Em F12 ,
1.93 nicm 2789: .Em Home ,
2790: .Em IC
2791: (Insert),
1.254 nicm 2792: .Em NPage/PageDown/PgDn ,
2793: .Em PPage/PageUp/PgUp ,
1.93 nicm 2794: .Em Space ,
2795: and
2796: .Em Tab .
2797: Note that to bind the
2798: .Ql \&"
2799: or
2800: .Ql '
2801: keys, quotation marks are necessary, for example:
2802: .Bd -literal -offset indent
2803: bind-key '"' split-window
1.167 nicm 2804: bind-key "'" new-window
1.93 nicm 2805: .Ed
1.693 nicm 2806: .Pp
2807: A command bound to the
2808: .Em Any
2809: key will execute for all keys which do not have a more specific binding.
1.93 nicm 2810: .Pp
1.57 jmc 2811: Commands related to key bindings are as follows:
2812: .Bl -tag -width Ds
2813: .It Xo Ic bind-key
1.501 nicm 2814: .Op Fl nr
1.706 nicm 2815: .Op Fl N Ar note
1.421 nicm 2816: .Op Fl T Ar key-table
1.750 jmc 2817: .Ar key command Op Ar arguments
1.1 nicm 2818: .Xc
1.57 jmc 2819: .D1 (alias: Ic bind )
2820: Bind key
2821: .Ar key
2822: to
2823: .Ar command .
1.421 nicm 2824: Keys are bound in a key table.
2825: By default (without -T), the key is bound in
2826: the
2827: .Em prefix
2828: key table.
2829: This table is used for keys pressed after the prefix key (for example,
2830: by default
2831: .Ql c
2832: is bound to
2833: .Ic new-window
2834: in the
2835: .Em prefix
2836: table, so
2837: .Ql C-b c
2838: creates a new window).
2839: The
2840: .Em root
2841: table is used for keys pressed without the prefix key: binding
2842: .Ql c
2843: to
2844: .Ic new-window
2845: in the
2846: .Em root
2847: table (not recommended) means a plain
2848: .Ql c
2849: will create a new window.
1.57 jmc 2850: .Fl n
1.421 nicm 2851: is an alias
2852: for
2853: .Fl T Ar root .
2854: Keys may also be bound in custom key tables and the
2855: .Ic switch-client
2856: .Fl T
2857: command used to switch to them from a key binding.
1.1 nicm 2858: The
1.57 jmc 2859: .Fl r
2860: flag indicates this key may repeat, see the
2861: .Ic repeat-time
2862: option.
1.706 nicm 2863: .Fl N
2864: attaches a note to the key (shown with
2865: .Ic list-keys
2866: .Fl N ) .
1.57 jmc 2867: .Pp
2868: To view the default bindings and possible commands, see the
2869: .Ic list-keys
2870: command.
1.421 nicm 2871: .It Xo Ic list-keys
1.712 nicm 2872: .Op Fl 1aN
1.706 nicm 2873: .Op Fl P Ar prefix-string Fl T Ar key-table
1.731 nicm 2874: .Op Ar key
1.421 nicm 2875: .Xc
1.57 jmc 2876: .D1 (alias: Ic lsk )
1.710 nicm 2877: List key bindings.
2878: There are two forms: the default lists keys as
1.706 nicm 2879: .Ic bind-key
1.710 nicm 2880: commands;
2881: .Fl N
2882: lists only keys with attached notes and shows only the key and note for each
2883: key.
2884: .Pp
2885: With the default form, all key tables are listed by default.
2886: .Fl T
2887: lists only keys in
2888: .Ar key-table .
2889: .Pp
2890: With the
1.706 nicm 2891: .Fl N
1.710 nicm 2892: form, only keys in the
1.706 nicm 2893: .Em root
2894: and
2895: .Em prefix
1.710 nicm 2896: key tables are listed by default;
2897: .Fl T
2898: also lists only keys in
2899: .Ar key-table .
1.706 nicm 2900: .Fl P
1.710 nicm 2901: specifies a prefix to print before each key and
1.706 nicm 2902: .Fl 1
1.710 nicm 2903: lists only the first matching key.
1.712 nicm 2904: .Fl a
2905: lists the command for keys that do have a note rather than skipping them.
1.57 jmc 2906: .It Xo Ic send-keys
1.694 nicm 2907: .Op Fl FHlMRX
1.497 nicm 2908: .Op Fl N Ar repeat-count
1.72 nicm 2909: .Op Fl t Ar target-pane
1.57 jmc 2910: .Ar key Ar ...
1.1 nicm 2911: .Xc
1.57 jmc 2912: .D1 (alias: Ic send )
2913: Send a key or keys to a window.
2914: Each argument
2915: .Ar key
2916: is the name of the key (such as
2917: .Ql C-a
2918: or
1.523 nicm 2919: .Ql NPage )
2920: to send; if the string is not recognised as a key, it is sent as a series of
1.57 jmc 2921: characters.
1.676 nicm 2922: All arguments are sent sequentially from first to last.
2923: .Pp
1.273 nicm 2924: The
2925: .Fl l
1.676 nicm 2926: flag disables key name lookup and processes the keys as literal UTF-8
2927: characters.
2928: The
2929: .Fl H
2930: flag expects each key to be a hexadecimal number for an ASCII character.
2931: .Pp
1.265 nicm 2932: The
2933: .Fl R
2934: flag causes the terminal state to be reset.
1.419 nicm 2935: .Pp
2936: .Fl M
2937: passes through a mouse event (only valid if bound to a mouse key binding, see
1.420 jmc 2938: .Sx MOUSE SUPPORT ) .
1.497 nicm 2939: .Pp
2940: .Fl X
2941: is used to send a command into copy mode - see
2942: the
2943: .Sx WINDOWS AND PANES
2944: section.
2945: .Fl N
1.694 nicm 2946: specifies a repeat count and
2947: .Fl F
2948: expands formats in arguments where appropriate.
1.267 nicm 2949: .It Xo Ic send-prefix
2950: .Op Fl 2
2951: .Op Fl t Ar target-pane
2952: .Xc
2953: Send the prefix key, or with
2954: .Fl 2
2955: the secondary prefix key, to a window as if it was pressed.
1.57 jmc 2956: .It Xo Ic unbind-key
1.501 nicm 2957: .Op Fl an
1.421 nicm 2958: .Op Fl T Ar key-table
1.57 jmc 2959: .Ar key
1.2 nicm 2960: .Xc
1.57 jmc 2961: .D1 (alias: Ic unbind )
2962: Unbind the command bound to
2963: .Ar key .
1.530 nicm 2964: .Fl n
2965: and
1.421 nicm 2966: .Fl T
2967: are the same as for
2968: .Ic bind-key .
1.189 nicm 2969: If
2970: .Fl a
2971: is present, all key bindings are removed.
1.57 jmc 2972: .El
2973: .Sh OPTIONS
2974: The appearance and behaviour of
2975: .Nm
2976: may be modified by changing the value of various options.
1.668 nicm 2977: There are four types of option:
1.133 nicm 2978: .Em server options ,
1.57 jmc 2979: .Em session options
1.668 nicm 2980: .Em window options
1.57 jmc 2981: and
1.668 nicm 2982: .Em pane options .
1.57 jmc 2983: .Pp
1.133 nicm 2984: The
2985: .Nm
1.686 nicm 2986: server has a set of global server options which do not apply to any particular
1.668 nicm 2987: window or session or pane.
1.133 nicm 2988: These are altered with the
2989: .Ic set-option
2990: .Fl s
2991: command, or displayed with the
2992: .Ic show-options
2993: .Fl s
2994: command.
2995: .Pp
2996: In addition, each individual session may have a set of session options, and
2997: there is a separate set of global session options.
1.57 jmc 2998: Sessions which do not have a particular option configured inherit the value
2999: from the global session options.
3000: Session options are set or unset with the
3001: .Ic set-option
3002: command and may be listed with the
3003: .Ic show-options
3004: command.
1.133 nicm 3005: The available server and session options are listed under the
1.57 jmc 3006: .Ic set-option
3007: command.
3008: .Pp
1.668 nicm 3009: Similarly, a set of window options is attached to each window and a set of pane
3010: options to each pane.
3011: Pane options inherit from window options.
3012: This means any pane option may be set as a window option to apply the option to
3013: all panes in the window without the option set, for example these commands will
3014: set the background colour to red for all panes except pane 0:
3015: .Bd -literal -offset indent
3016: set -w window-style bg=red
3017: set -pt:.0 window-style bg=blue
3018: .Ed
3019: .Pp
3020: There is also a set of global window options from which any unset window or
3021: pane options are inherited.
3022: Window and pane options are altered with
3023: .Ic set-option
3024: .Fl w
3025: and
3026: .Fl p
3027: commands and displayed with
3028: .Ic show-option
3029: .Fl w
3030: and
3031: .Fl p .
1.318 nicm 3032: .Pp
3033: .Nm
3034: also supports user options which are prefixed with a
3035: .Ql \&@ .
1.321 jmc 3036: User options may have any name, so long as they are prefixed with
3037: .Ql \&@ ,
1.318 nicm 3038: and be set to any string.
1.418 nicm 3039: For example:
1.318 nicm 3040: .Bd -literal -offset indent
3041: $ tmux setw -q @foo "abc123"
3042: $ tmux showw -v @foo
3043: abc123
3044: .Ed
1.57 jmc 3045: .Pp
3046: Commands which set options are as follows:
3047: .Bl -tag -width Ds
1.1 nicm 3048: .It Xo Ic set-option
1.668 nicm 3049: .Op Fl aFgopqsuw
3050: .Op Fl t Ar target-pane
1.1 nicm 3051: .Ar option Ar value
3052: .Xc
3053: .D1 (alias: Ic set )
1.668 nicm 3054: Set a pane option with
3055: .Fl p ,
3056: a window option with
3057: .Fl w ,
1.133 nicm 3058: a server option with
3059: .Fl s ,
3060: otherwise a session option.
1.637 nicm 3061: If the option is not a user option,
3062: .Fl w
1.668 nicm 3063: or
1.637 nicm 3064: .Fl s
1.668 nicm 3065: may be unnecessary -
1.637 nicm 3066: .Nm
1.668 nicm 3067: will infer the type from the option name, assuming
3068: .Fl w
3069: for pane options.
1.133 nicm 3070: If
3071: .Fl g
1.433 nicm 3072: is given, the global session or window option is set.
1.637 nicm 3073: .Pp
1.550 nicm 3074: .Fl F
3075: expands formats in the option value.
1.1 nicm 3076: The
3077: .Fl u
3078: flag unsets an option, so a session inherits the option from the global
1.433 nicm 3079: options (or with
3080: .Fl g ,
3081: restores a global option to the default).
1.336 nicm 3082: .Pp
3083: The
3084: .Fl o
1.446 nicm 3085: flag prevents setting an option that is already set and the
1.281 nicm 3086: .Fl q
1.446 nicm 3087: flag suppresses errors about unknown or ambiguous options.
1.281 nicm 3088: .Pp
1.378 nicm 3089: With
3090: .Fl a ,
3091: and if the option expects a string or a style,
3092: .Ar value
3093: is appended to the existing setting.
3094: For example:
3095: .Bd -literal -offset indent
3096: set -g status-left "foo"
3097: set -ag status-left "bar"
3098: .Ed
3099: .Pp
3100: Will result in
3101: .Ql foobar .
3102: And:
3103: .Bd -literal -offset indent
3104: set -g status-style "bg=red"
3105: set -ag status-style "fg=blue"
3106: .Ed
3107: .Pp
3108: Will result in a red background
3109: .Em and
3110: blue foreground.
3111: Without
3112: .Fl a ,
3113: the result would be the default background and a blue foreground.
1.668 nicm 3114: .It Xo Ic show-options
3115: .Op Fl AgHpqsvw
3116: .Op Fl t Ar target-pane
3117: .Op Ar option
3118: .Xc
3119: .D1 (alias: Ic show )
3120: Show the pane options (or a single option if
3121: .Ar option
3122: is provided) with
3123: .Fl p ,
3124: the window options with
3125: .Fl w ,
3126: the server options with
3127: .Fl s ,
3128: otherwise the session options.
3129: If the option is not a user option,
3130: .Fl w
3131: or
3132: .Fl s
3133: may be unnecessary -
3134: .Nm
3135: will infer the type from the option name, assuming
3136: .Fl w
3137: for pane options.
3138: Global session or window options are listed if
3139: .Fl g
3140: is used.
3141: .Fl v
3142: shows only the option value, not the name.
3143: If
3144: .Fl q
3145: is set, no error will be returned if
3146: .Ar option
3147: is unset.
3148: .Fl H
3149: includes hooks (omitted by default).
3150: .Fl A
3151: includes options inherited from a parent set of options, such options are
3152: marked with an asterisk.
1.274 nicm 3153: .Ar value
3154: depends on the option and may be a number, a string, or a flag (on, off, or
3155: omitted to toggle).
1.668 nicm 3156: .El
1.133 nicm 3157: .Pp
3158: Available server options are:
3159: .Bl -tag -width Ds
1.695 nicm 3160: .It Ic backspace Ar key
3161: Set the key sent by
3162: .Nm
3163: for backspace.
1.198 nicm 3164: .It Ic buffer-limit Ar number
3165: Set the number of buffers; as new buffers are added to the top of the stack,
3166: old ones are removed from the bottom if necessary to maintain this maximum
3167: length.
1.526 nicm 3168: .It Xo Ic command-alias[]
3169: .Ar name=value
3170: .Xc
3171: This is an array of custom aliases for commands.
3172: If an unknown command matches
3173: .Ar name ,
3174: it is replaced with
3175: .Ar value .
3176: For example, after:
3177: .Pp
1.565 nicm 3178: .Dl set -s command-alias[100] zoom='resize-pane -Z'
1.526 nicm 3179: .Pp
3180: Using:
3181: .Pp
3182: .Dl zoom -t:.1
3183: .Pp
3184: Is equivalent to:
3185: .Pp
3186: .Dl resize-pane -Z -t:.1
3187: .Pp
3188: Note that aliases are expanded when a command is parsed rather than when it is
3189: executed, so binding an alias with
3190: .Ic bind-key
3191: will bind the expanded form.
1.425 nicm 3192: .It Ic default-terminal Ar terminal
3193: Set the default terminal for new windows created in this session - the
3194: default value of the
3195: .Ev TERM
3196: environment variable.
3197: For
3198: .Nm
3199: to work correctly, this
3200: .Em must
3201: be set to
3202: .Ql screen ,
3203: .Ql tmux
3204: or a derivative of them.
1.742 nicm 3205: .It Ic copy-command Ar shell-command
3206: Give the command to pipe to if the
3207: .Ic copy-pipe
3208: copy mode command is used without arguments.
1.239 nicm 3209: .It Ic escape-time Ar time
3210: Set the time in milliseconds for which
3211: .Nm
3212: waits after an escape is input to determine if it is part of a function or meta
3213: key sequences.
3214: The default is 500 milliseconds.
1.759 nicm 3215: .It Ic editor Ar shell-command
3216: Set the command used when
3217: .Nm
3218: runs an editor.
1.592 nicm 3219: .It Xo Ic exit-empty
3220: .Op Ic on | off
3221: .Xc
3222: If enabled (the default), the server will exit when there are no active
3223: sessions.
1.239 nicm 3224: .It Xo Ic exit-unattached
3225: .Op Ic on | off
3226: .Xc
3227: If enabled, the server will exit when there are no attached clients.
1.362 nicm 3228: .It Xo Ic focus-events
3229: .Op Ic on | off
3230: .Xc
3231: When enabled, focus events are requested from the terminal if supported and
3232: passed through to applications running in
3233: .Nm .
3234: Attached clients should be detached and attached again after changing this
3235: option.
1.445 nicm 3236: .It Ic history-file Ar path
3237: If not empty, a file to which
3238: .Nm
3239: will write command prompt history on exit and load it from on start.
1.384 nicm 3240: .It Ic message-limit Ar number
3241: Set the number of error or information messages to save in the message log for
3242: each client.
3243: The default is 100.
1.228 nicm 3244: .It Xo Ic set-clipboard
1.556 nicm 3245: .Op Ic on | external | off
1.228 nicm 3246: .Xc
3247: Attempt to set the terminal clipboard content using the
3248: .Xr xterm 1
1.560 nicm 3249: escape sequence, if there is an
1.228 nicm 3250: .Em \&Ms
3251: entry in the
3252: .Xr terminfo 5
1.560 nicm 3253: description (see the
3254: .Sx TERMINFO EXTENSIONS
3255: section).
3256: .Pp
1.556 nicm 3257: If set to
3258: .Ic on ,
3259: .Nm
3260: will both accept the escape sequence to create a buffer and attempt to set
3261: the terminal clipboard.
3262: If set to
3263: .Ic external ,
3264: .Nm
3265: will attempt to set the terminal clipboard but ignore attempts
3266: by applications to set
3267: .Nm
3268: buffers.
3269: If
3270: .Ic off ,
3271: .Nm
3272: will neither accept the clipboard escape sequence nor attempt to set the
3273: clipboard.
3274: .Pp
1.228 nicm 3275: Note that this feature needs to be enabled in
3276: .Xr xterm 1
3277: by setting the resource:
3278: .Bd -literal -offset indent
3279: disallowedWindowOps: 20,21,SetXprop
3280: .Ed
3281: .Pp
3282: Or changing this property from the
3283: .Xr xterm 1
3284: interactive menu when required.
1.744 nicm 3285: .It Ic terminal-features[] Ar string
3286: Set terminal features for terminal types read from
3287: .Xr terminfo 5 .
3288: .Nm
3289: has a set of named terminal features.
3290: Each will apply appropriate changes to the
3291: .Xr terminfo 5
3292: entry in use.
3293: .Pp
3294: .Nm
3295: can detect features for a few common terminals; this option can be used to
3296: easily tell tmux about features supported by terminals it cannot detect.
3297: The
3298: .Ic terminal-overrides
3299: option allows individual
3300: .Xr terminfo 5
3301: capabilities to be set instead,
3302: .Ic terminal-features
3303: is intended for classes of functionality supported in a standard way but not
3304: reported by
3305: .Xr terminfo 5 .
3306: Care must be taken only to configure this with features the terminal actually
3307: support.
3308: .Pp
3309: This is an array option where each entry is a colon-separated string made up
3310: of a terminal type pattern (matched using
3311: .Xr fnmatch 3 )
3312: followed by a list of terminal features.
3313: The available features are:
3314: .Bl -tag -width Ds
3315: .It 256
3316: Supports 256 colours with the SGR escape sequences.
3317: .It clipboard
3318: Allows setting the system clipboard.
3319: .It ccolour
3320: Allows setting the cursor colour.
3321: .It cstyle
3322: Allows setting the cursor style.
3323: .It margins
3324: Supports DECSLRM margins.
3325: .It overline
3326: Supports the overline SGR attribute.
3327: .It rectfill
3328: Supports the DECFRA rectangle fill escape sequence.
3329: .It RGB
3330: Supports RGB colour with the SGR escape sequences.
3331: .It sync
3332: Supports synchronized updates.
3333: .It title
3334: Supports
3335: .Xr xterm 1
3336: title setting.
3337: .It usstyle
3338: Allows underscore style and colour to be set.
3339: .It UTF-8
3340: Is able to handle UTF-8 output.
3341: .El
1.528 nicm 3342: .It Ic terminal-overrides[] Ar string
3343: Allow terminal descriptions read using
3344: .Xr terminfo 5
1.531 nicm 3345: to be overridden.
1.528 nicm 3346: Each entry is a colon-separated string made up of a terminal type pattern
3347: (matched using
1.381 nicm 3348: .Xr fnmatch 3 )
3349: and a set of
3350: .Em name=value
3351: entries.
3352: .Pp
3353: For example, to set the
3354: .Ql clear
3355: .Xr terminfo 5
3356: entry to
3357: .Ql \ee[H\ee[2J
1.528 nicm 3358: for all terminal types matching
3359: .Ql rxvt* :
3360: .Pp
3361: .Dl "rxvt*:clear=\ee[H\ee[2J"
1.381 nicm 3362: .Pp
3363: The terminal entry value is passed through
3364: .Xr strunvis 3
3365: before interpretation.
1.678 nicm 3366: .It Ic user-keys[] Ar key
3367: Set list of user-defined key escape sequences.
3368: Each item is associated with a key named
3369: .Ql User0 ,
3370: .Ql User1 ,
3371: and so on.
3372: .Pp
3373: For example:
3374: .Bd -literal -offset indent
3375: set -s user-keys[0] "\ee[5;30012~"
3376: bind User0 resize-pane -L 3
3377: .Ed
1.133 nicm 3378: .El
1.129 nicm 3379: .Pp
1.18 nicm 3380: Available session options are:
1.1 nicm 3381: .Bl -tag -width Ds
1.569 nicm 3382: .It Xo Ic activity-action
3383: .Op Ic any | none | current | other
3384: .Xc
3385: Set action on window activity when
3386: .Ic monitor-activity
3387: is on.
3388: .Ic any
3389: means activity in any window linked to a session causes a bell or message
3390: (depending on
3391: .Ic visual-activity )
3392: in the current window of that session,
3393: .Ic none
3394: means all activity is ignored (equivalent to
3395: .Ic monitor-activity
3396: being off),
3397: .Ic current
3398: means only activity in windows other than the current window are ignored and
3399: .Ic other
3400: means activity in the current window is ignored but not those in other windows.
1.312 nicm 3401: .It Ic assume-paste-time Ar milliseconds
3402: If keys are entered faster than one in
3403: .Ar milliseconds ,
3404: they are assumed to have been pasted rather than typed and
3405: .Nm
3406: key bindings are not processed.
3407: The default is one millisecond and zero disables.
1.69 nicm 3408: .It Ic base-index Ar index
3409: Set the base index from which an unused index should be searched when a new
3410: window is created.
3411: The default is zero.
1.1 nicm 3412: .It Xo Ic bell-action
1.429 nicm 3413: .Op Ic any | none | current | other
1.1 nicm 3414: .Xc
1.574 nicm 3415: Set action on a bell in a window when
3416: .Ic monitor-bell
3417: is on.
1.569 nicm 3418: The values are the same as those for
3419: .Ic activity-action .
1.153 nicm 3420: .It Ic default-command Ar shell-command
1.1 nicm 3421: Set the command used for new windows (if not specified when the window is
3422: created) to
1.153 nicm 3423: .Ar shell-command ,
1.79 nicm 3424: which may be any
3425: .Xr sh 1
3426: command.
1.19 nicm 3427: The default is an empty string, which instructs
3428: .Nm
1.79 nicm 3429: to create a login shell using the value of the
3430: .Ic default-shell
3431: option.
3432: .It Ic default-shell Ar path
3433: Specify the default shell.
3434: This is used as the login shell for new windows when the
3435: .Ic default-command
3436: option is set to empty, and must be the full path of the executable.
3437: When started
3438: .Nm
3439: tries to set a default value from the first suitable of the
1.19 nicm 3440: .Ev SHELL
1.79 nicm 3441: environment variable, the shell returned by
3442: .Xr getpwuid 3 ,
3443: or
3444: .Pa /bin/sh .
3445: This option should be configured when
3446: .Nm
3447: is used as a login shell.
1.629 nicm 3448: .It Ic default-size Ar XxY
1.642 nicm 3449: Set the default size of new windows when the
1.643 nicm 3450: .Ic window-size
1.642 nicm 3451: option is set to manual or when a session is created with
3452: .Ic new-session
3453: .Fl d .
3454: The value is the width and height separated by an
3455: .Ql x
3456: character.
3457: The default is 80x24.
1.206 nicm 3458: .It Xo Ic destroy-unattached
3459: .Op Ic on | off
3460: .Xc
1.185 nicm 3461: If enabled and the session is no longer attached to any clients, it is
3462: destroyed.
1.206 nicm 3463: .It Xo Ic detach-on-destroy
3464: .Op Ic on | off
3465: .Xc
1.184 nicm 3466: If on (the default), the client is detached when the session it is attached to
3467: is destroyed.
3468: If off, the client is switched to the most recently active of the remaining
3469: sessions.
1.145 nicm 3470: .It Ic display-panes-active-colour Ar colour
3471: Set the colour used by the
3472: .Ic display-panes
3473: command to show the indicator for the active pane.
1.78 nicm 3474: .It Ic display-panes-colour Ar colour
1.145 nicm 3475: Set the colour used by the
1.78 nicm 3476: .Ic display-panes
1.145 nicm 3477: command to show the indicators for inactive panes.
1.78 nicm 3478: .It Ic display-panes-time Ar time
3479: Set the time in milliseconds for which the indicators shown by the
3480: .Ic display-panes
3481: command appear.
1.21 nicm 3482: .It Ic display-time Ar time
1.78 nicm 3483: Set the amount of time for which status line messages and other on-screen
3484: indicators are displayed.
1.462 tim 3485: If set to 0, messages and indicators are displayed until a key is pressed.
1.21 nicm 3486: .Ar time
3487: is in milliseconds.
1.1 nicm 3488: .It Ic history-limit Ar lines
3489: Set the maximum number of lines held in window history.
3490: This setting applies only to new windows - existing window histories are not
3491: resized and retain the limit at the point they were created.
1.474 nicm 3492: .It Ic key-table Ar key-table
3493: Set the default key table to
3494: .Ar key-table
3495: instead of
3496: .Em root .
1.1 nicm 3497: .It Ic lock-after-time Ar number
1.100 nicm 3498: Lock the session (like the
3499: .Ic lock-session
1.90 nicm 3500: command) after
1.1 nicm 3501: .Ar number
1.448 nicm 3502: seconds of inactivity.
1.100 nicm 3503: The default is not to lock (set to 0).
1.153 nicm 3504: .It Ic lock-command Ar shell-command
1.90 nicm 3505: Command to run when locking each client.
3506: The default is to run
3507: .Xr lock 1
3508: with
3509: .Fl np .
1.378 nicm 3510: .It Ic message-command-style Ar style
1.623 nicm 3511: Set status line message command style.
1.737 nicm 3512: This is used for the command prompt with
3513: .Xr vi 1
3514: keys when in command mode.
1.623 nicm 3515: For how to specify
3516: .Ar style ,
3517: see the
3518: .Sx STYLES
3519: section.
1.378 nicm 3520: .It Ic message-style Ar style
3521: Set status line message style.
1.737 nicm 3522: This is used for messages and for the command prompt.
1.378 nicm 3523: For how to specify
3524: .Ar style ,
3525: see the
1.623 nicm 3526: .Sx STYLES
3527: section.
1.419 nicm 3528: .It Xo Ic mouse
1.226 nicm 3529: .Op Ic on | off
3530: .Xc
3531: If on,
3532: .Nm
1.419 nicm 3533: captures the mouse and allows mouse events to be bound as key bindings.
3534: See the
3535: .Sx MOUSE SUPPORT
3536: section for details.
1.267 nicm 3537: .It Ic prefix Ar key
3538: Set the key accepted as a prefix key.
1.473 nicm 3539: In addition to the standard keys described under
3540: .Sx KEY BINDINGS ,
3541: .Ic prefix
3542: can be set to the special key
3543: .Ql None
3544: to set no prefix.
1.267 nicm 3545: .It Ic prefix2 Ar key
3546: Set a secondary key accepted as a prefix key.
1.473 nicm 3547: Like
3548: .Ic prefix ,
3549: .Ic prefix2
3550: can be set to
3551: .Ql None .
1.291 nicm 3552: .It Xo Ic renumber-windows
3553: .Op Ic on | off
3554: .Xc
3555: If on, when a window is closed in a session, automatically renumber the other
3556: windows in numerical order.
3557: This respects the
3558: .Ic base-index
3559: option if it has been set.
3560: If off, do not renumber the windows.
1.21 nicm 3561: .It Ic repeat-time Ar time
1.1 nicm 3562: Allow multiple commands to be entered without pressing the prefix-key again
3563: in the specified
1.21 nicm 3564: .Ar time
1.1 nicm 3565: milliseconds (the default is 500).
3566: Whether a key repeats may be set when it is bound using the
3567: .Fl r
3568: flag to
3569: .Ic bind-key .
1.52 nicm 3570: Repeat is enabled for the default keys bound to the
3571: .Ic resize-pane
3572: command.
1.1 nicm 3573: .It Xo Ic set-titles
1.56 jmc 3574: .Op Ic on | off
1.1 nicm 3575: .Xc
1.261 nicm 3576: Attempt to set the client terminal title using the
3577: .Em tsl
3578: and
3579: .Em fsl
3580: .Xr terminfo 5
3581: entries if they exist.
3582: .Nm
1.444 nicm 3583: automatically sets these to the \ee]0;...\e007 sequence if
3584: the terminal appears to be
3585: .Xr xterm 1 .
1.11 nicm 3586: This option is off by default.
1.86 nicm 3587: .It Ic set-titles-string Ar string
1.678 nicm 3588: String used to set the client terminal title if
1.86 nicm 3589: .Ic set-titles
3590: is on.
1.414 nicm 3591: Formats are expanded, see the
3592: .Sx FORMATS
3593: section.
1.569 nicm 3594: .It Xo Ic silence-action
3595: .Op Ic any | none | current | other
3596: .Xc
3597: Set action on window silence when
3598: .Ic monitor-silence
3599: is on.
3600: The values are the same as those for
3601: .Ic activity-action .
1.1 nicm 3602: .It Xo Ic status
1.625 nicm 3603: .Op Ic off | on | 2 | 3 | 4 | 5
1.1 nicm 3604: .Xc
1.625 nicm 3605: Show or hide the status line or specify its size.
3606: Using
3607: .Ic on
3608: gives a status line one row in height;
3609: .Ic 2 ,
3610: .Ic 3 ,
3611: .Ic 4
3612: or
3613: .Ic 5
3614: more rows.
3615: .It Ic status-format[] Ar format
3616: Specify the format to be used for each line of the status line.
3617: The default builds the top status line from the various individual status
3618: options below.
1.1 nicm 3619: .It Ic status-interval Ar interval
1.538 nicm 3620: Update the status line every
1.1 nicm 3621: .Ar interval
3622: seconds.
3623: By default, updates will occur every 15 seconds.
3624: A setting of zero disables redrawing at interval.
1.41 nicm 3625: .It Xo Ic status-justify
1.56 jmc 3626: .Op Ic left | centre | right
1.41 nicm 3627: .Xc
3628: Set the position of the window list component of the status line: left, centre
3629: or right justified.
1.1 nicm 3630: .It Xo Ic status-keys
1.56 jmc 3631: .Op Ic vi | emacs
1.1 nicm 3632: .Xc
1.6 jmc 3633: Use vi or emacs-style
1.1 nicm 3634: key bindings in the status line, for example at the command prompt.
1.191 nicm 3635: The default is emacs, unless the
3636: .Ev VISUAL
3637: or
3638: .Ev EDITOR
3639: environment variables are set and contain the string
3640: .Ql vi .
1.1 nicm 3641: .It Ic status-left Ar string
3642: Display
3643: .Ar string
1.538 nicm 3644: (by default the session name) to the left of the status line.
1.1 nicm 3645: .Ar string
3646: will be passed through
1.623 nicm 3647: .Xr strftime 3 .
3648: Also see the
3649: .Sx FORMATS
3650: and
3651: .Sx STYLES
3652: sections.
1.83 nicm 3653: .Pp
1.263 nicm 3654: For details on how the names and titles can be set see the
1.261 nicm 3655: .Sx "NAMES AND TITLES"
3656: section.
1.109 nicm 3657: .Pp
1.83 nicm 3658: Examples are:
3659: .Bd -literal -offset indent
3660: #(sysctl vm.loadavg)
3661: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
3662: .Ed
1.10 nicm 3663: .Pp
1.405 nicm 3664: The default is
3665: .Ql "[#S] " .
1.1 nicm 3666: .It Ic status-left-length Ar length
3667: Set the maximum
3668: .Ar length
1.538 nicm 3669: of the left component of the status line.
1.1 nicm 3670: The default is 10.
1.378 nicm 3671: .It Ic status-left-style Ar style
3672: Set the style of the left part of the status line.
3673: For how to specify
3674: .Ar style ,
3675: see the
1.623 nicm 3676: .Sx STYLES
3677: section.
1.269 nicm 3678: .It Xo Ic status-position
3679: .Op Ic top | bottom
3680: .Xc
3681: Set the position of the status line.
1.1 nicm 3682: .It Ic status-right Ar string
3683: Display
3684: .Ar string
1.538 nicm 3685: to the right of the status line.
1.577 nicm 3686: By default, the current pane title in double quotes, the date and the time
1.151 nicm 3687: are shown.
1.1 nicm 3688: As with
3689: .Ic status-left ,
3690: .Ar string
3691: will be passed to
1.459 jmc 3692: .Xr strftime 3
3693: and character pairs are replaced.
1.1 nicm 3694: .It Ic status-right-length Ar length
3695: Set the maximum
3696: .Ar length
1.538 nicm 3697: of the right component of the status line.
1.1 nicm 3698: The default is 40.
1.378 nicm 3699: .It Ic status-right-style Ar style
3700: Set the style of the right part of the status line.
3701: For how to specify
3702: .Ar style ,
3703: see the
1.623 nicm 3704: .Sx STYLES
3705: section.
1.378 nicm 3706: .It Ic status-style Ar style
3707: Set status line style.
3708: For how to specify
3709: .Ar style ,
3710: see the
1.623 nicm 3711: .Sx STYLES
3712: section.
1.529 nicm 3713: .It Ic update-environment[] Ar variable
3714: Set list of environment variables to be copied into the session environment
3715: when a new session is created or an existing session is attached.
1.63 nicm 3716: Any variables that do not exist in the source environment are set to be
3717: removed from the session environment (as if
3718: .Fl r
3719: was given to the
3720: .Ic set-environment
3721: command).
1.37 nicm 3722: .It Xo Ic visual-activity
1.569 nicm 3723: .Op Ic on | off | both
1.37 nicm 3724: .Xc
1.569 nicm 3725: If on, display a message instead of sending a bell when activity occurs in a
3726: window for which the
1.37 nicm 3727: .Ic monitor-activity
3728: window option is enabled.
1.569 nicm 3729: If set to both, a bell and a message are produced.
1.37 nicm 3730: .It Xo Ic visual-bell
1.569 nicm 3731: .Op Ic on | off | both
1.37 nicm 3732: .Xc
1.574 nicm 3733: If on, a message is shown on a bell in a window for which the
3734: .Ic monitor-bell
3735: window option is enabled instead of it being passed through to the
1.569 nicm 3736: terminal (which normally makes a sound).
3737: If set to both, a bell and a message are produced.
1.37 nicm 3738: Also see the
3739: .Ic bell-action
3740: option.
1.192 nicm 3741: .It Xo Ic visual-silence
1.569 nicm 3742: .Op Ic on | off | both
1.192 nicm 3743: .Xc
3744: If
3745: .Ic monitor-silence
1.569 nicm 3746: is enabled, prints a message after the interval has expired on a given window
3747: instead of sending a bell.
3748: If set to both, a bell and a message are produced.
1.255 nicm 3749: .It Ic word-separators Ar string
3750: Sets the session's conception of what characters are considered word
3751: separators, for the purposes of the next and previous word commands in
3752: copy mode.
3753: The default is
3754: .Ql \ -_@ .
1.1 nicm 3755: .El
3756: .Pp
1.668 nicm 3757: Available window options are:
1.56 jmc 3758: .Pp
3759: .Bl -tag -width Ds -compact
1.1 nicm 3760: .It Xo Ic aggressive-resize
1.56 jmc 3761: .Op Ic on | off
1.1 nicm 3762: .Xc
3763: Aggressively resize the chosen window.
3764: This means that
3765: .Nm
1.642 nicm 3766: will resize the window to the size of the smallest or largest session
3767: (see the
3768: .Ic window-size
3769: option) for which it is the current window, rather than the session to
3770: which it is attached.
3771: The window may resize when the current window is changed on another
3772: session; this option is good for full-screen programs which support
1.6 jmc 3773: .Dv SIGWINCH
3774: and poor for interactive programs such as shells.
1.262 nicm 3775: .Pp
1.1 nicm 3776: .It Xo Ic automatic-rename
1.56 jmc 3777: .Op Ic on | off
1.1 nicm 3778: .Xc
3779: Control automatic window renaming.
3780: When this setting is enabled,
3781: .Nm
1.368 nicm 3782: will rename the window automatically using the format specified by
3783: .Ic automatic-rename-format .
1.1 nicm 3784: This flag is automatically disabled for an individual window when a name
3785: is specified at creation with
1.186 nicm 3786: .Ic new-window
3787: or
1.1 nicm 3788: .Ic new-session ,
3789: or later with
1.261 nicm 3790: .Ic rename-window ,
3791: or with a terminal escape sequence.
1.1 nicm 3792: It may be switched off globally with:
3793: .Bd -literal -offset indent
1.668 nicm 3794: set-option -wg automatic-rename off
1.1 nicm 3795: .Ed
1.368 nicm 3796: .Pp
3797: .It Ic automatic-rename-format Ar format
3798: The format (see
3799: .Sx FORMATS )
3800: used when the
3801: .Ic automatic-rename
3802: option is enabled.
1.56 jmc 3803: .Pp
1.1 nicm 3804: .It Ic clock-mode-colour Ar colour
3805: Set clock colour.
1.56 jmc 3806: .Pp
1.1 nicm 3807: .It Xo Ic clock-mode-style
1.56 jmc 3808: .Op Ic 12 | 24
1.1 nicm 3809: .Xc
3810: Set clock hour format.
1.56 jmc 3811: .Pp
1.196 nicm 3812: .It Ic main-pane-height Ar height
1.2 nicm 3813: .It Ic main-pane-width Ar width
3814: Set the width or height of the main (left or top) pane in the
3815: .Ic main-horizontal
3816: or
3817: .Ic main-vertical
3818: layouts.
1.747 nicm 3819: If suffixed by
3820: .Ql % ,
3821: this is a percentage of the window size.
1.757 nicm 3822: .Pp
3823: .It Ic copy-mode-match-style Ar style
3824: Set the style of search matches in copy mode.
1.768 nicm 3825: For how to specify
3826: .Ar style ,
3827: see the
3828: .Sx STYLES
3829: section.
3830: .Pp
3831: .It Ic copy-mode-mark-style Ar style
3832: Set the style of the line containing the mark in copy mode.
1.757 nicm 3833: For how to specify
3834: .Ar style ,
3835: see the
3836: .Sx STYLES
3837: section.
3838: .Pp
3839: .It Ic copy-mode-current-match-style Ar style
3840: Set the style of the current search match in copy mode.
3841: For how to specify
3842: .Ar style ,
3843: see the
3844: .Sx STYLES
3845: section.
1.56 jmc 3846: .Pp
1.1 nicm 3847: .It Xo Ic mode-keys
1.56 jmc 3848: .Op Ic vi | emacs
1.1 nicm 3849: .Xc
1.500 nicm 3850: Use vi or emacs-style key bindings in copy mode.
3851: The default is emacs, unless
1.191 nicm 3852: .Ev VISUAL
3853: or
3854: .Ev EDITOR
3855: contains
3856: .Ql vi .
1.56 jmc 3857: .Pp
1.378 nicm 3858: .It Ic mode-style Ar style
3859: Set window modes style.
3860: For how to specify
3861: .Ar style ,
3862: see the
1.623 nicm 3863: .Sx STYLES
3864: section.
1.378 nicm 3865: .Pp
1.1 nicm 3866: .It Xo Ic monitor-activity
1.56 jmc 3867: .Op Ic on | off
1.1 nicm 3868: .Xc
3869: Monitor for activity in the window.
3870: Windows with activity are highlighted in the status line.
1.56 jmc 3871: .Pp
1.574 nicm 3872: .It Xo Ic monitor-bell
3873: .Op Ic on | off
3874: .Xc
3875: Monitor for a bell in the window.
3876: Windows with a bell are highlighted in the status line.
3877: .Pp
1.192 nicm 3878: .It Xo Ic monitor-silence
3879: .Op Ic interval
3880: .Xc
3881: Monitor for silence (no activity) in the window within
3882: .Ic interval
3883: seconds.
3884: Windows that have been silent for the interval are highlighted in the
3885: status line.
3886: An interval of zero disables the monitoring.
1.195 nicm 3887: .Pp
3888: .It Ic other-pane-height Ar height
3889: Set the height of the other panes (not the main pane) in the
3890: .Ic main-horizontal
3891: layout.
3892: If this option is set to 0 (the default), it will have no effect.
3893: If both the
3894: .Ic main-pane-height
3895: and
3896: .Ic other-pane-height
3897: options are set, the main pane will grow taller to make the other panes the
3898: specified height, but will never shrink to do so.
1.747 nicm 3899: If suffixed by
3900: .Ql % ,
3901: this is a percentage of the window size.
1.195 nicm 3902: .Pp
3903: .It Ic other-pane-width Ar width
3904: Like
3905: .Ic other-pane-height ,
3906: but set the width of other panes in the
3907: .Ic main-vertical
3908: layout.
1.243 nicm 3909: .Pp
1.413 nicm 3910: .It Ic pane-active-border-style Ar style
3911: Set the pane border style for the currently active pane.
3912: For how to specify
3913: .Ar style ,
3914: see the
1.623 nicm 3915: .Sx STYLES
3916: section.
1.413 nicm 3917: Attributes are ignored.
3918: .Pp
1.243 nicm 3919: .It Ic pane-base-index Ar index
3920: Like
3921: .Ic base-index ,
3922: but set the starting index for pane numbers.
1.484 nicm 3923: .Pp
3924: .It Ic pane-border-format Ar format
3925: Set the text shown in pane border status lines.
1.770 nicm 3926: .Pp
3927: .It Ic pane-border-lines Ar type
3928: Set the type of characters used for drawing pane borders.
3929: .Ar type
3930: may be one of:
3931: .Bl -tag -width Ds
3932: .It single
3933: single lines using ACS or UTF-8 characters
3934: .It double
3935: double lines using UTF-8 characters
3936: .It heavy
3937: heavy lines using UTF-8 characters
3938: .It simple
3939: simple ASCII characters
3940: .It number
3941: the pane number
3942: .El
3943: .Pp
3944: .Ql double
3945: and
3946: .Ql heavy
3947: will fall back to standard ACS line drawing when UTF-8 is not supported.
1.484 nicm 3948: .Pp
3949: .It Xo Ic pane-border-status
3950: .Op Ic off | top | bottom
3951: .Xc
3952: Turn pane border status lines off or set their position.
1.413 nicm 3953: .Pp
3954: .It Ic pane-border-style Ar style
3955: Set the pane border style for panes aside from the active pane.
3956: For how to specify
3957: .Ar style ,
3958: see the
1.623 nicm 3959: .Sx STYLES
3960: section.
1.413 nicm 3961: Attributes are ignored.
1.192 nicm 3962: .Pp
1.99 nicm 3963: .It Xo Ic synchronize-panes
3964: .Op Ic on | off
3965: .Xc
1.164 nicm 3966: Duplicate input to any pane to all other panes in the same window (only
3967: for panes that are not in any special mode).
1.56 jmc 3968: .Pp
1.378 nicm 3969: .It Ic window-status-activity-style Ar style
3970: Set status line style for windows with an activity alert.
3971: For how to specify
3972: .Ar style ,
3973: see the
1.623 nicm 3974: .Sx STYLES
3975: section.
1.169 nicm 3976: .Pp
1.378 nicm 3977: .It Ic window-status-bell-style Ar style
3978: Set status line style for windows with a bell alert.
3979: For how to specify
3980: .Ar style ,
3981: see the
1.623 nicm 3982: .Sx STYLES
3983: section.
1.169 nicm 3984: .Pp
1.125 nicm 3985: .It Ic window-status-current-format Ar string
3986: Like
3987: .Ar window-status-format ,
3988: but is the format used when the window is the current window.
1.307 nicm 3989: .Pp
1.378 nicm 3990: .It Ic window-status-current-style Ar style
3991: Set status line style for the currently active window.
3992: For how to specify
3993: .Ar style ,
3994: see the
1.623 nicm 3995: .Sx STYLES
3996: section.
1.239 nicm 3997: .Pp
3998: .It Ic window-status-format Ar string
3999: Set the format in which the window is displayed in the status line window list.
4000: See the
1.623 nicm 4001: .Sx FORMATS
4002: and
4003: .Sx STYLES
4004: sections.
1.290 nicm 4005: .Pp
1.378 nicm 4006: .It Ic window-status-last-style Ar style
4007: Set status line style for the last active window.
4008: For how to specify
4009: .Ar style ,
4010: see the
1.623 nicm 4011: .Sx STYLES
4012: section.
1.378 nicm 4013: .Pp
1.290 nicm 4014: .It Ic window-status-separator Ar string
4015: Sets the separator drawn between windows in the status line.
4016: The default is a single space character.
1.125 nicm 4017: .Pp
1.378 nicm 4018: .It Ic window-status-style Ar style
4019: Set status line style for a single window.
1.418 nicm 4020: For how to specify
4021: .Ar style ,
4022: see the
1.623 nicm 4023: .Sx STYLES
4024: section.
1.418 nicm 4025: .Pp
1.642 nicm 4026: .It Xo Ic window-size
1.689 nicm 4027: .Ar largest | Ar smallest | Ar manual | Ar latest
1.642 nicm 4028: .Xc
4029: Configure how
4030: .Nm
4031: determines the window size.
4032: If set to
4033: .Ar largest ,
4034: the size of the largest attached session is used; if
4035: .Ar smallest ,
4036: the size of the smallest.
4037: If
4038: .Ar manual ,
4039: the size of a new window is set from the
4040: .Ic default-size
4041: option and windows are resized automatically.
1.689 nicm 4042: With
4043: .Ar latest ,
4044: .Nm
4045: uses the size of the client that had the most recent activity.
1.642 nicm 4046: See also the
4047: .Ic resize-window
4048: command and the
4049: .Ic aggressive-resize
4050: option.
4051: .Pp
1.512 nicm 4052: .It Xo Ic wrap-search
4053: .Op Ic on | off
4054: .Xc
4055: If this option is set, searches will wrap around the end of the pane contents.
4056: The default is on.
1.57 jmc 4057: .El
1.668 nicm 4058: .Pp
4059: Available pane options are:
4060: .Pp
4061: .Bl -tag -width Ds -compact
1.669 nicm 4062: .It Xo Ic allow-rename
4063: .Op Ic on | off
4064: .Xc
4065: Allow programs in the pane to change the window name using a terminal escape
4066: sequence (\eek...\ee\e\e).
4067: .Pp
4068: .It Xo Ic alternate-screen
4069: .Op Ic on | off
4070: .Xc
4071: This option configures whether programs running inside the pane may use the
4072: terminal alternate screen feature, which allows the
4073: .Em smcup
4074: and
4075: .Em rmcup
4076: .Xr terminfo 5
4077: capabilities.
4078: The alternate screen feature preserves the contents of the window when an
4079: interactive application starts and restores it on exit, so that any output
4080: visible before the application starts reappears unchanged after it exits.
4081: .Pp
1.668 nicm 4082: .It Xo Ic remain-on-exit
4083: .Op Ic on | off
1.57 jmc 4084: .Xc
1.668 nicm 4085: A pane with this flag set is not destroyed when the program running in it
4086: exits.
4087: The pane may be reactivated with the
4088: .Ic respawn-pane
4089: command.
4090: .Pp
4091: .It Ic window-active-style Ar style
4092: Set the pane style when it is the active pane.
4093: For how to specify
4094: .Ar style ,
4095: see the
4096: .Sx STYLES
4097: section.
4098: .Pp
4099: .It Ic window-style Ar style
4100: Set the pane style.
4101: For how to specify
4102: .Ar style ,
4103: see the
4104: .Sx STYLES
4105: section.
1.63 nicm 4106: .El
1.469 nicm 4107: .Sh HOOKS
4108: .Nm
4109: allows commands to run on various triggers, called
4110: .Em hooks .
1.505 nicm 4111: Most
1.483 nicm 4112: .Nm
1.505 nicm 4113: commands have an
1.483 nicm 4114: .Em after
4115: hook and there are a number of hooks not associated with commands.
4116: .Pp
1.640 nicm 4117: Hooks are stored as array options, members of the array are executed in
4118: order when the hook is triggered.
1.740 nicm 4119: Like options different hooks may be global or belong to a session, window or pane.
1.640 nicm 4120: Hooks may be configured with the
4121: .Ic set-hook
4122: or
4123: .Ic set-option
4124: commands and displayed with
4125: .Ic show-hooks
4126: or
4127: .Ic show-options
4128: .Fl H .
4129: The following two commands are equivalent:
4130: .Bd -literal -offset indent.
4131: set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red'
4132: set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red'
4133: .Ed
4134: .Pp
4135: Setting a hook without specifying an array index clears the hook and sets the
4136: first member of the array.
4137: .Pp
1.505 nicm 4138: A command's after
4139: hook is run after it completes, except when the command is run as part of a hook
1.483 nicm 4140: itself.
1.505 nicm 4141: They are named with an
1.483 nicm 4142: .Ql after-
4143: prefix.
4144: For example, the following command adds a hook to select the even-vertical
4145: layout after every
4146: .Ic split-window :
4147: .Bd -literal -offset indent
1.640 nicm 4148: set-hook -g after-split-window "selectl even-vertical"
1.483 nicm 4149: .Ed
4150: .Pp
1.584 nicm 4151: All the notifications listed in the
4152: .Sx CONTROL MODE
4153: section are hooks (without any arguments), except
4154: .Ic %exit .
4155: The following additional hooks are available:
1.560 nicm 4156: .Bl -tag -width "XXXXXXXXXXXXXXXXXXXXXX"
1.476 nicm 4157: .It alert-activity
4158: Run when a window has activity.
4159: See
4160: .Ic monitor-activity .
4161: .It alert-bell
4162: Run when a window has received a bell.
1.574 nicm 4163: See
4164: .Ic monitor-bell .
1.476 nicm 4165: .It alert-silence
4166: Run when a window has been silent.
4167: See
4168: .Ic monitor-silence .
1.469 nicm 4169: .It client-attached
4170: Run when a client is attached.
4171: .It client-detached
4172: Run when a client is detached
4173: .It client-resized
4174: Run when a client is resized.
1.511 nicm 4175: .It client-session-changed
4176: Run when a client's attached session is changed.
1.475 nicm 4177: .It pane-died
4178: Run when the program running in a pane exits, but
4179: .Ic remain-on-exit
4180: is on so the pane has not closed.
4181: .It pane-exited
4182: Run when the program running in a pane exits.
1.603 nicm 4183: .It pane-focus-in
4184: Run when the focus enters a pane, if the
4185: .Ic focus-events
4186: option is on.
4187: .It pane-focus-out
4188: Run when the focus exits a pane, if the
4189: .Ic focus-events
4190: option is on.
1.560 nicm 4191: .It pane-set-clipboard
4192: Run when the terminal clipboard is set using the
4193: .Xr xterm 1
4194: escape sequence.
1.510 nicm 4195: .It session-created
4196: Run when a new session created.
4197: .It session-closed
4198: Run when a session closed.
1.507 nicm 4199: .It session-renamed
4200: Run when a session is renamed.
1.511 nicm 4201: .It window-linked
4202: Run when a window is linked into a session.
1.507 nicm 4203: .It window-renamed
4204: Run when a window is renamed.
1.511 nicm 4205: .It window-unlinked
4206: Run when a window is unlinked from a session.
1.469 nicm 4207: .El
4208: .Pp
4209: Hooks are managed with these commands:
4210: .Bl -tag -width Ds
4211: .It Xo Ic set-hook
1.740 nicm 4212: .Op Fl agpRuw
4213: .Op Fl t Ar target-pane
1.469 nicm 4214: .Ar hook-name
4215: .Ar command
4216: .Xc
1.604 nicm 4217: Without
1.605 jmc 4218: .Fl R ,
1.604 nicm 4219: sets (or with
1.496 nicm 4220: .Fl u
4221: unsets) hook
1.469 nicm 4222: .Ar hook-name
4223: to
4224: .Ar command .
1.740 nicm 4225: The flags are the same as for
4226: .Ic set-option .
1.604 nicm 4227: .Pp
4228: With
4229: .Fl R ,
4230: run
4231: .Ar hook-name
4232: immediately.
1.469 nicm 4233: .It Xo Ic show-hooks
1.740 nicm 4234: .Op Fl gpw
4235: .Op Fl t Ar target-pane
1.469 nicm 4236: .Xc
1.740 nicm 4237: Shows hooks.
4238: The flags are the same as for
4239: .Ic show-options .
1.470 jmc 4240: .El
1.419 nicm 4241: .Sh MOUSE SUPPORT
4242: If the
4243: .Ic mouse
4244: option is on (the default is off),
4245: .Nm
4246: allows mouse events to be bound as keys.
4247: The name of each key is made up of a mouse event (such as
4248: .Ql MouseUp1 )
1.632 nicm 4249: and a location suffix, one of the following:
4250: .Bl -column "XXXXXXXXXXXXX" -offset indent
4251: .It Li "Pane" Ta "the contents of a pane"
4252: .It Li "Border" Ta "a pane border"
4253: .It Li "Status" Ta "the status line window list"
4254: .It Li "StatusLeft" Ta "the left part of the status line"
4255: .It Li "StatusRight" Ta "the right part of the status line"
4256: .It Li "StatusDefault" Ta "any other part of the status line"
4257: .El
4258: .Pp
1.419 nicm 4259: The following mouse events are available:
4260: .Bl -column "MouseDown1" "MouseDrag1" "WheelDown" -offset indent
1.498 nicm 4261: .It Li "WheelUp" Ta "WheelDown" Ta ""
1.481 nicm 4262: .It Li "MouseDown1" Ta "MouseUp1" Ta "MouseDrag1" Ta "MouseDragEnd1"
4263: .It Li "MouseDown2" Ta "MouseUp2" Ta "MouseDrag2" Ta "MouseDragEnd2"
4264: .It Li "MouseDown3" Ta "MouseUp3" Ta "MouseDrag3" Ta "MouseDragEnd3"
1.724 nicm 4265: .It Li "SecondClick1" Ta "SecondClick2" Ta "SecondClick3"
1.590 nicm 4266: .It Li "DoubleClick1" Ta "DoubleClick2" Ta "DoubleClick3"
4267: .It Li "TripleClick1" Ta "TripleClick2" Ta "TripleClick3"
1.419 nicm 4268: .El
1.724 nicm 4269: .Pp
4270: The
4271: .Ql SecondClick
4272: events are fired for the second click of a double click, even if there may be a
4273: third click which will fire
4274: .Ql TripleClick
4275: instead of
4276: .Ql DoubleClick .
1.419 nicm 4277: .Pp
4278: Each should be suffixed with a location, for example
4279: .Ql MouseDown1Status .
4280: .Pp
1.423 nicm 4281: The special token
4282: .Ql {mouse}
4283: or
1.419 nicm 4284: .Ql =
4285: may be used as
4286: .Ar target-window
4287: or
4288: .Ar target-pane
4289: in commands bound to mouse key bindings.
4290: It resolves to the window or pane over which the mouse event took place
4291: (for example, the window in the status line over which button 1 was released for a
4292: .Ql MouseUp1Status
4293: binding, or the pane over which the wheel was scrolled for a
4294: .Ql WheelDownPane
4295: binding).
4296: .Pp
4297: The
4298: .Ic send-keys
4299: .Fl M
4300: flag may be used to forward a mouse event to a pane.
4301: .Pp
4302: The default key bindings allow the mouse to be used to select and resize panes,
4303: to copy text and to change window using the status line.
4304: These take effect if the
4305: .Ic mouse
4306: option is turned on.
1.245 nicm 4307: .Sh FORMATS
1.294 nicm 4308: Certain commands accept the
1.245 nicm 4309: .Fl F
4310: flag with a
4311: .Ar format
4312: argument.
4313: This is a string which controls the output format of the command.
1.678 nicm 4314: Format variables are enclosed in
1.245 nicm 4315: .Ql #{
4316: and
4317: .Ql } ,
4318: for example
1.359 nicm 4319: .Ql #{session_name} .
1.409 nicm 4320: The possible variables are listed in the table below, or the name of a
4321: .Nm
4322: option may be used for an option's value.
4323: Some variables have a shorter alias such as
1.598 nicm 4324: .Ql #S ;
1.376 nicm 4325: .Ql ##
4326: is replaced by a single
1.598 nicm 4327: .Ql # ,
4328: .Ql #,
4329: by a
4330: .Ql \&,
4331: and
4332: .Ql #}
4333: by a
4334: .Ql } .
1.409 nicm 4335: .Pp
4336: Conditionals are available by prefixing with
1.246 jmc 4337: .Ql \&?
1.245 nicm 4338: and separating two alternatives with a comma;
4339: if the specified variable exists and is not zero, the first alternative
1.246 jmc 4340: is chosen, otherwise the second is used.
4341: For example
1.245 nicm 4342: .Ql #{?session_attached,attached,not attached}
4343: will include the string
4344: .Ql attached
4345: if the session is attached and the string
4346: .Ql not attached
1.409 nicm 4347: if it is unattached, or
4348: .Ql #{?automatic-rename,yes,no}
4349: will include
4350: .Ql yes
4351: if
4352: .Ic automatic-rename
4353: is enabled, or
4354: .Ql no
4355: if not.
1.599 nicm 4356: Conditionals can be nested arbitrarily.
4357: Inside a conditional,
4358: .Ql \&,
4359: and
4360: .Ql }
4361: must be escaped as
4362: .Ql #,
4363: and
4364: .Ql #} ,
4365: unless they are part of a
4366: .Ql #{...}
1.600 nicm 4367: replacement.
4368: For example:
1.599 nicm 4369: .Bd -literal -offset indent
4370: #{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W .
4371: .Ed
1.520 nicm 4372: .Pp
1.678 nicm 4373: String comparisons may be expressed by prefixing two comma-separated
1.520 nicm 4374: alternatives by
1.652 nicm 4375: .Ql == ,
4376: .Ql != ,
4377: .Ql < ,
4378: .Ql > ,
4379: .Ql <=
1.520 nicm 4380: or
1.652 nicm 4381: .Ql >=
1.520 nicm 4382: and a colon.
4383: For example
1.544 nicm 4384: .Ql #{==:#{host},myhost}
1.520 nicm 4385: will be replaced by
4386: .Ql 1
4387: if running on
4388: .Ql myhost ,
4389: otherwise by
1.554 nicm 4390: .Ql 0 .
4391: .Ql ||
4392: and
4393: .Ql &&
4394: evaluate to true if either or both of two comma-separated alternatives are
4395: true, for example
1.595 nicm 4396: .Ql #{||:#{pane_in_mode},#{alternate_on}} .
1.664 nicm 4397: .Pp
4398: An
4399: .Ql m
4400: specifies an
4401: .Xr fnmatch 3
4402: or regular expression comparison.
4403: The first argument is the pattern and the second the string to compare.
1.714 nicm 4404: An optional argument specifies flags:
1.664 nicm 4405: .Ql r
4406: means the pattern is a regular expression instead of the default
4407: .Xr fnmatch 3
4408: pattern, and
4409: .Ql i
4410: means to ignore case.
4411: For example:
4412: .Ql #{m:*foo*,#{host}}
4413: or
4414: .Ql #{m/ri:^A,MYVAR} .
1.554 nicm 4415: A
4416: .Ql C
4417: performs a search for an
4418: .Xr fnmatch 3
1.664 nicm 4419: pattern or regular expression in the pane content and evaluates to zero if not
4420: found, or a line number if found.
4421: Like
4422: .Ql m ,
1.665 jmc 4423: an
1.664 nicm 4424: .Ql r
4425: flag means search for a regular expression and
4426: .Ql i
4427: ignores case.
4428: For example:
4429: .Ql #{C/r:^Start}
1.714 nicm 4430: .Pp
4431: Numeric operators may be performed by prefixing two comma-separated alternatives with an
4432: .Ql e
4433: and an operator.
4434: An optional
4435: .Ql f
4436: flag may be given after the operator to use floating point numbers, otherwise integers are used.
4437: This may be followed by a number giving the number of decimal places to use for the result.
4438: The available operators are:
4439: addition
4440: .Ql + ,
4441: subtraction
4442: .Ql - ,
4443: multiplication
4444: .Ql * ,
4445: division
4446: .Ql / ,
4447: and modulus
4448: .Ql m
4449: or
4450: .Ql %
4451: (note that
4452: .Ql %
4453: must be escaped as
4454: .Ql %%
4455: in formats which are also expanded by
4456: .Xr strftime 3 ) .
4457: For example,
4458: .Ql #{e|*|f|4:5.5,3}
4459: multiplies 5.5 by 3 for a result with four decimal places and
4460: .Ql #{e|%%:7,3}
4461: returns the modulus of 7 and 3.
1.453 nicm 4462: .Pp
1.367 nicm 4463: A limit may be placed on the length of the resultant string by prefixing it
4464: by an
4465: .Ql = ,
1.479 nicm 4466: a number and a colon.
4467: Positive numbers count from the start of the string and negative from the end,
4468: so
4469: .Ql #{=5:pane_title}
1.653 nicm 4470: will include at most the first five characters of the pane title, or
1.479 nicm 4471: .Ql #{=-5:pane_title}
1.653 nicm 4472: the last five characters.
4473: A suffix or prefix may be given as a second argument - if provided then it is
4474: appended or prepended to the string if the length has been trimmed, for example
4475: .Ql #{=/5/...:pane_title}
4476: will append
4477: .Ql ...
4478: if the pane title is more than five characters.
1.698 nicm 4479: Similarly,
4480: .Ql p
4481: pads the string to a given width, for example
4482: .Ql #{p10:pane_title}
4483: will result in a width of at least 10 characters.
4484: A positive width pads on the left, a negative on the right.
1.653 nicm 4485: .Pp
1.453 nicm 4486: Prefixing a time variable with
1.683 nicm 4487: .Ql t:\&
1.453 nicm 4488: will convert it to a string, so if
4489: .Ql #{window_activity}
4490: gives
1.454 jmc 4491: .Ql 1445765102 ,
1.453 nicm 4492: .Ql #{t:window_activity}
4493: gives
4494: .Ql Sun Oct 25 09:25:02 2015 .
1.751 nicm 4495: Adding
4496: .Ql p (
4497: .Ql `t/p` )
4498: will use shorter but less accurate time format for times in the past.
1.765 nicm 4499: A custom format may be given using an
4500: .Ql f
4501: suffix (note that
4502: .Ql %
4503: must be escaped as
4504: .Ql %%
4505: if the format is separately being passed through
4506: .Xr strftime 3 ,
4507: for example in the
4508: .Ic status-left
4509: option):
4510: .Ql #{t/f/%%H#:%%M:window_activity} ,
4511: see
4512: .Xr strftime 3 .
4513: .Pp
1.453 nicm 4514: The
1.683 nicm 4515: .Ql b:\&
1.453 nicm 4516: and
1.683 nicm 4517: .Ql d:\&
1.453 nicm 4518: prefixes are
4519: .Xr basename 3
4520: and
4521: .Xr dirname 3
4522: of the variable respectively.
1.683 nicm 4523: .Ql q:\&
1.610 nicm 4524: will escape
4525: .Xr sh 1
4526: special characters.
1.683 nicm 4527: .Ql E:\&
1.617 nicm 4528: will expand the format twice, for example
4529: .Ql #{E:status-left}
4530: is the result of expanding the content of the
4531: .Ic status-left
1.671 nicm 4532: option rather than the option itself.
1.683 nicm 4533: .Ql T:\&
1.620 nicm 4534: is like
1.683 nicm 4535: .Ql E:\&
1.620 nicm 4536: but also expands
4537: .Xr strftime 3
4538: specifiers.
1.683 nicm 4539: .Ql S:\& ,
4540: .Ql W:\&
1.618 nicm 4541: or
1.683 nicm 4542: .Ql P:\&
1.618 nicm 4543: will loop over each session, window or pane and insert the format once
1.619 nicm 4544: for each.
4545: For windows and panes, two comma-separated formats may be given:
4546: the second is used for the current window or active pane.
4547: For example, to get a list of windows formatted like the status line:
1.618 nicm 4548: .Bd -literal -offset indent
4549: #{W:#{E:window-status-format} ,#{E:window-status-current-format} }
4550: .Ed
1.625 nicm 4551: .Pp
1.461 nicm 4552: A prefix of the form
1.683 nicm 4553: .Ql s/foo/bar/:\&
1.461 nicm 4554: will substitute
4555: .Ql foo
4556: with
4557: .Ql bar
4558: throughout.
1.664 nicm 4559: The first argument may be an extended regular expression and a final argument may be
4560: .Ql i
4561: to ignore case, for example
1.683 nicm 4562: .Ql s/a(.)/\e1x/i:\&
1.664 nicm 4563: would change
4564: .Ql abABab
4565: into
4566: .Ql bxBxbx .
1.431 nicm 4567: .Pp
1.671 nicm 4568: In addition, the last line of a shell command's output may be inserted using
1.431 nicm 4569: .Ql #() .
4570: For example,
4571: .Ql #(uptime)
4572: will insert the system's uptime.
4573: When constructing formats,
4574: .Nm
4575: does not wait for
4576: .Ql #()
4577: commands to finish; instead, the previous result from running the same command is used,
4578: or a placeholder if the command has not been run before.
1.543 nicm 4579: If the command hasn't exited, the most recent line of output will be used, but the status
4580: line will not be updated more than once a second.
1.431 nicm 4581: Commands are executed with the
4582: .Nm
4583: global environment set (see the
1.644 schwarze 4584: .Sx GLOBAL AND SESSION ENVIRONMENT
1.431 nicm 4585: section).
1.671 nicm 4586: .Pp
4587: An
4588: .Ql l
4589: specifies that a string should be interpreted literally and not expanded.
4590: For example
4591: .Ql #{l:#{?pane_in_mode,yes,no}}
4592: will be replaced by
4593: .Ql #{?pane_in_mode,yes,no} .
1.245 nicm 4594: .Pp
4595: The following variables are available, where appropriate:
1.359 nicm 4596: .Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX"
4597: .It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with"
1.678 nicm 4598: .It Li "alternate_on" Ta "" Ta "1 if pane is in alternate screen"
1.359 nicm 4599: .It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen"
4600: .It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen"
1.572 nicm 4601: .It Li "buffer_created" Ta "" Ta "Time buffer created"
1.490 nicm 4602: .It Li "buffer_name" Ta "" Ta "Name of buffer"
1.386 nicm 4603: .It Li "buffer_sample" Ta "" Ta "Sample of start of buffer"
1.359 nicm 4604: .It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes"
1.572 nicm 4605: .It Li "client_activity" Ta "" Ta "Time client last had activity"
1.699 nicm 4606: .It Li "client_cell_height" Ta "" Ta "Height of each client cell in pixels"
4607: .It Li "client_cell_width" Ta "" Ta "Width of each client cell in pixels"
1.646 nicm 4608: .It Li "client_control_mode" Ta "" Ta "1 if client is in control mode"
1.572 nicm 4609: .It Li "client_created" Ta "" Ta "Time client created"
1.542 nicm 4610: .It Li "client_discarded" Ta "" Ta "Bytes discarded when client behind"
1.762 nicm 4611: .It Li "client_flags" Ta "" Ta "List of client flags"
1.359 nicm 4612: .It Li "client_height" Ta "" Ta "Height of client"
1.451 nicm 4613: .It Li "client_key_table" Ta "" Ta "Current key table"
1.359 nicm 4614: .It Li "client_last_session" Ta "" Ta "Name of the client's last session"
1.540 nicm 4615: .It Li "client_name" Ta "" Ta "Name of client"
1.437 nicm 4616: .It Li "client_pid" Ta "" Ta "PID of client process"
1.359 nicm 4617: .It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed"
4618: .It Li "client_readonly" Ta "" Ta "1 if client is readonly"
4619: .It Li "client_session" Ta "" Ta "Name of the client's session"
4620: .It Li "client_termname" Ta "" Ta "Terminal name of client"
1.754 nicm 4621: .It Li "client_termtype" Ta "" Ta "Terminal type of client, if available"
4622: .It Li "client_termfeatures" Ta "" Ta "Terminal features of client, if any"
1.359 nicm 4623: .It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
1.699 nicm 4624: .It Li "client_utf8" Ta "" Ta "1 if client supports UTF-8"
1.359 nicm 4625: .It Li "client_width" Ta "" Ta "Width of client"
1.541 nicm 4626: .It Li "client_written" Ta "" Ta "Bytes written to client"
1.509 nicm 4627: .It Li "command" Ta "" Ta "Name of command in use, if any"
1.646 nicm 4628: .It Li "command_list_alias" Ta "" Ta "Command alias if listing commands"
1.489 nicm 4629: .It Li "command_list_name" Ta "" Ta "Command name if listing commands"
4630: .It Li "command_list_usage" Ta "" Ta "Command usage if listing commands"
1.692 nicm 4631: .It Li "copy_cursor_line" Ta "" Ta "Line the cursor is on in copy mode"
4632: .It Li "copy_cursor_word" Ta "" Ta "Word under cursor in copy mode"
1.691 nicm 4633: .It Li "copy_cursor_x" Ta "" Ta "Cursor X position in copy mode"
4634: .It Li "copy_cursor_y" Ta "" Ta "Cursor Y position in copy mode"
1.646 nicm 4635: .It Li "cursor_character" Ta "" Ta "Character at cursor in pane"
1.359 nicm 4636: .It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
4637: .It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
4638: .It Li "cursor_y" Ta "" Ta "Cursor Y position in pane"
4639: .It Li "history_bytes" Ta "" Ta "Number of bytes in window history"
4640: .It Li "history_limit" Ta "" Ta "Maximum window history lines"
1.581 nicm 4641: .It Li "history_size" Ta "" Ta "Size of history in lines"
1.509 nicm 4642: .It Li "hook" Ta "" Ta "Name of running hook, if any"
1.511 nicm 4643: .It Li "hook_pane" Ta "" Ta "ID of pane where hook was run, if any"
1.510 nicm 4644: .It Li "hook_session" Ta "" Ta "ID of session where hook was run, if any"
4645: .It Li "hook_session_name" Ta "" Ta "Name of session where hook was run, if any"
4646: .It Li "hook_window" Ta "" Ta "ID of window where hook was run, if any"
4647: .It Li "hook_window_name" Ta "" Ta "Name of window where hook was run, if any"
1.359 nicm 4648: .It Li "host" Ta "#H" Ta "Hostname of local host"
4649: .It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)"
4650: .It Li "insert_flag" Ta "" Ta "Pane insert flag"
4651: .It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag"
4652: .It Li "keypad_flag" Ta "" Ta "Pane keypad flag"
4653: .It Li "line" Ta "" Ta "Line number in the list"
1.646 nicm 4654: .It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag"
1.359 nicm 4655: .It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag"
4656: .It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag"
1.676 nicm 4657: .It Li "mouse_line" Ta "" Ta "Line under mouse, if any"
4658: .It Li "mouse_sgr_flag" Ta "" Ta "Pane mouse SGR flag"
1.359 nicm 4659: .It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag"
1.676 nicm 4660: .It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag"
4661: .It Li "mouse_word" Ta "" Ta "Word under mouse, if any"
1.654 nicm 4662: .It Li "mouse_x" Ta "" Ta "Mouse X position, if any"
4663: .It Li "mouse_y" Ta "" Ta "Mouse Y position, if any"
1.676 nicm 4664: .It Li "origin_flag" Ta "" Ta "Pane origin flag"
1.359 nicm 4665: .It Li "pane_active" Ta "" Ta "1 if active pane"
1.570 nicm 4666: .It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window"
4667: .It Li "pane_at_left" Ta "" Ta "1 if pane is at the left of window"
4668: .It Li "pane_at_right" Ta "" Ta "1 if pane is at the right of window"
4669: .It Li "pane_at_top" Ta "" Ta "1 if pane is at the top of window"
1.396 nicm 4670: .It Li "pane_bottom" Ta "" Ta "Bottom of pane"
1.359 nicm 4671: .It Li "pane_current_command" Ta "" Ta "Current command if available"
1.733 nicm 4672: .It Li "pane_current_path" Ta "" Ta "Current path if available"
1.359 nicm 4673: .It Li "pane_dead" Ta "" Ta "1 if pane is dead"
1.411 nicm 4674: .It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane"
1.696 nicm 4675: .It Li "pane_format" Ta "" Ta "1 if format is for a pane"
1.359 nicm 4676: .It Li "pane_height" Ta "" Ta "Height of pane"
4677: .It Li "pane_id" Ta "#D" Ta "Unique pane ID"
1.678 nicm 4678: .It Li "pane_in_mode" Ta "" Ta "1 if pane is in a mode"
1.646 nicm 4679: .It Li "pane_index" Ta "#P" Ta "Index of pane"
1.678 nicm 4680: .It Li "pane_input_off" Ta "" Ta "1 if input to pane is disabled"
1.396 nicm 4681: .It Li "pane_left" Ta "" Ta "Left of pane"
1.650 nicm 4682: .It Li "pane_marked" Ta "" Ta "1 if this is the marked pane"
4683: .It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set"
1.678 nicm 4684: .It Li "pane_mode" Ta "" Ta "Name of pane mode, if any"
1.761 nicm 4685: .It Li "pane_path" Ta "" Ta "Path of pane (can be set by application)"
1.359 nicm 4686: .It Li "pane_pid" Ta "" Ta "PID of first process in pane"
1.567 nicm 4687: .It Li "pane_pipe" Ta "" Ta "1 if pane is being piped"
1.396 nicm 4688: .It Li "pane_right" Ta "" Ta "Right of pane"
1.546 nicm 4689: .It Li "pane_search_string" Ta "" Ta "Last search string in copy mode"
1.743 nicm 4690: .It Li "pane_skipped" Ta "" Ta "Bytes skipped as not visible in pane"
1.359 nicm 4691: .It Li "pane_start_command" Ta "" Ta "Command pane started with"
1.678 nicm 4692: .It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized"
1.359 nicm 4693: .It Li "pane_tabs" Ta "" Ta "Pane tab positions"
1.696 nicm 4694: .It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
1.396 nicm 4695: .It Li "pane_top" Ta "" Ta "Top of pane"
1.359 nicm 4696: .It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
4697: .It Li "pane_width" Ta "" Ta "Width of pane"
1.743 nicm 4698: .It Li "pane_written" Ta "" Ta "Bytes written by pane (aside from redrawing)"
1.721 nicm 4699: .It Li "pid" Ta "" Ta "Server PID"
4700: .It Li "popup_key" Ta "" Ta "Key pressed in popup"
4701: .It Li "popup_mouse_x" Ta "" Ta "Mouse X position in popup"
4702: .It Li "popup_mouse_y" Ta "" Ta "Mouse Y position in popup"
1.606 nicm 4703: .It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated"
1.646 nicm 4704: .It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
1.359 nicm 4705: .It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
4706: .It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
1.713 nicm 4707: .It Li "selection_active" Ta "" Ta "1 if selection started and changes with the cursor in copy mode"
1.691 nicm 4708: .It Li "selection_end_x" Ta "" Ta "X position of the end of the selection"
4709: .It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection"
1.571 nicm 4710: .It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
1.691 nicm 4711: .It Li "selection_start_x" Ta "" Ta "X position of the start of the selection"
4712: .It Li "selection_start_y" Ta "" Ta "Y position of the start of the selection"
1.646 nicm 4713: .It Li "session_activity" Ta "" Ta "Time of session last activity"
1.430 nicm 4714: .It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
1.382 nicm 4715: .It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
1.702 nicm 4716: .It Li "session_attached_list" Ta "" Ta "List of clients session is attached to"
1.572 nicm 4717: .It Li "session_created" Ta "" Ta "Time session created"
1.696 nicm 4718: .It Li "session_format" Ta "" Ta "1 if format is for a session"
1.536 nicm 4719: .It Li "session_group" Ta "" Ta "Name of session group"
1.702 nicm 4720: .It Li "session_group_attached" Ta "" Ta "Number of clients sessions in group are attached to"
4721: .It Li "session_group_attached_list" Ta "" Ta "List of clients sessions in group are attached to"
1.646 nicm 4722: .It Li "session_group_list" Ta "" Ta "List of sessions in group"
1.702 nicm 4723: .It Li "session_group_many_attached" Ta "" Ta "1 if multiple clients attached to sessions in group"
1.586 nicm 4724: .It Li "session_group_size" Ta "" Ta "Size of session group"
1.359 nicm 4725: .It Li "session_grouped" Ta "" Ta "1 if session in a group"
4726: .It Li "session_id" Ta "" Ta "Unique session ID"
1.646 nicm 4727: .It Li "session_last_attached" Ta "" Ta "Time session last attached"
1.382 nicm 4728: .It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached"
1.748 nicm 4729: .It Li "session_marked" Ta "" Ta "1 if this session contains the marked pane"
1.359 nicm 4730: .It Li "session_name" Ta "#S" Ta "Name of session"
1.725 nicm 4731: .It Li "session_path" Ta "" Ta "Working directory of session"
1.548 nicm 4732: .It Li "session_stack" Ta "" Ta "Window indexes in most recent order"
1.359 nicm 4733: .It Li "session_windows" Ta "" Ta "Number of windows in session"
1.487 nicm 4734: .It Li "socket_path" Ta "" Ta "Server socket path"
1.465 nicm 4735: .It Li "start_time" Ta "" Ta "Server start time"
1.708 nicm 4736: .It Li "version" Ta "" Ta "Server version"
1.646 nicm 4737: .It Li "window_active" Ta "" Ta "1 if window active"
1.702 nicm 4738: .It Li "window_active_clients" Ta "" Ta "Number of clients viewing this window"
4739: .It Li "window_active_clients_list" Ta "" Ta "List of clients viewing this window"
4740: .It Li "window_active_sessions" Ta "" Ta "Number of sessions on which this window is active"
4741: .It Li "window_active_sessions_list" Ta "" Ta "List of sessions on which this window is active"
1.572 nicm 4742: .It Li "window_activity" Ta "" Ta "Time of window last activity"
1.487 nicm 4743: .It Li "window_activity_flag" Ta "" Ta "1 if window has activity"
1.366 nicm 4744: .It Li "window_bell_flag" Ta "" Ta "1 if window has bell"
1.642 nicm 4745: .It Li "window_bigger" Ta "" Ta "1 if window is larger than client"
1.700 nicm 4746: .It Li "window_cell_height" Ta "" Ta "Height of each cell in pixels"
4747: .It Li "window_cell_width" Ta "" Ta "Width of each cell in pixels"
1.621 nicm 4748: .It Li "window_end_flag" Ta "" Ta "1 if window has the highest index"
1.359 nicm 4749: .It Li "window_flags" Ta "#F" Ta "Window flags"
1.696 nicm 4750: .It Li "window_format" Ta "" Ta "1 if format is for a window"
1.359 nicm 4751: .It Li "window_height" Ta "" Ta "Height of window"
4752: .It Li "window_id" Ta "" Ta "Unique window ID"
4753: .It Li "window_index" Ta "#I" Ta "Index of window"
1.400 nicm 4754: .It Li "window_last_flag" Ta "" Ta "1 if window is the last used"
1.460 nicm 4755: .It Li "window_layout" Ta "" Ta "Window layout description, ignoring zoomed window panes"
1.426 nicm 4756: .It Li "window_linked" Ta "" Ta "1 if window is linked across sessions"
1.702 nicm 4757: .It Li "window_linked_sessions" Ta "" Ta "Number of sessions this window is linked to"
4758: .It Li "window_linked_sessions_list" Ta "" Ta "List of sessions this window is linked to"
1.687 nicm 4759: .It Li "window_marked_flag" Ta "" Ta "1 if window contains the marked pane"
1.359 nicm 4760: .It Li "window_name" Ta "#W" Ta "Name of window"
1.642 nicm 4761: .It Li "window_offset_x" Ta "" Ta "X offset into window if larger than client"
4762: .It Li "window_offset_y" Ta "" Ta "Y offset into window if larger than client"
1.359 nicm 4763: .It Li "window_panes" Ta "" Ta "Number of panes in window"
1.366 nicm 4764: .It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert"
1.548 nicm 4765: .It Li "window_stack_index" Ta "" Ta "Index in session most recent stack"
1.621 nicm 4766: .It Li "window_start_flag" Ta "" Ta "1 if window has the lowest index"
1.460 nicm 4767: .It Li "window_visible_layout" Ta "" Ta "Window layout description, respecting zoomed window panes"
1.359 nicm 4768: .It Li "window_width" Ta "" Ta "Width of window"
1.400 nicm 4769: .It Li "window_zoomed_flag" Ta "" Ta "1 if window is zoomed"
1.359 nicm 4770: .It Li "wrap_flag" Ta "" Ta "Pane wrap flag"
1.245 nicm 4771: .El
1.623 nicm 4772: .Sh STYLES
4773: .Nm
4774: offers various options to specify the colour and attributes of aspects of the
4775: interface, for example
4776: .Ic status-style
4777: for the status line.
4778: In addition, embedded styles may be specified in format options, such as
1.701 nicm 4779: .Ic status-left ,
1.623 nicm 4780: by enclosing them in
4781: .Ql #[
4782: and
1.639 nicm 4783: .Ql \&] .
1.623 nicm 4784: .Pp
4785: A style may be the single term
4786: .Ql default
1.688 nicm 4787: to specify the default style (which may come from an option, for example
4788: .Ic status-style
4789: in the status line) or a space
1.630 nicm 4790: or comma separated list of the following:
1.623 nicm 4791: .Bl -tag -width Ds
4792: .It Ic fg=colour
4793: Set the foreground colour.
4794: The colour is one of:
4795: .Ic black ,
4796: .Ic red ,
4797: .Ic green ,
4798: .Ic yellow ,
4799: .Ic blue ,
4800: .Ic magenta ,
4801: .Ic cyan ,
4802: .Ic white ;
4803: if supported the bright variants
4804: .Ic brightred ,
4805: .Ic brightgreen ,
4806: .Ic brightyellow ;
4807: .Ic colour0
4808: to
4809: .Ic colour255
4810: from the 256-colour set;
4811: .Ic default
4812: for the default colour;
4813: .Ic terminal
4814: for the terminal default colour; or a hexadecimal RGB string such as
4815: .Ql #ffffff .
4816: .It Ic bg=colour
4817: Set the background colour.
4818: .It Ic none
4819: Set no attributes (turn off any active attributes).
1.752 nicm 4820: .It Xo Ic acs ,
4821: .Ic bright
1.625 nicm 4822: (or
4823: .Ic bold ) ,
1.623 nicm 4824: .Ic dim ,
4825: .Ic underscore ,
4826: .Ic blink ,
4827: .Ic reverse ,
4828: .Ic hidden ,
4829: .Ic italics ,
1.649 nicm 4830: .Ic overline ,
1.623 nicm 4831: .Ic strikethrough ,
4832: .Ic double-underscore ,
4833: .Ic curly-underscore ,
4834: .Ic dotted-underscore ,
4835: .Ic dashed-underscore
4836: .Xc
4837: Set an attribute.
4838: Any of the attributes may be prefixed with
4839: .Ql no
4840: to unset.
1.752 nicm 4841: .Ic acs
4842: is the terminal alternate character set.
1.625 nicm 4843: .It Xo Ic align=left
4844: (or
4845: .Ic noalign ) ,
4846: .Ic align=centre ,
4847: .Ic align=right
4848: .Xc
4849: Align text to the left, centre or right of the available space if appropriate.
1.675 nicm 4850: .It Ic fill=colour
1.674 nicm 4851: Fill the available space with a background colour if appropriate.
1.625 nicm 4852: .It Xo Ic list=on ,
4853: .Ic list=focus ,
4854: .Ic list=left-marker ,
1.661 nicm 4855: .Ic list=right-marker ,
1.625 nicm 4856: .Ic nolist
4857: .Xc
4858: Mark the position of the various window list components in the
4859: .Ic status-format
4860: option:
4861: .Ic list=on
4862: marks the start of the list;
4863: .Ic list=focus
4864: is the part of the list that should be kept in focus if the entire list won't fit
4865: in the available space (typically the current window);
4866: .Ic list=left-marker
4867: and
4868: .Ic list=right-marker
4869: mark the text to be used to mark that text has been trimmed from the left or
4870: right of the list if there is not enough space.
1.688 nicm 4871: .It Xo Ic push-default ,
4872: .Ic pop-default
4873: .Xc
4874: Store the current colours and attributes as the default or reset to the previous
4875: default.
4876: A
4877: .Ic push-default
4878: affects any subsequent use of the
4879: .Ic default
4880: term until a
4881: .Ic pop-default .
4882: Only one default may be pushed (each
4883: .Ic push-default
4884: replaces the previous saved default).
1.625 nicm 4885: .It Xo Ic range=left ,
4886: .Ic range=right ,
4887: .Ic range=window|X ,
4888: .Ic norange
4889: .Xc
4890: Mark a range in the
1.651 nicm 4891: .Ic status-format
1.625 nicm 4892: option.
4893: .Ic range=left
4894: and
4895: .Ic range=right
4896: are the text used for the
4897: .Ql StatusLeft
4898: and
4899: .Ql StatusRight
4900: mouse keys.
4901: .Ic range=window|X
4902: is the range for a window passed to the
4903: .Ql Status
4904: mouse key, where
4905: .Ql X
4906: is a window index.
1.623 nicm 4907: .El
4908: .Pp
4909: Examples are:
4910: .Bd -literal -offset indent
1.630 nicm 4911: fg=yellow bold underscore blink
1.623 nicm 4912: bg=black,fg=default,noreverse
4913: .Ed
1.261 nicm 4914: .Sh NAMES AND TITLES
4915: .Nm
4916: distinguishes between names and titles.
4917: Windows and sessions have names, which may be used to specify them in targets
4918: and are displayed in the status line and various lists: the name is the
4919: .Nm
4920: identifier for a window or session.
4921: Only panes have titles.
1.577 nicm 4922: A pane's title is typically set by the program running inside the pane using
4923: an escape sequence (like it would set the
1.261 nicm 4924: .Xr xterm 1
1.577 nicm 4925: window title in
1.578 nicm 4926: .Xr X 7 ) .
1.268 nicm 4927: Windows themselves do not have titles - a window's title is the title of its
1.261 nicm 4928: active pane.
4929: .Nm
4930: itself may set the title of the terminal in which the client is running, see
4931: the
4932: .Ic set-titles
4933: option.
4934: .Pp
4935: A session's name is set with the
4936: .Ic new-session
4937: and
4938: .Ic rename-session
4939: commands.
4940: A window's name is set with one of:
4941: .Bl -enum -width Ds
4942: .It
4943: A command argument (such as
4944: .Fl n
4945: for
4946: .Ic new-window
4947: or
4948: .Ic new-session ) .
4949: .It
1.597 nicm 4950: An escape sequence (if the
4951: .Ic allow-rename
4952: option is turned on):
1.261 nicm 4953: .Bd -literal -offset indent
4954: $ printf '\e033kWINDOW_NAME\e033\e\e'
4955: .Ed
4956: .It
4957: Automatic renaming, which sets the name to the active command in the window's
4958: active pane.
4959: See the
4960: .Ic automatic-rename
4961: option.
4962: .El
4963: .Pp
4964: When a pane is first created, its title is the hostname.
1.612 nicm 4965: A pane's title can be set via the title setting escape sequence, for example:
1.261 nicm 4966: .Bd -literal -offset indent
4967: $ printf '\e033]2;My Title\e033\e\e'
4968: .Ed
1.577 nicm 4969: .Pp
4970: It can also be modified with the
4971: .Ic select-pane
4972: .Fl T
4973: command.
1.644 schwarze 4974: .Sh GLOBAL AND SESSION ENVIRONMENT
1.63 nicm 4975: When the server is started,
4976: .Nm
4977: copies the environment into the
4978: .Em global environment ;
4979: in addition, each session has a
4980: .Em session environment .
1.193 nicm 4981: When a window is created, the session and global environments are merged.
4982: If a variable exists in both, the value from the session environment is used.
4983: The result is the initial environment passed to the new process.
1.63 nicm 4984: .Pp
4985: The
4986: .Ic update-environment
4987: session option may be used to update the session environment from the client
4988: when a new session is created or an old reattached.
4989: .Nm
4990: also initialises the
4991: .Ev TMUX
4992: variable with some internal information to allow commands to be executed
4993: from inside, and the
4994: .Ev TERM
4995: variable with the correct terminal setting of
4996: .Ql screen .
4997: .Pp
1.728 nicm 4998: Variables in both session and global environments may be marked as hidden.
4999: Hidden variables are not passed into the environment of new processes and
5000: instead can only be used by tmux itself (for example in formats, see the
5001: .Sx FORMATS
5002: section).
5003: .Pp
1.63 nicm 5004: Commands to alter and view the environment are:
5005: .Bl -tag -width Ds
5006: .It Xo Ic set-environment
1.728 nicm 5007: .Op Fl hgru
1.63 nicm 5008: .Op Fl t Ar target-session
5009: .Ar name Op Ar value
5010: .Xc
1.115 nicm 5011: .D1 (alias: Ic setenv )
1.63 nicm 5012: Set or unset an environment variable.
5013: If
5014: .Fl g
5015: is used, the change is made in the global environment; otherwise, it is applied
5016: to the session environment for
5017: .Ar target-session .
5018: The
5019: .Fl u
5020: flag unsets a variable.
5021: .Fl r
5022: indicates the variable is to be removed from the environment before starting a
5023: new process.
1.728 nicm 5024: .Fl h
5025: marks the variable as hidden.
1.63 nicm 5026: .It Xo Ic show-environment
1.728 nicm 5027: .Op Fl hgs
1.63 nicm 5028: .Op Fl t Ar target-session
1.286 nicm 5029: .Op Ar variable
1.63 nicm 5030: .Xc
1.115 nicm 5031: .D1 (alias: Ic showenv )
1.63 nicm 5032: Display the environment for
5033: .Ar target-session
5034: or the global environment with
5035: .Fl g .
1.286 nicm 5036: If
5037: .Ar variable
5038: is omitted, all variables are shown.
1.63 nicm 5039: Variables removed from the environment are prefixed with
5040: .Ql - .
1.442 nicm 5041: If
5042: .Fl s
5043: is used, the output is formatted as a set of Bourne shell commands.
1.728 nicm 5044: .Fl h
5045: shows hidden variables (omitted by default).
1.57 jmc 5046: .El
5047: .Sh STATUS LINE
5048: .Nm
5049: includes an optional status line which is displayed in the bottom line of each
5050: terminal.
1.626 nicm 5051: .Pp
5052: By default, the status line is enabled and one line in height (it may be
5053: disabled or made multiple lines with the
1.57 jmc 5054: .Ic status
5055: session option) and contains, from left-to-right: the name of the current
1.261 nicm 5056: session in square brackets; the window list; the title of the active pane
5057: in double quotes; and the time and date.
1.57 jmc 5058: .Pp
1.626 nicm 5059: Each line of the status line is configured with the
5060: .Ic status-format
5061: option.
5062: The default is made of three parts: configurable left and right sections (which
5063: may contain dynamic content such as the time or output from a shell command,
5064: see the
1.57 jmc 5065: .Ic status-left ,
5066: .Ic status-left-length ,
5067: .Ic status-right ,
5068: and
5069: .Ic status-right-length
5070: options below), and a central window list.
1.125 nicm 5071: By default, the window list shows the index, name and (if any) flag of the
5072: windows present in the current session in ascending numerical order.
5073: It may be customised with the
5074: .Ar window-status-format
5075: and
5076: .Ar window-status-current-format
5077: options.
1.57 jmc 5078: The flag is one of the following symbols appended to the window name:
5079: .Bl -column "Symbol" "Meaning" -offset indent
5080: .It Sy "Symbol" Ta Sy "Meaning"
5081: .It Li "*" Ta "Denotes the current window."
5082: .It Li "-" Ta "Marks the last window (previously selected)."
1.574 nicm 5083: .It Li "#" Ta "Window activity is monitored and activity has been detected."
5084: .It Li "\&!" Ta "Window bells are monitored and a bell has occurred in the window."
1.192 nicm 5085: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.432 nicm 5086: .It Li "M" Ta "The window contains the marked pane."
1.349 nicm 5087: .It Li "Z" Ta "The window's active pane is zoomed."
1.57 jmc 5088: .El
5089: .Pp
5090: The # symbol relates to the
5091: .Ic monitor-activity
1.388 nicm 5092: window option.
1.57 jmc 5093: The window name is printed in inverted colours if an alert (bell, activity or
1.388 nicm 5094: silence) is present.
1.57 jmc 5095: .Pp
1.131 nicm 5096: The colour and attributes of the status line may be configured, the entire
5097: status line using the
1.378 nicm 5098: .Ic status-style
5099: session option and individual windows using the
5100: .Ic window-status-style
5101: window option.
1.57 jmc 5102: .Pp
1.131 nicm 5103: The status line is automatically refreshed at interval if it has changed, the
5104: interval may be controlled with the
1.57 jmc 5105: .Ic status-interval
5106: session option.
5107: .Pp
5108: Commands related to the status line are as follows:
5109: .Bl -tag -width Ds
5110: .It Xo Ic command-prompt
1.758 nicm 5111: .Op Fl 1ikNTW
1.235 nicm 5112: .Op Fl I Ar inputs
1.73 nicm 5113: .Op Fl p Ar prompts
1.57 jmc 5114: .Op Fl t Ar target-client
5115: .Op Ar template
5116: .Xc
5117: Open the command prompt in a client.
5118: This may be used from inside
5119: .Nm
5120: to execute commands interactively.
1.231 nicm 5121: .Pp
1.57 jmc 5122: If
5123: .Ar template
1.73 nicm 5124: is specified, it is used as the command.
1.235 nicm 5125: If present,
5126: .Fl I
5127: is a comma-separated list of the initial text for each prompt.
1.73 nicm 5128: If
5129: .Fl p
5130: is given,
5131: .Ar prompts
5132: is a comma-separated list of prompts which are displayed in order; otherwise
5133: a single prompt is displayed, constructed from
5134: .Ar template
5135: if it is present, or
5136: .Ql \&:
5137: if not.
1.231 nicm 5138: .Pp
1.73 nicm 5139: Before the command is executed, the first occurrence of the string
5140: .Ql %%
1.74 jmc 5141: and all occurrences of
1.73 nicm 5142: .Ql %1
1.492 nicm 5143: are replaced by the response to the first prompt, all
1.73 nicm 5144: .Ql %2
5145: are replaced with the response to the second prompt, and so on for further
1.74 jmc 5146: prompts.
5147: Up to nine prompt responses may be replaced
5148: .Po
5149: .Ql %1
1.73 nicm 5150: to
1.74 jmc 5151: .Ql %9
5152: .Pc .
1.513 nicm 5153: .Ql %%%
5154: is like
5155: .Ql %%
5156: but any quotation marks are escaped.
1.497 nicm 5157: .Pp
5158: .Fl 1
5159: makes the prompt only accept one key press, in this case the resulting input
5160: is a single character.
1.706 nicm 5161: .Fl k
5162: is like
5163: .Fl 1
5164: but the key press is translated to a key name.
1.678 nicm 5165: .Fl N
5166: makes the prompt only accept numeric key presses.
1.517 nicm 5167: .Fl i
5168: executes the command every time the prompt input changes instead of when the
5169: user exits the command prompt.
1.758 nicm 5170: .Fl T
5171: tells
5172: .Nm
5173: that the prompt is for a target which affects what completions are offered when
5174: .Em Tab
5175: is pressed;
5176: .Fl W
5177: is similar but indicates the prompt is for a window.
1.500 nicm 5178: .Pp
5179: The following keys have a special meaning in the command prompt, depending
5180: on the value of the
5181: .Ic status-keys
5182: option:
5183: .Bl -column "FunctionXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXX" "emacsX" -offset indent
5184: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.715 nicm 5185: .It Li "Cancel command prompt" Ta "q" Ta "Escape"
1.678 nicm 5186: .It Li "Delete from cursor to start of word" Ta "" Ta "C-w"
1.500 nicm 5187: .It Li "Delete entire command" Ta "d" Ta "C-u"
5188: .It Li "Delete from cursor to end" Ta "D" Ta "C-k"
5189: .It Li "Execute command" Ta "Enter" Ta "Enter"
5190: .It Li "Get next command from history" Ta "" Ta "Down"
5191: .It Li "Get previous command from history" Ta "" Ta "Up"
5192: .It Li "Insert top paste buffer" Ta "p" Ta "C-y"
5193: .It Li "Look for completions" Ta "Tab" Ta "Tab"
5194: .It Li "Move cursor left" Ta "h" Ta "Left"
5195: .It Li "Move cursor right" Ta "l" Ta "Right"
5196: .It Li "Move cursor to end" Ta "$" Ta "C-e"
5197: .It Li "Move cursor to next word" Ta "w" Ta "M-f"
5198: .It Li "Move cursor to previous word" Ta "b" Ta "M-b"
5199: .It Li "Move cursor to start" Ta "0" Ta "C-a"
5200: .It Li "Transpose characters" Ta "" Ta "C-t"
5201: .El
1.57 jmc 5202: .It Xo Ic confirm-before
1.238 nicm 5203: .Op Fl p Ar prompt
1.57 jmc 5204: .Op Fl t Ar target-client
5205: .Ar command
5206: .Xc
5207: .D1 (alias: Ic confirm )
5208: Ask for confirmation before executing
5209: .Ar command .
1.238 nicm 5210: If
5211: .Fl p
5212: is given,
5213: .Ar prompt
5214: is the prompt to display; otherwise a prompt is constructed from
5215: .Ar command .
5216: It may contain the special character sequences supported by the
5217: .Ic status-left
5218: option.
5219: .Pp
1.57 jmc 5220: This command works only from inside
5221: .Nm .
1.646 nicm 5222: .It Xo Ic display-menu
5223: .Op Fl c Ar target-client
5224: .Op Fl t Ar target-pane
5225: .Op Fl T Ar title
5226: .Op Fl x Ar position
5227: .Op Fl y Ar position
1.657 nicm 5228: .Ar name
5229: .Ar key
5230: .Ar command
5231: .Ar ...
1.646 nicm 5232: .Xc
1.651 nicm 5233: .D1 (alias: Ic menu )
1.646 nicm 5234: Display a menu on
5235: .Ar target-client .
5236: .Ar target-pane
5237: gives the target for any commands run from the menu.
5238: .Pp
1.657 nicm 5239: A menu is passed as a series of arguments: first the menu item name,
5240: second the key shortcut (or empty for none) and third the command
5241: to run when the menu item is chosen.
5242: The name and command are formats, see the
1.646 nicm 5243: .Sx FORMATS
5244: and
5245: .Sx STYLES
5246: sections.
1.658 nicm 5247: If the name begins with a hyphen (-), then the item is disabled (shown dim) and
5248: may not be chosen.
1.657 nicm 5249: The name may be empty for a separator line, in which case both the key and
5250: command should be omitted.
1.646 nicm 5251: .Pp
5252: .Fl T
5253: is a format for the menu title (see
5254: .Sx FORMATS ) .
5255: .Pp
5256: .Fl x
5257: and
5258: .Fl y
5259: give the position of the menu.
5260: Both may be a row or column number, or one of the following special values:
5261: .Bl -column "XXXXX" "XXXX" -offset indent
5262: .It Sy "Value" Ta Sy "Flag" Ta Sy "Meaning"
1.719 nicm 5263: .It Li "C" Ta "Both" Ta "The centre of the terminal"
1.646 nicm 5264: .It Li "R" Ta Fl x Ta "The right side of the terminal"
5265: .It Li "P" Ta "Both" Ta "The bottom left of the pane"
5266: .It Li "M" Ta "Both" Ta "The mouse position"
1.730 nicm 5267: .It Li "W" Ta "Both" Ta "The window position on the status line"
1.646 nicm 5268: .It Li "S" Ta Fl y Ta "The line above or below the status line"
5269: .El
5270: .Pp
5271: Each menu consists of items followed by a key shortcut shown in brackets.
5272: If the menu is too large to fit on the terminal, it is not displayed.
5273: Pressing the key shortcut chooses the corresponding item.
5274: If the mouse is enabled and the menu is opened from a mouse key binding, releasing
5275: the mouse button with an item selected will choose that item.
5276: The following keys are also available:
5277: .Bl -column "Key" "Function" -offset indent
5278: .It Sy "Key" Ta Sy "Function"
5279: .It Li "Enter" Ta "Choose selected item"
5280: .It Li "Up" Ta "Select previous item"
5281: .It Li "Down" Ta "Select next item"
5282: .It Li "q" Ta "Exit menu"
5283: .El
1.57 jmc 5284: .It Xo Ic display-message
1.643 nicm 5285: .Op Fl aIpv
1.215 nicm 5286: .Op Fl c Ar target-client
5287: .Op Fl t Ar target-pane
1.57 jmc 5288: .Op Ar message
5289: .Xc
5290: .D1 (alias: Ic display )
1.127 nicm 5291: Display a message.
5292: If
5293: .Fl p
5294: is given, the output is printed to stdout, otherwise it is displayed in the
5295: .Ar target-client
5296: status line.
1.122 nicm 5297: The format of
1.124 jmc 5298: .Ar message
1.275 nicm 5299: is described in the
5300: .Sx FORMATS
5301: section; information is taken from
1.215 nicm 5302: .Ar target-pane
5303: if
5304: .Fl t
1.678 nicm 5305: is given, otherwise the active pane.
1.622 nicm 5306: .Pp
1.624 nicm 5307: .Fl v
5308: prints verbose logging as the format is parsed and
5309: .Fl a
5310: lists the format variables and their values.
1.643 nicm 5311: .Pp
5312: .Fl I
5313: forwards any input read from stdin to the empty pane given by
5314: .Ar target-pane .
1.721 nicm 5315: .It Xo Ic display-popup
5316: .Op Fl CEK
5317: .Op Fl c Ar target-client
5318: .Op Fl d Ar start-directory
5319: .Op Fl h Ar height
5320: .Op Fl R Ar shell-command
5321: .Op Fl t Ar target-pane
5322: .Op Fl w Ar width
5323: .Op Fl x Ar position
5324: .Op Fl y Ar position
5325: .Op Ar command Ar line Ar ...
5326: .Xc
5327: .D1 (alias: Ic popup )
5328: Display a popup on
5329: .Ar target-client .
5330: A popup is a rectangular box drawn over the top of any panes.
5331: Panes are not updated while a popup is present.
5332: The popup content may be given in two ways:
5333: .Bl -enum -offset Ds
5334: .It
5335: A set of lines as arguments.
5336: Each line is a format which is expanded using
5337: .Ar target-pane
5338: as the target.
5339: If a line contains newlines it is split into multiple lines.
5340: Lines may use styles, see the
5341: .Sx STYLES
5342: section.
5343: .It
5344: A shell command given by
5345: .Fl R
5346: which is run and any output shown in the pane.
5347: .El
5348: .Pp
5349: The first argument,
5350: .Ar command ,
5351: is a
5352: .Nm
5353: command which is run when a key is pressed.
5354: The key is available in the
5355: .Ql popup_key
5356: format.
5357: After
5358: .Ar command
5359: is run, the popup is closed.
5360: It may be empty to discard any key presses.
5361: If
5362: .Fl K
5363: is given together with
1.722 nicm 5364: .Fl R ,
1.721 nicm 5365: key presses are instead passed to the
5366: .Fl R
5367: shell command.
5368: .Fl E
5369: closes the popup automatically when
5370: .Ar shell-command
5371: exits.
1.723 nicm 5372: Two
5373: .Fl E
5374: closes the popup only if
5375: .Ar shell-command
5376: exited with success.
1.721 nicm 5377: With
5378: .Fl K ,
5379: .Ql Escape
5380: and
5381: .Ql C-c
5382: close the popup unless
5383: .Fl E
5384: is also given.
5385: .Pp
5386: .Fl x
5387: and
5388: .Fl y
5389: give the position of the popup, they have the same meaning as for the
5390: .Ic display-menu
5391: command.
5392: .Fl w
5393: and
5394: .Fl h
5395: give the width and height - both may be a percentage (followed by
5396: .Ql % ) .
5397: If omitted, without
5398: .Fl R
5399: they are calculated from the given lines and with
5400: .Fl R
5401: they use half the terminal size.
5402: .Pp
5403: The
5404: .Fl C
5405: flag closes any popup on the client.
1.57 jmc 5406: .El
5407: .Sh BUFFERS
5408: .Nm
1.392 nicm 5409: maintains a set of named
1.199 nicm 5410: .Em paste buffers .
1.392 nicm 5411: Each buffer may be either explicitly or automatically named.
5412: Explicitly named buffers are named when created with the
5413: .Ic set-buffer
5414: or
5415: .Ic load-buffer
5416: commands, or by renaming an automatically named buffer with
5417: .Ic set-buffer
5418: .Fl n .
5419: Automatically named buffers are given a name such as
5420: .Ql buffer0001 ,
5421: .Ql buffer0002
5422: and so on.
5423: When the
5424: .Ic buffer-limit
5425: option is reached, the oldest automatically named buffer is deleted.
1.493 nicm 5426: Explicitly named buffers are not subject to
1.57 jmc 5427: .Ic buffer-limit
1.709 nicm 5428: and may be deleted with the
1.392 nicm 5429: .Ic delete-buffer
5430: command.
5431: .Pp
1.57 jmc 5432: Buffers may be added using
5433: .Ic copy-mode
5434: or the
5435: .Ic set-buffer
1.392 nicm 5436: and
5437: .Ic load-buffer
5438: commands, and pasted into a window using the
1.57 jmc 5439: .Ic paste-buffer
5440: command.
1.392 nicm 5441: If a buffer command is used and no buffer is specified, the most
5442: recently added automatically named buffer is assumed.
1.57 jmc 5443: .Pp
5444: A configurable history buffer is also maintained for each window.
5445: By default, up to 2000 lines are kept; this can be altered with the
5446: .Ic history-limit
5447: option (see the
5448: .Ic set-option
5449: command above).
5450: .Pp
5451: The buffer commands are as follows:
5452: .Bl -tag -width Ds
1.178 nicm 5453: .It Xo
5454: .Ic choose-buffer
1.682 nicm 5455: .Op Fl NZr
1.572 nicm 5456: .Op Fl F Ar format
1.562 nicm 5457: .Op Fl f Ar filter
1.561 nicm 5458: .Op Fl O Ar sort-order
1.555 nicm 5459: .Op Fl t Ar target-pane
1.178 nicm 5460: .Op Ar template
5461: .Xc
1.555 nicm 5462: Put a pane into buffer mode, where a buffer may be chosen interactively from
5463: a list.
1.593 nicm 5464: .Fl Z
5465: zooms the pane.
1.555 nicm 5466: The following keys may be used in buffer mode:
5467: .Bl -column "Key" "Function" -offset indent
5468: .It Sy "Key" Ta Sy "Function"
1.582 nicm 5469: .It Li "Enter" Ta "Paste selected buffer"
1.555 nicm 5470: .It Li "Up" Ta "Select previous buffer"
5471: .It Li "Down" Ta "Select next buffer"
1.559 nicm 5472: .It Li "C-s" Ta "Search by name or content"
5473: .It Li "n" Ta "Repeat last search"
1.555 nicm 5474: .It Li "t" Ta "Toggle if buffer is tagged"
5475: .It Li "T" Ta "Tag no buffers"
5476: .It Li "C-t" Ta "Tag all buffers"
1.582 nicm 5477: .It Li "p" Ta "Paste selected buffer"
5478: .It Li "P" Ta "Paste tagged buffers"
1.555 nicm 5479: .It Li "d" Ta "Delete selected buffer"
5480: .It Li "D" Ta "Delete tagged buffers"
1.759 nicm 5481: .It Li "e" Ta "Open the buffer in an editor"
1.562 nicm 5482: .It Li "f" Ta "Enter a format to filter items"
1.682 nicm 5483: .It Li "O" Ta "Change sort field"
5484: .It Li "r" Ta "Reverse sort order"
1.576 nicm 5485: .It Li "v" Ta "Toggle preview"
1.555 nicm 5486: .It Li "q" Ta "Exit mode"
5487: .El
5488: .Pp
5489: After a buffer is chosen,
1.178 nicm 5490: .Ql %%
1.392 nicm 5491: is replaced by the buffer name in
1.178 nicm 5492: .Ar template
5493: and the result executed as a command.
5494: If
5495: .Ar template
5496: is not given, "paste-buffer -b '%%'" is used.
1.555 nicm 5497: .Pp
1.561 nicm 5498: .Fl O
1.682 nicm 5499: specifies the initial sort field: one of
1.561 nicm 5500: .Ql time ,
5501: .Ql name
5502: or
5503: .Ql size .
1.682 nicm 5504: .Fl r
5505: reverses the sort order.
1.562 nicm 5506: .Fl f
1.579 nicm 5507: specifies an initial filter: the filter is a format - if it evaluates to zero,
5508: the item in the list is not shown, otherwise it is shown.
5509: If a filter would lead to an empty list, it is ignored.
1.572 nicm 5510: .Fl F
5511: specifies the format for each item in the list.
1.576 nicm 5512: .Fl N
5513: starts without the preview.
1.314 nicm 5514: This command works only if at least one client is attached.
1.57 jmc 5515: .It Ic clear-history Op Fl t Ar target-pane
5516: .D1 (alias: Ic clearhist )
5517: Remove and free the history for the specified pane.
1.392 nicm 5518: .It Ic delete-buffer Op Fl b Ar buffer-name
1.57 jmc 5519: .D1 (alias: Ic deleteb )
1.392 nicm 5520: Delete the buffer named
5521: .Ar buffer-name ,
5522: or the most recently added automatically named buffer if not specified.
1.294 nicm 5523: .It Xo Ic list-buffers
5524: .Op Fl F Ar format
1.738 nicm 5525: .Op Fl f Ar filter
1.294 nicm 5526: .Xc
1.57 jmc 5527: .D1 (alias: Ic lsb )
1.198 nicm 5528: List the global buffers.
1.294 nicm 5529: .Fl F
1.738 nicm 5530: specifies the format of each line and
5531: .Fl f
5532: a filter.
5533: Only buffers for which the filter is true are shown.
5534: See the
1.294 nicm 5535: .Sx FORMATS
5536: section.
1.200 jmc 5537: .It Xo Ic load-buffer
1.392 nicm 5538: .Op Fl b Ar buffer-name
1.57 jmc 5539: .Ar path
5540: .Xc
5541: .D1 (alias: Ic loadb )
5542: Load the contents of the specified paste buffer from
5543: .Ar path .
5544: .It Xo Ic paste-buffer
1.278 nicm 5545: .Op Fl dpr
1.392 nicm 5546: .Op Fl b Ar buffer-name
1.170 nicm 5547: .Op Fl s Ar separator
1.158 nicm 5548: .Op Fl t Ar target-pane
1.57 jmc 5549: .Xc
5550: .D1 (alias: Ic pasteb )
1.158 nicm 5551: Insert the contents of a paste buffer into the specified pane.
5552: If not specified, paste into the current one.
1.57 jmc 5553: With
5554: .Fl d ,
1.392 nicm 5555: also delete the paste buffer.
1.57 jmc 5556: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170 nicm 5557: a separator, by default carriage return (CR).
5558: A custom separator may be specified using the
5559: .Fl s
5560: flag.
5561: The
1.57 jmc 5562: .Fl r
1.170 nicm 5563: flag means to do no replacement (equivalent to a separator of LF).
1.278 nicm 5564: If
5565: .Fl p
5566: is specified, paste bracket control codes are inserted around the
5567: buffer if the application has requested bracketed paste mode.
1.57 jmc 5568: .It Xo Ic save-buffer
5569: .Op Fl a
1.392 nicm 5570: .Op Fl b Ar buffer-name
1.57 jmc 5571: .Ar path
5572: .Xc
5573: .D1 (alias: Ic saveb )
5574: Save the contents of the specified paste buffer to
5575: .Ar path .
5576: The
5577: .Fl a
5578: option appends to rather than overwriting the file.
5579: .It Xo Ic set-buffer
1.383 nicm 5580: .Op Fl a
1.392 nicm 5581: .Op Fl b Ar buffer-name
5582: .Op Fl n Ar new-buffer-name
1.57 jmc 5583: .Ar data
5584: .Xc
5585: .D1 (alias: Ic setb )
5586: Set the contents of the specified buffer to
5587: .Ar data .
1.383 nicm 5588: The
5589: .Fl a
5590: option appends to rather than overwriting the buffer.
1.392 nicm 5591: The
5592: .Fl n
5593: option renames the buffer to
5594: .Ar new-buffer-name .
1.1 nicm 5595: .It Xo Ic show-buffer
1.392 nicm 5596: .Op Fl b Ar buffer-name
1.1 nicm 5597: .Xc
5598: .D1 (alias: Ic showb )
5599: Display the contents of the specified buffer.
1.57 jmc 5600: .El
5601: .Sh MISCELLANEOUS
5602: Miscellaneous commands are as follows:
5603: .Bl -tag -width Ds
1.72 nicm 5604: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 5605: Display a large clock.
1.334 nicm 5606: .It Xo Ic if-shell
1.410 nicm 5607: .Op Fl bF
1.334 nicm 5608: .Op Fl t Ar target-pane
5609: .Ar shell-command command
5610: .Op Ar command
5611: .Xc
1.57 jmc 5612: .D1 (alias: Ic if )
1.251 nicm 5613: Execute the first
1.57 jmc 5614: .Ar command
5615: if
5616: .Ar shell-command
1.251 nicm 5617: returns success or the second
5618: .Ar command
5619: otherwise.
1.410 nicm 5620: Before being executed,
5621: .Ar shell-command
5622: is expanded using the rules specified in the
1.334 nicm 5623: .Sx FORMATS
5624: section, including those relevant to
5625: .Ar target-pane .
1.335 nicm 5626: With
5627: .Fl b ,
5628: .Ar shell-command
5629: is run in the background.
1.410 nicm 5630: .Pp
5631: If
5632: .Fl F
5633: is given,
5634: .Ar shell-command
5635: is not executed but considered success if neither empty nor zero (after formats
5636: are expanded).
1.57 jmc 5637: .It Ic lock-server
5638: .D1 (alias: Ic lock )
1.90 nicm 5639: Lock each client individually by running the command specified by the
5640: .Ic lock-command
5641: option.
1.308 nicm 5642: .It Xo Ic run-shell
1.357 nicm 5643: .Op Fl b
1.717 nicm 5644: .Op Fl d Ar delay
1.308 nicm 5645: .Op Fl t Ar target-pane
1.718 nicm 5646: .Op Ar shell-command
1.308 nicm 5647: .Xc
1.87 nicm 5648: .D1 (alias: Ic run )
5649: Execute
1.153 nicm 5650: .Ar shell-command
1.106 nicm 5651: in the background without creating a window.
1.334 nicm 5652: Before being executed, shell-command is expanded using the rules specified in
5653: the
5654: .Sx FORMATS
5655: section.
1.335 nicm 5656: With
5657: .Fl b ,
5658: the command is run in the background.
1.717 nicm 5659: .Fl d
5660: waits for
5661: .Ar delay
5662: seconds before starting the command.
5663: After the command finishes, any output to stdout is displayed in view mode (in
5664: the pane specified by
1.308 nicm 5665: .Fl t
5666: or the current pane if omitted).
1.153 nicm 5667: If the command doesn't return success, the exit status is also displayed.
1.342 nicm 5668: .It Xo Ic wait-for
1.370 nicm 5669: .Op Fl L | S | U
1.342 nicm 5670: .Ar channel
5671: .Xc
5672: .D1 (alias: Ic wait )
1.343 nicm 5673: When used without options, prevents the client from exiting until woken using
1.342 nicm 5674: .Ic wait-for
5675: .Fl S
5676: with the same channel.
1.343 nicm 5677: When
5678: .Fl L
5679: is used, the channel is locked and any clients that try to lock the same
5680: channel are made to wait until the channel is unlocked with
5681: .Ic wait-for
5682: .Fl U .
1.703 nicm 5683: .El
5684: .Sh EXIT MESSAGES
5685: When a
5686: .Nm
5687: client detaches, it prints a message.
5688: This may be one of:
5689: .Bl -tag -width Ds
5690: .It [detached (from session ...)]
5691: The client was detached normally.
5692: .It [detached and SIGHUP]
5693: The client was detached and its parent sent the
5694: .Dv SIGHUP
5695: signal (for example with
5696: .Ic detach-client
5697: .Fl P ) .
5698: .It [lost tty]
5699: The client's
5700: .Xr tty 4
5701: or
5702: .Xr pty 4
5703: was unexpectedly destroyed.
5704: .It [terminated]
5705: The client was killed with
5706: .Dv SIGTERM .
5707: .It [exited]
5708: The server exited when it had no sessions.
5709: .It [server exited]
5710: The server exited when it received
5711: .Dv SIGTERM .
5712: .It [server exited unexpectedly]
5713: The server crashed or otherwise exited without telling the client the reason.
1.228 nicm 5714: .El
5715: .Sh TERMINFO EXTENSIONS
5716: .Nm
1.478 nicm 5717: understands some unofficial extensions to
1.746 nicm 5718: .Xr terminfo 5 .
1.744 nicm 5719: It is not normally necessary to set these manually, instead the
5720: .Ic terminal-features
5721: option should be used.
1.228 nicm 5722: .Bl -tag -width Ds
1.756 nicm 5723: .It Em \&AX
5724: An existing extension that tells
5725: .Nm
5726: the terminal supports default colours.
1.739 nicm 5727: .It Em \&Cs , Cr
1.233 nicm 5728: Set the cursor colour.
1.232 jmc 5729: The first takes a single string argument and is used to set the colour;
5730: the second takes no arguments and restores the default cursor colour.
5731: If set, a sequence such as this may be used
5732: to change the cursor colour from inside
5733: .Nm :
5734: .Bd -literal -offset indent
5735: $ printf '\e033]12;red\e033\e\e'
5736: .Ed
1.753 nicm 5737: .It Em \&Cmg, \&Clmg, \&Dsmg , \&Enmg
5738: Set, clear, disable or enable DECSLRM margins.
1.756 nicm 5739: These are set automatically if the terminal reports it is
5740: .Em VT420
5741: compatible.
1.755 nicm 5742: .It Em \&Dsbp , \&Enbp
5743: Disable and enable bracketed paste.
1.756 nicm 5744: These are set automatically if the
5745: .Em XT
5746: capability is present.
5747: .It Em \&Dsfcs , \&Enfcs
5748: Disable and enable focus reporting.
5749: These are set automatically if the
5750: .Em XT
5751: capability is present.
1.649 nicm 5752: .It Em \&Smol
5753: Enable the overline attribute.
1.611 nicm 5754: .It Em \&Smulx
1.672 nicm 5755: Set a styled underscore.
5756: The single parameter is one of: 0 for no underscore, 1 for normal
5757: underscore, 2 for double underscore, 3 for curly underscore, 4 for dotted
5758: underscore and 5 for dashed underscore.
5759: .It Em \&Setulc
5760: Set the underscore colour.
5761: The argument is (red * 65536) + (green * 256) + blue where each is between 0
5762: and 255.
1.361 jmc 5763: .It Em \&Ss , Se
1.403 nicm 5764: Set or reset the cursor style.
1.232 jmc 5765: If set, a sequence such as this may be used
5766: to change the cursor to an underline:
1.230 nicm 5767: .Bd -literal -offset indent
5768: $ printf '\e033[4 q'
5769: .Ed
5770: .Pp
5771: If
1.403 nicm 5772: .Em Se
5773: is not set, \&Ss with argument 0 will be used to reset the cursor style instead.
1.741 nicm 5774: .It Em \&Sync
1.745 nicm 5775: Start (parameter is 1) or end (parameter is 2) a synchronized update.
1.478 nicm 5776: .It Em \&Tc
5777: Indicate that the terminal supports the
5778: .Ql direct colour
5779: RGB escape sequence (for example, \ee[38;2;255;255;255m).
1.518 nicm 5780: .Pp
1.612 nicm 5781: If supported, this is used for the initialize colour escape sequence (which
1.518 nicm 5782: may be enabled by adding the
5783: .Ql initc
5784: and
5785: .Ql ccc
5786: capabilities to the
5787: .Nm
5788: .Xr terminfo 5
5789: entry).
1.739 nicm 5790: .Pp
5791: This is equivalent to the
5792: .Em RGB
5793: .Xr terminfo 5
5794: capability.
1.232 jmc 5795: .It Em \&Ms
1.478 nicm 5796: Store the current buffer in the host terminal's selection (clipboard).
1.232 jmc 5797: See the
5798: .Em set-clipboard
5799: option above and the
5800: .Xr xterm 1
5801: man page.
1.756 nicm 5802: .It Em \&XT
5803: This is an existing extension capability that tmux uses to mean that the
5804: terminal supports the
5805: .Xr xterm 1
5806: title set sequences and to automatically set some of the capabilities above.
1.345 nicm 5807: .El
5808: .Sh CONTROL MODE
5809: .Nm
5810: offers a textual interface called
5811: .Em control mode .
5812: This allows applications to communicate with
5813: .Nm
5814: using a simple text-only protocol.
5815: .Pp
5816: In control mode, a client sends
5817: .Nm
5818: commands or command sequences terminated by newlines on standard input.
5819: Each command will produce one block of output on standard output.
5820: An output block consists of a
5821: .Em %begin
5822: line followed by the output (which may be empty).
5823: The output block ends with a
5824: .Em %end
5825: or
5826: .Em %error .
5827: .Em %begin
5828: and matching
5829: .Em %end
5830: or
5831: .Em %error
5832: have two arguments: an integer time (as seconds from epoch) and command number.
5833: For example:
5834: .Bd -literal -offset indent
5835: %begin 1363006971 2
5836: 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active)
5837: %end 1363006971 2
5838: .Ed
1.535 nicm 5839: .Pp
5840: The
5841: .Ic refresh-client
5842: .Fl C
5843: command may be used to set the size of a client in control mode.
1.345 nicm 5844: .Pp
5845: In control mode,
5846: .Nm
5847: outputs notifications.
5848: A notification will never occur inside an output block.
5849: .Pp
5850: The following notifications are defined:
5851: .Bl -tag -width Ds
1.750 jmc 5852: .It Ic %client-session-changed Ar client session-id name
1.547 nicm 5853: The client is now attached to the session with ID
5854: .Ar session-id ,
5855: which is named
5856: .Ar name .
1.345 nicm 5857: .It Ic %exit Op Ar reason
5858: The
5859: .Nm
5860: client is exiting immediately, either because it is not attached to any session
5861: or an error occurred.
5862: If present,
5863: .Ar reason
5864: describes why the client exited.
1.460 nicm 5865: .It Ic %layout-change Ar window-id Ar window-layout Ar window-visible-layout Ar window-flags
1.345 nicm 5866: The layout of a window with ID
5867: .Ar window-id
5868: changed.
5869: The new layout is
5870: .Ar window-layout .
1.460 nicm 5871: The window's visible layout is
5872: .Ar window-visible-layout
5873: and the window flags are
5874: .Ar window-flags .
1.347 nicm 5875: .It Ic %output Ar pane-id Ar value
5876: A window pane produced output.
1.345 nicm 5877: .Ar value
1.350 nicm 5878: escapes non-printable characters and backslash as octal \\xxx.
1.547 nicm 5879: .It Ic %pane-mode-changed Ar pane-id
5880: The pane with ID
5881: .Ar pane-id
5882: has changed mode.
1.345 nicm 5883: .It Ic %session-changed Ar session-id Ar name
5884: The client is now attached to the session with ID
5885: .Ar session-id ,
5886: which is named
5887: .Ar name .
5888: .It Ic %session-renamed Ar name
5889: The current session was renamed to
5890: .Ar name .
1.547 nicm 5891: .It Ic %session-window-changed Ar session-id Ar window-id
5892: The session with ID
5893: .Ar session-id
5894: changed its active window to the window with ID
5895: .Ar window-id .
1.345 nicm 5896: .It Ic %sessions-changed
5897: A session was created or destroyed.
5898: .It Ic %unlinked-window-add Ar window-id
5899: The window with ID
5900: .Ar window-id
5901: was created but is not linked to the current session.
5902: .It Ic %window-add Ar window-id
5903: The window with ID
5904: .Ar window-id
5905: was linked to the current session.
5906: .It Ic %window-close Ar window-id
5907: The window with ID
5908: .Ar window-id
5909: closed.
1.547 nicm 5910: .It Ic %window-pane-changed Ar window-id Ar pane-id
5911: The active pane in the window with ID
5912: .Ar window-id
5913: changed to the pane with ID
5914: .Ar pane-id .
1.345 nicm 5915: .It Ic %window-renamed Ar window-id Ar name
5916: The window with ID
5917: .Ar window-id
5918: was renamed to
5919: .Ar name .
1.644 schwarze 5920: .El
5921: .Sh ENVIRONMENT
5922: When
5923: .Nm
5924: is started, it inspects the following environment variables:
5925: .Bl -tag -width LC_CTYPE
5926: .It Ev EDITOR
5927: If the command specified in this variable contains the string
5928: .Ql vi
5929: and
5930: .Ev VISUAL
5931: is unset, use vi-style key bindings.
5932: Overridden by the
5933: .Ic mode-keys
5934: and
5935: .Ic status-keys
5936: options.
5937: .It Ev HOME
5938: The user's login directory.
5939: If unset, the
5940: .Xr passwd 5
5941: database is consulted.
5942: .It Ev LC_CTYPE
5943: The character encoding
5944: .Xr locale 1 .
5945: It is used for two separate purposes.
5946: For output to the terminal, UTF-8 is used if the
5947: .Fl u
5948: option is given or if
5949: .Ev LC_CTYPE
5950: contains
5951: .Qq UTF-8
5952: or
5953: .Qq UTF8 .
5954: Otherwise, only ASCII characters are written and non-ASCII characters
5955: are replaced with underscores
5956: .Pq Ql _ .
5957: For input,
5958: .Nm
5959: always runs with a UTF-8 locale.
5960: If en_US.UTF-8 is provided by the operating system it is used and
5961: .Ev LC_CTYPE
5962: is ignored for input.
5963: Otherwise,
5964: .Ev LC_CTYPE
5965: tells
5966: .Nm
5967: what the UTF-8 locale is called on the current system.
5968: If the locale specified by
5969: .Ev LC_CTYPE
5970: is not available or is not a UTF-8 locale,
5971: .Nm
5972: exits with an error message.
5973: .It Ev LC_TIME
5974: The date and time format
5975: .Xr locale 1 .
5976: It is used for locale-dependent
5977: .Xr strftime 3
5978: format specifiers.
5979: .It Ev PWD
5980: The current working directory to be set in the global environment.
5981: This may be useful if it contains symbolic links.
5982: If the value of the variable does not match the current working
5983: directory, the variable is ignored and the result of
5984: .Xr getcwd 3
5985: is used instead.
5986: .It Ev SHELL
5987: The absolute path to the default shell for new windows.
5988: See the
5989: .Ic default-shell
5990: option for details.
5991: .It Ev TMUX_TMPDIR
5992: The parent directory of the directory containing the server sockets.
5993: See the
5994: .Fl L
5995: option for details.
5996: .It Ev VISUAL
5997: If the command specified in this variable contains the string
5998: .Ql vi ,
5999: use vi-style key bindings.
6000: Overridden by the
6001: .Ic mode-keys
6002: and
6003: .Ic status-keys
6004: options.
1.1 nicm 6005: .El
6006: .Sh FILES
1.26 nicm 6007: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 6008: .It Pa ~/.tmux.conf
1.6 jmc 6009: Default
1.1 nicm 6010: .Nm
1.6 jmc 6011: configuration file.
1.26 nicm 6012: .It Pa /etc/tmux.conf
6013: System-wide configuration file.
1.1 nicm 6014: .El
1.57 jmc 6015: .Sh EXAMPLES
6016: To create a new
6017: .Nm
6018: session running
6019: .Xr vi 1 :
6020: .Pp
6021: .Dl $ tmux new-session vi
6022: .Pp
6023: Most commands have a shorter form, known as an alias.
6024: For new-session, this is
6025: .Ic new :
6026: .Pp
6027: .Dl $ tmux new vi
6028: .Pp
6029: Alternatively, the shortest unambiguous form of a command is accepted.
6030: If there are several options, they are listed:
6031: .Bd -literal -offset indent
6032: $ tmux n
6033: ambiguous command: n, could be: new-session, new-window, next-window
6034: .Ed
6035: .Pp
6036: Within an active session, a new window may be created by typing
6037: .Ql C-b c
6038: (Ctrl
6039: followed by the
6040: .Ql b
6041: key
6042: followed by the
6043: .Ql c
6044: key).
6045: .Pp
6046: Windows may be navigated with:
6047: .Ql C-b 0
6048: (to select window 0),
6049: .Ql C-b 1
6050: (to select window 1), and so on;
6051: .Ql C-b n
6052: to select the next window; and
6053: .Ql C-b p
6054: to select the previous window.
6055: .Pp
6056: A session may be detached using
6057: .Ql C-b d
1.64 nicm 6058: (or by an external event such as
6059: .Xr ssh 1
6060: disconnection) and reattached with:
1.57 jmc 6061: .Pp
6062: .Dl $ tmux attach-session
6063: .Pp
6064: Typing
6065: .Ql C-b \&?
6066: lists the current key bindings in the current window; up and down may be used
6067: to navigate the list or
6068: .Ql q
6069: to exit from it.
6070: .Pp
6071: Commands to be run when the
6072: .Nm
6073: server is started may be placed in the
6074: .Pa ~/.tmux.conf
6075: configuration file.
6076: Common examples include:
6077: .Pp
6078: Changing the default prefix key:
6079: .Bd -literal -offset indent
6080: set-option -g prefix C-a
6081: unbind-key C-b
6082: bind-key C-a send-prefix
6083: .Ed
6084: .Pp
6085: Turning the status line off, or changing its colour:
6086: .Bd -literal -offset indent
6087: set-option -g status off
1.378 nicm 6088: set-option -g status-style bg=blue
1.57 jmc 6089: .Ed
6090: .Pp
6091: Setting other options, such as the default command,
6092: or locking after 30 minutes of inactivity:
6093: .Bd -literal -offset indent
6094: set-option -g default-command "exec /bin/ksh"
6095: set-option -g lock-after-time 1800
6096: .Ed
6097: .Pp
6098: Creating new key bindings:
6099: .Bd -literal -offset indent
6100: bind-key b set-option status
6101: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 6102: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 6103: .Ed
1.1 nicm 6104: .Sh SEE ALSO
6105: .Xr pty 4
6106: .Sh AUTHORS
1.477 nicm 6107: .An Nicholas Marriott Aq Mt nicholas.marriott@gmail.com