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