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