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