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