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