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