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