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