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