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