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