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