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