Annotation of src/usr.bin/tmux/tmux.1, Revision 1.248
1.248 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.247 2011/09/23 18:33:43 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.248 ! nicm 17: .Dd $Mdocdate: September 23 2011 $
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.114 nicm 26: .Op Fl 28lquv
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.
101: .It Fl 8
102: Like
103: .Fl 2 ,
1.6 jmc 104: but indicates that the terminal supports 88 colours.
1.91 nicm 105: .It Fl c Ar shell-command
106: Execute
107: .Ar shell-command
108: using the default shell.
109: If necessary, the
110: .Nm
111: server will be started to retrieve the
112: .Ic default-shell
113: option.
1.153 nicm 114: This option is for compatibility with
115: .Xr sh 1
116: when
117: .Nm
118: is used as a login shell.
1.1 nicm 119: .It Fl f Ar file
120: Specify an alternative configuration file.
121: By default,
122: .Nm
1.26 nicm 123: loads the system configuration file from
124: .Pa /etc/tmux.conf ,
125: if present, then looks for a user configuration file at
1.1 nicm 126: .Pa ~/.tmux.conf .
127: The configuration file is a set of
128: .Nm
129: commands which are executed in sequence when the server is first started.
1.61 nicm 130: .Pp
131: If a command in the configuration file fails,
132: .Nm
133: will report an error and exit without executing further commands.
1.1 nicm 134: .It Fl L Ar socket-name
135: .Nm
136: stores the server socket in a directory under
1.208 nicm 137: .Pa /tmp
138: (or
139: .Ev TMPDIR
140: if set);
1.1 nicm 141: the default socket is named
142: .Em default .
143: This option allows a different socket name to be specified, allowing several
144: independent
145: .Nm
146: servers to be run.
147: Unlike
148: .Fl S
149: a full path is not necessary: the sockets are all created in the same
150: directory.
1.2 nicm 151: .Pp
152: If the socket is accidentally removed, the
1.6 jmc 153: .Dv SIGUSR1
1.2 nicm 154: signal may be sent to the
155: .Nm
156: server process to recreate it.
1.166 sobrado 157: .It Fl l
158: Behave as a login shell.
159: This flag currently has no effect and is for compatibility with other shells
160: when using tmux as a login shell.
1.4 sobrado 161: .It Fl q
1.133 nicm 162: Set the
163: .Ic quiet
164: server option to prevent the server sending various informational messages.
1.1 nicm 165: .It Fl S Ar socket-path
166: Specify a full alternative path to the server socket.
167: If
168: .Fl S
169: is specified, the default socket directory is not used and any
170: .Fl L
171: flag is ignored.
172: .It Fl u
173: .Nm
1.14 nicm 174: attempts to guess if the terminal is likely to support UTF-8 by checking the
175: first of the
176: .Ev LC_ALL ,
177: .Ev LC_CTYPE
178: and
1.2 nicm 179: .Ev LANG
1.14 nicm 180: environment variables to be set for the string "UTF-8".
1.5 nicm 181: This is not always correct: the
1.2 nicm 182: .Fl u
183: flag explicitly informs
184: .Nm
1.6 jmc 185: that UTF-8 is supported.
1.33 nicm 186: .Pp
187: If the server is started from a client passed
188: .Fl u
189: or where UTF-8 is detected, the
190: .Ic utf8
191: and
192: .Ic status-utf8
193: options are enabled in the global window and session options respectively.
1.1 nicm 194: .It Fl v
195: Request verbose logging.
196: This option may be specified multiple times for increasing verbosity.
197: Log messages will be saved into
198: .Pa tmux-client-PID.log
199: and
200: .Pa tmux-server-PID.log
201: files in the current directory, where
202: .Em PID
1.6 jmc 203: is the PID of the server or client process.
1.1 nicm 204: .It Ar command Op Ar flags
205: This specifies one of a set of commands used to control
206: .Nm ,
1.6 jmc 207: as described in the following sections.
1.59 jmc 208: If no commands are specified, the
1.1 nicm 209: .Ic new-session
210: command is assumed.
1.57 jmc 211: .El
1.64 nicm 212: .Sh KEY BINDINGS
213: .Nm
214: may be controlled from an attached client by using a key combination of a
215: prefix key,
216: .Ql C-b
217: (Ctrl-b) by default, followed by a command key.
218: .Pp
1.172 nicm 219: The default command key bindings are:
1.64 nicm 220: .Pp
1.171 nicm 221: .Bl -tag -width "XXXXXXXXXX" -offset indent -compact
222: .It C-b
223: Send the prefix key (C-b) through to the application.
224: .It C-o
225: Rotate the panes in the current window forwards.
226: .It C-z
227: Suspend the
228: .Nm
229: client.
230: .It !
231: Break the current pane out of the window.
232: .It \&"
233: Split the current pane into two, top and bottom.
234: .It #
235: List all paste buffers.
1.236 nicm 236: .It $
237: Rename the current session.
1.171 nicm 238: .It %
239: Split the current pane into two, left and right.
240: .It &
241: Kill the current window.
242: .It '
243: Prompt for a window index to select.
244: .It ,
245: Rename the current window.
246: .It -
247: Delete the most recently copied buffer of text.
248: .It .
249: Prompt for an index to move the current window.
250: .It 0 to 9
251: Select windows 0 to 9.
252: .It :
253: Enter the
254: .Nm
255: command prompt.
1.187 nicm 256: .It ;
257: Move to the previously active pane.
1.178 nicm 258: .It =
259: Choose which buffer to paste interactively from a list.
1.171 nicm 260: .It \&?
261: List all key bindings.
262: .It D
263: Choose a client to detach.
1.182 jmc 264: .It \&[
1.171 nicm 265: Enter copy mode to copy text or view the history.
1.182 jmc 266: .It \&]
1.171 nicm 267: Paste the most recently copied buffer of text.
1.64 nicm 268: .It c
1.65 nicm 269: Create a new window.
1.64 nicm 270: .It d
1.65 nicm 271: Detach the current client.
1.171 nicm 272: .It f
273: Prompt to search for text in open windows.
274: .It i
275: Display some information about the current window.
1.64 nicm 276: .It l
1.65 nicm 277: Move to the previously selected window.
1.64 nicm 278: .It n
1.65 nicm 279: Change to the next window.
1.171 nicm 280: .It o
281: Select the next pane in the current window.
1.64 nicm 282: .It p
1.65 nicm 283: Change to the previous window.
1.171 nicm 284: .It q
285: Briefly display pane indexes.
286: .It r
287: Force redraw of the attached client.
288: .It s
289: Select a new session for the attached client interactively.
1.194 nicm 290: .It L
291: Switch the attached client back to the last session.
1.171 nicm 292: .It t
293: Show the time.
294: .It w
295: Choose the current window interactively.
296: .It x
297: Kill the current pane.
298: .It {
299: Swap the current pane with the previous pane.
300: .It }
301: Swap the current pane with the next pane.
302: .It ~
303: Show previous messages from
304: .Nm ,
305: if any.
306: .It Page Up
307: Enter copy mode and scroll one page up.
308: .It Up, Down
309: .It Left, Right
310: Change to the pane above, below, to the left, or to the right of the current
311: pane.
312: .It M-1 to M-5
313: Arrange panes in one of the five preset layouts: even-horizontal,
314: even-vertical, main-horizontal, main-vertical, or tiled.
315: .It M-n
316: Move to the next window with a bell or activity marker.
317: .It M-o
318: Rotate the panes in the current window backwards.
319: .It M-p
320: Move to the previous window with a bell or activity marker.
321: .It C-Up, C-Down
322: .It C-Left, C-Right
323: Resize the current pane in steps of one cell.
324: .It M-Up, M-Down
325: .It M-Left, M-Right
326: Resize the current pane in steps of five cells.
1.64 nicm 327: .El
328: .Pp
329: Key bindings may be changed with the
330: .Ic bind-key
331: and
332: .Ic unbind-key
333: commands.
1.57 jmc 334: .Sh COMMANDS
335: This section contains a list of the commands supported by
336: .Nm .
337: Most commands accept the optional
338: .Fl t
339: argument with one of
340: .Ar target-client ,
341: .Ar target-session
342: .Ar target-window ,
343: or
344: .Ar target-pane .
345: These specify the client, session, window or pane which a command should affect.
346: .Ar target-client
347: is the name of the
348: .Xr pty 4
349: file to which the client is connected, for example either of
350: .Pa /dev/ttyp1
351: or
352: .Pa ttyp1
353: for the client attached to
354: .Pa /dev/ttyp1 .
355: If no client is specified, the current client is chosen, if possible, or an
356: error is reported.
357: Clients may be listed with the
358: .Ic list-clients
359: command.
1.1 nicm 360: .Pp
1.57 jmc 361: .Ar target-session
362: is either the name of a session (as listed by the
363: .Ic list-sessions
364: command) or the name of a client with the same syntax as
365: .Ar target-client ,
366: in which case the session attached to the client is used.
367: When looking for the session name,
368: .Nm
369: initially searches for an exact match; if none is found, the session names
370: are checked for any for which
371: .Ar target-session
372: is a prefix or for which it matches as an
373: .Xr fnmatch 3
374: pattern.
375: If a single match is found, it is used as the target session; multiple matches
376: produce an error.
377: If a session is omitted, the current session is used if available; if no
1.117 nicm 378: current session is available, the most recently used is chosen.
1.1 nicm 379: .Pp
1.57 jmc 380: .Ar target-window
381: specifies a window in the form
382: .Em session Ns \&: Ns Em window .
383: .Em session
384: follows the same rules as for
385: .Ar target-session ,
386: and
387: .Em window
388: is looked for in order: as a window index, for example mysession:1; as an exact
389: window name, such as mysession:mywindow; then as an
390: .Xr fnmatch 3
391: pattern or the start of a window name, such as mysession:mywin* or
392: mysession:mywin.
393: An empty window name specifies the next unused index if appropriate (for
394: example the
395: .Ic new-window
396: and
397: .Ic link-window
398: commands)
399: otherwise the current window in
400: .Em session
401: is chosen.
1.140 nicm 402: The special character
403: .Ql \&!
404: uses the last (previously current) window, or
405: .Ql +
406: and
407: .Ql -
408: are the next window or the previous window by number.
1.57 jmc 409: When the argument does not contain a colon,
410: .Nm
411: first attempts to parse it as window; if that fails, an attempt is made to
412: match a session.
1.1 nicm 413: .Pp
1.57 jmc 414: .Ar target-pane
415: takes a similar form to
416: .Ar target-window
417: but with the optional addition of a period followed by a pane index, for
418: example: mysession:mywindow.1.
419: If the pane index is omitted, the currently active pane in the specified
420: window is used.
421: If neither a colon nor period appears,
1.13 nicm 422: .Nm
1.57 jmc 423: first attempts to use the argument as a pane index; if that fails, it is looked
424: up as for
425: .Ar target-window .
1.156 nicm 426: A
427: .Ql +
428: or
429: .Ql -
430: indicate the next or previous pane index, respectively.
1.132 nicm 431: One of the strings
432: .Em top ,
433: .Em bottom ,
434: .Em left ,
435: .Em right ,
436: .Em top-left ,
437: .Em top-right ,
1.216 nicm 438: .Em bottom-left
439: or
1.132 nicm 440: .Em bottom-right
441: may be used instead of a pane index.
1.177 nicm 442: .Pp
443: The special characters
444: .Ql +
445: and
446: .Ql -
447: may be followed by an offset, for example:
448: .Bd -literal -offset indent
449: select-window -t:+2
450: .Ed
451: .Pp
452: When dealing with a session that doesn't contain sequential window indexes,
453: they will be correctly skipped.
1.212 nicm 454: .Pp
455: .Nm
456: also gives each pane created in a server an identifier consisting of a
457: .Ql %
458: and a number, starting from zero.
459: A pane's identifier is unique for the life of the
460: .Nm
461: server and is passed to the child process of the pane in the
462: .Ev TMUX_PANE
463: environment variable.
464: It may be used alone to target a pane or the window containing it.
1.15 jmc 465: .Pp
1.153 nicm 466: .Ar shell-command
467: arguments are
468: .Xr sh 1
469: commands.
470: These must be passed as a single item, which typically means quoting them, for
471: example:
472: .Bd -literal -offset indent
473: new-window 'vi /etc/passwd'
474: .Ed
475: .Pp
476: .Ar command
477: .Op Ar arguments
478: refers to a
479: .Nm
480: command, passed with the command and arguments separately, for example:
481: .Bd -literal -offset indent
482: bind-key F1 set-window-option force-width 81
483: .Ed
484: .Pp
485: Or if using
486: .Xr sh 1 :
487: .Bd -literal -offset indent
488: $ tmux bind-key F1 set-window-option force-width 81
489: .Ed
490: .Pp
1.57 jmc 491: Multiple commands may be specified together as part of a
492: .Em command sequence .
493: Each command should be separated by spaces and a semicolon;
1.244 nicm 494: commands are executed sequentially from left to right and
495: lines ending with a backslash continue on to the next line.
1.57 jmc 496: A literal semicolon may be included by escaping it with a backslash (for
497: example, when specifying a command sequence to
498: .Ic bind-key ) .
1.13 nicm 499: .Pp
1.153 nicm 500: Example
501: .Nm
502: commands include:
1.13 nicm 503: .Bd -literal -offset indent
1.57 jmc 504: refresh-client -t/dev/ttyp2
505:
506: rename-session -tfirst newname
507:
508: set-window-option -t:0 monitor-activity on
509:
510: new-window ; split-window -d
1.244 nicm 511:
512: bind-key R source-file ~/.tmux.conf \e; \e
513: display-message "source-file done"
1.13 nicm 514: .Ed
1.153 nicm 515: .Pp
516: Or from
517: .Xr sh 1 :
518: .Bd -literal -offset indent
519: $ tmux kill-window -t :1
520:
1.159 jmc 521: $ tmux new-window \e; split-window -d
1.153 nicm 522:
1.159 jmc 523: $ tmux new-session -d 'vi /etc/passwd' \e; split-window -d \e; attach
1.153 nicm 524: .Ed
1.57 jmc 525: .Sh CLIENTS AND SESSIONS
1.153 nicm 526: The
527: .Nm
528: server manages clients, sessions, windows and panes.
529: Clients are attached to sessions to interact with them, either
530: when they are created with the
531: .Ic new-session
532: command, or later with the
533: .Ic attach-session
534: command.
1.188 nicm 535: Each session has one or more windows
1.153 nicm 536: .Em linked
537: into it.
538: Windows may be linked to multiple sessions and are made up of one or
539: more panes,
540: each of which contains a pseudo terminal.
541: Commands for creating, linking and otherwise manipulating windows
542: are covered
543: in the
544: .Sx WINDOWS AND PANES
545: section.
546: .Pp
547: The following commands are available to manage clients and sessions:
1.57 jmc 548: .Bl -tag -width Ds
549: .It Xo Ic attach-session
1.148 nicm 550: .Op Fl dr
1.57 jmc 551: .Op Fl t Ar target-session
552: .Xc
553: .D1 (alias: Ic attach )
554: If run from outside
555: .Nm ,
556: create a new client in the current terminal and attach it to
557: .Ar target-session .
558: If used from inside, switch the current client.
559: If
560: .Fl d
561: is specified, any other clients attached to the session are detached.
1.148 nicm 562: .Fl r
563: signifies the client is read-only (only keys bound to the
564: .Ic detach-client
1.242 nicm 565: or
566: .Ic switch-client
567: commands have any effect)
1.13 nicm 568: .Pp
1.57 jmc 569: If no server is started,
570: .Ic attach-session
571: will attempt to start it; this will fail unless sessions are created in the
572: configuration file.
1.217 nicm 573: .Pp
574: The
575: .Ar target-session
576: rules for
577: .Ic attach-session
578: are slightly adjusted: if
579: .Nm
580: needs to select the most recently used session, it will prefer the most
581: recently used
582: .Em unattached
583: session.
1.211 nicm 584: .It Xo Ic detach-client
585: .Op Fl P
1.219 nicm 586: .Op Fl s Ar target-session
1.211 nicm 587: .Op Fl t Ar target-client
588: .Xc
1.57 jmc 589: .D1 (alias: Ic detach )
1.218 nicm 590: Detach the current client if bound to a key, the client specified with
591: .Fl t ,
592: or all clients currently attached to to the session specified by
593: .Fl s .
1.211 nicm 594: If
595: .Fl P
596: is given, send SIGHUP to the parent process of the client, typically causing it
597: to exit.
1.57 jmc 598: .It Ic has-session Op Fl t Ar target-session
599: .D1 (alias: Ic has )
600: Report an error and exit with 1 if the specified session does not exist.
601: If it does exist, exit with 0.
602: .It Ic kill-server
603: Kill the
1.1 nicm 604: .Nm
1.57 jmc 605: server and clients and destroy all sessions.
606: .It Ic kill-session Op Fl t Ar target-session
607: Destroy the given session, closing any windows linked to it and no other
608: sessions, and detaching all clients attached to it.
1.220 nicm 609: .It Ic list-clients Op Fl t Ar target-session
1.57 jmc 610: .D1 (alias: Ic lsc )
1.221 jmc 611: List all clients attached to the server.
612: If
1.220 nicm 613: .Ar target-session
614: is specified, list only clients connected to that session.
1.57 jmc 615: .It Ic list-commands
616: .D1 (alias: Ic lscm )
617: List the syntax of all commands supported by
618: .Nm .
1.247 nicm 619: .It Ic list-sessions Op Fl F Ar format
1.57 jmc 620: .D1 (alias: Ic ls )
621: List all sessions managed by the server.
1.247 nicm 622: For the meaning of the
623: .Fl F
624: flag, see the
625: .Sx FORMATS
626: section.
1.175 nicm 627: .It Ic lock-client Op Fl t Ar target-client
628: .D1 (alias: Ic lockc )
1.92 nicm 629: Lock
630: .Ar target-client ,
631: see the
632: .Ic lock-server
633: command.
1.175 nicm 634: .It Ic lock-session Op Fl t Ar target-session
635: .D1 (alias: Ic locks )
1.92 nicm 636: Lock all clients attached to
637: .Ar target-session .
1.57 jmc 638: .It Xo Ic new-session
639: .Op Fl d
640: .Op Fl n Ar window-name
641: .Op Fl s Ar session-name
1.101 nicm 642: .Op Fl t Ar target-session
1.210 nicm 643: .Op Fl x Ar width
644: .Op Fl y Ar height
1.153 nicm 645: .Op Ar shell-command
1.57 jmc 646: .Xc
647: .D1 (alias: Ic new )
648: Create a new session with name
649: .Ar session-name .
1.153 nicm 650: .Pp
1.57 jmc 651: The new session is attached to the current terminal unless
652: .Fl d
653: is given.
654: .Ar window-name
1.1 nicm 655: and
1.153 nicm 656: .Ar shell-command
657: are the name of and shell command to execute in the initial window.
1.210 nicm 658: If
659: .Fl d
660: is used,
661: .Fl x
662: and
663: .Fl y
664: specify the size of the initial window (80 by 24 if not given).
1.68 nicm 665: .Pp
666: If run from a terminal, any
667: .Xr termios 4
668: special characters are saved and used for new windows in the new session.
1.101 nicm 669: .Pp
670: If
671: .Fl t
672: is given, the new session is
673: .Em grouped
674: with
675: .Ar target-session .
676: This means they share the same set of windows - all windows from
677: .Ar target-session
678: are linked to the new session and any subsequent new windows or windows being
679: closed are applied to both sessions.
680: The current and previous window and any session options remain independent and
681: either session may be killed without affecting the other.
682: Giving
683: .Fl n
684: or
1.153 nicm 685: .Ar shell-command
1.101 nicm 686: are invalid if
687: .Fl t
688: is used.
1.248 ! nicm 689: .It Xo Ic refresh-client
! 690: .Op Fl S
! 691: .Op Fl t Ar target-client
! 692: .Xc
1.57 jmc 693: .D1 (alias: Ic refresh )
694: Refresh the current client if bound to a key, or a single client if one is given
695: with
696: .Fl t .
1.248 ! nicm 697: If
! 698: .Fl S
! 699: is specified, only update the client's status bar.
1.57 jmc 700: .It Xo Ic rename-session
701: .Op Fl t Ar target-session
702: .Ar new-name
703: .Xc
704: .D1 (alias: Ic rename )
705: Rename the session to
706: .Ar new-name .
1.121 nicm 707: .It Xo Ic show-messages
1.120 nicm 708: .Op Fl t Ar target-client
709: .Xc
710: .D1 (alias: Ic showmsgs )
711: Any messages displayed on the status line are saved in a per-client message
712: log, up to a maximum of the limit set by the
713: .Ar message-limit
714: session option for the session attached to that client.
715: This command displays the log for
716: .Ar target-client .
1.57 jmc 717: .It Ic source-file Ar path
718: .D1 (alias: Ic source )
719: Execute commands from
720: .Ar path .
721: .It Ic start-server
722: .D1 (alias: Ic start )
723: Start the
1.1 nicm 724: .Nm
1.57 jmc 725: server, if not already running, without creating any sessions.
726: .It Xo Ic suspend-client
1.202 nicm 727: .Op Fl t Ar target-client
1.57 jmc 728: .Xc
729: .D1 (alias: Ic suspendc )
730: Suspend a client by sending
731: .Dv SIGTSTP
732: (tty stop).
733: .It Xo Ic switch-client
1.242 nicm 734: .Op Fl lnpr
1.57 jmc 735: .Op Fl c Ar target-client
736: .Op Fl t Ar target-session
737: .Xc
738: .D1 (alias: Ic switchc )
739: Switch the current session for client
740: .Ar target-client
741: to
742: .Ar target-session .
1.183 nicm 743: If
1.197 jmc 744: .Fl l ,
1.183 nicm 745: .Fl n
746: or
747: .Fl p
1.194 nicm 748: is used, the client is moved to the last, next or previous session
749: respectively.
1.242 nicm 750: .Fl r
751: toggles whether a client is read-only (see the
752: .Ic attach-session
753: command).
1.57 jmc 754: .El
755: .Sh WINDOWS AND PANES
1.1 nicm 756: A
757: .Nm
758: window may be in one of several modes.
759: The default permits direct access to the terminal attached to the window.
1.164 nicm 760: The other is copy mode, which permits a section of a window or its
761: history to be copied to a
1.1 nicm 762: .Em paste buffer
763: for later insertion into another window.
764: This mode is entered with the
765: .Ic copy-mode
766: command, bound to
1.113 nicm 767: .Ql \&[
1.1 nicm 768: by default.
1.164 nicm 769: It is also entered when a command that produces output, such as
770: .Ic list-keys ,
771: is executed from a key binding.
1.1 nicm 772: .Pp
1.6 jmc 773: The keys available depend on whether emacs or vi mode is selected
774: (see the
1.1 nicm 775: .Ic mode-keys
776: option).
777: The following keys are supported as appropriate for the mode:
1.157 nicm 778: .Bl -column "FunctionXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
1.1 nicm 779: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27 nicm 780: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.142 nicm 781: .It Li "Bottom of history" Ta "G" Ta "M-<"
1.1 nicm 782: .It Li "Clear selection" Ta "Escape" Ta "C-g"
783: .It Li "Copy selection" Ta "Enter" Ta "M-w"
784: .It Li "Cursor down" Ta "j" Ta "Down"
1.70 nicm 785: .It Li "Cursor left" Ta "h" Ta "Left"
786: .It Li "Cursor right" Ta "l" Ta "Right"
1.116 nicm 787: .It Li "Cursor to bottom line" Ta "L" Ta ""
788: .It Li "Cursor to middle line" Ta "M" Ta "M-r"
789: .It Li "Cursor to top line" Ta "H" Ta "M-R"
1.70 nicm 790: .It Li "Cursor up" Ta "k" Ta "Up"
1.71 nicm 791: .It Li "Delete entire line" Ta "d" Ta "C-u"
1.227 nicm 792: .It Li "Delete/Copy to end of line" Ta "D" Ta "C-k"
1.1 nicm 793: .It Li "End of line" Ta "$" Ta "C-e"
1.142 nicm 794: .It Li "Go to line" Ta ":" Ta "g"
1.116 nicm 795: .It Li "Half page down" Ta "C-d" Ta "M-Down"
796: .It Li "Half page up" Ta "C-u" Ta "M-Up"
1.157 nicm 797: .It Li "Jump forward" Ta "f" Ta "f"
798: .It Li "Jump backward" Ta "F" Ta "F"
799: .It Li "Jump again" Ta ";" Ta ";"
800: .It Li "Jump again in reverse" Ta "," Ta ","
1.1 nicm 801: .It Li "Next page" Ta "C-f" Ta "Page down"
1.146 nicm 802: .It Li "Next space" Ta "W" Ta ""
803: .It Li "Next space, end of word" Ta "E" Ta ""
1.143 nicm 804: .It Li "Next word" Ta "w" Ta ""
805: .It Li "Next word end" Ta "e" Ta "M-f"
1.70 nicm 806: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.116 nicm 807: .It Li "Previous page" Ta "C-b" Ta "Page up"
1.1 nicm 808: .It Li "Previous word" Ta "b" Ta "M-b"
1.146 nicm 809: .It Li "Previous space" Ta "B" Ta ""
1.1 nicm 810: .It Li "Quit mode" Ta "q" Ta "Escape"
1.147 nicm 811: .It Li "Rectangle toggle" Ta "v" Ta "R"
1.141 nicm 812: .It Li "Scroll down" Ta "C-Down or C-e" Ta "C-Down"
813: .It Li "Scroll up" Ta "C-Up or C-y" Ta "C-Up"
1.70 nicm 814: .It Li "Search again" Ta "n" Ta "n"
1.152 nicm 815: .It Li "Search again in reverse" Ta "N" Ta "N"
1.70 nicm 816: .It Li "Search backward" Ta "?" Ta "C-r"
817: .It Li "Search forward" Ta "/" Ta "C-s"
818: .It Li "Start of line" Ta "0" Ta "C-a"
1.1 nicm 819: .It Li "Start selection" Ta "Space" Ta "C-Space"
1.142 nicm 820: .It Li "Top of history" Ta "g" Ta "M->"
1.80 nicm 821: .It Li "Transpose chars" Ta "" Ta "C-t"
1.1 nicm 822: .El
1.146 nicm 823: .Pp
824: The next and previous word keys use space and the
825: .Ql - ,
1.154 nicm 826: .Ql _
1.146 nicm 827: and
828: .Ql @
1.154 nicm 829: characters as word delimiters by default, but this can be adjusted by
830: setting the
831: .Em word-separators
832: window option.
1.146 nicm 833: Next word moves to the start of the next word, next word end to the end of the
834: next word and previous word to the start of the previous word.
835: The three next and previous space keys work similarly but use a space alone as
836: the word separator.
1.157 nicm 837: .Pp
838: The jump commands enable quick movement within a line.
839: For instance, typing
840: .Ql f
841: followed by
842: .Ql /
843: will move the cursor to the next
844: .Ql /
845: character on the current line.
846: A
847: .Ql \&;
848: will then jump to the next occurrence.
1.1 nicm 849: .Pp
1.155 nicm 850: Commands in copy mode may be prefaced by an optional repeat count.
851: With vi key bindings, a prefix is entered using the number keys; with
852: emacs, the Alt (meta) key and a number begins prefix entry.
853: For example, to move the cursor forward by ten words, use
854: .Ql M-1 0 M-f
855: in emacs mode, and
856: .Ql 10w
857: in vi.
858: .Pp
859: Mode key bindings are defined in a set of named tables:
1.48 nicm 860: .Em vi-edit
861: and
862: .Em emacs-edit
863: for keys used when line editing at the command prompt;
864: .Em vi-choice
865: and
866: .Em emacs-choice
867: for keys used when choosing from lists (such as produced by the
1.144 nicm 868: .Ic choose-window
1.164 nicm 869: command); and
1.48 nicm 870: .Em vi-copy
871: and
872: .Em emacs-copy
1.97 nicm 873: used in copy mode.
1.48 nicm 874: The tables may be viewed with the
875: .Ic list-keys
1.49 nicm 876: command and keys modified or removed with
877: .Ic bind-key
878: and
879: .Ic unbind-key .
1.48 nicm 880: .Pp
1.2 nicm 881: The paste buffer key pastes the first line from the top paste buffer on the
882: stack.
1.57 jmc 883: .Pp
1.164 nicm 884: The synopsis for the
885: .Ic copy-mode
886: command is:
1.57 jmc 887: .Bl -tag -width Ds
888: .It Xo Ic copy-mode
889: .Op Fl u
1.72 nicm 890: .Op Fl t Ar target-pane
1.57 jmc 891: .Xc
892: Enter copy mode.
893: The
894: .Fl u
895: option scrolls one page up.
896: .El
1.18 nicm 897: .Pp
1.1 nicm 898: Each window displayed by
899: .Nm
900: may be split into one or more
901: .Em panes ;
902: each pane takes up a certain area of the display and is a separate terminal.
903: A window may be split into panes using the
904: .Ic split-window
905: command.
1.38 nicm 906: Windows may be split horizontally (with the
907: .Fl h
908: flag) or vertically.
909: Panes may be resized with the
910: .Ic resize-pane
1.1 nicm 911: command (bound to
1.38 nicm 912: .Ql C-up ,
913: .Ql C-down
914: .Ql C-left
915: and
916: .Ql C-right
1.1 nicm 917: by default), the current pane may be changed with the
1.156 nicm 918: .Ic select-pane
919: command and the
1.1 nicm 920: .Ic rotate-window
921: and
922: .Ic swap-pane
1.38 nicm 923: commands may be used to swap panes without changing their position.
924: Panes are numbered beginning from zero in the order they are created.
925: .Pp
926: A number of preset
927: .Em layouts
928: are available.
929: These may be selected with the
930: .Ic select-layout
931: command or cycled with
932: .Ic next-layout
933: (bound to
1.149 nicm 934: .Ql Space
1.131 nicm 935: by default); once a layout is chosen, panes within it may be moved and resized
936: as normal.
1.1 nicm 937: .Pp
938: The following layouts are supported:
939: .Bl -tag -width Ds
940: .It Ic even-horizontal
941: Panes are spread out evenly from left to right across the window.
942: .It Ic even-vertical
943: Panes are spread evenly from top to bottom.
1.2 nicm 944: .It Ic main-horizontal
1.131 nicm 945: A large (main) pane is shown at the top of the window and the remaining panes
946: are spread from left to right in the leftover space at the bottom.
1.2 nicm 947: Use the
948: .Em main-pane-height
949: window option to specify the height of the top pane.
1.1 nicm 950: .It Ic main-vertical
1.2 nicm 951: Similar to
952: .Ic main-horizontal
953: but the large pane is placed on the left and the others spread from top to
954: bottom along the right.
955: See the
956: .Em main-pane-width
957: window option.
1.165 nicm 958: .It Ic tiled
959: Panes are spread out as evenly as possible over the window in both rows and
960: columns.
1.1 nicm 961: .El
1.8 nicm 962: .Pp
1.181 nicm 963: In addition,
964: .Ic select-layout
965: may be used to apply a previously used layout - the
966: .Ic list-windows
967: command displays the layout of each window in a form suitable for use with
968: .Ic select-layout .
969: For example:
970: .Bd -literal -offset indent
971: $ tmux list-windows
972: 0: ksh [159x48]
973: layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0}
974: $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
975: .Ed
1.196 nicm 976: .Pp
1.181 nicm 977: .Nm
978: automatically adjusts the size of the layout for the current window size.
979: Note that a layout cannot be applied to a window with more panes than that
980: from which the layout was originally defined.
981: .Pp
1.57 jmc 982: Commands related to windows and panes are as follows:
983: .Bl -tag -width Ds
984: .It Xo Ic break-pane
985: .Op Fl d
986: .Op Fl t Ar target-pane
987: .Xc
988: .D1 (alias: Ic breakp )
989: Break
990: .Ar target-pane
991: off from its containing window to make it the only pane in a new window.
992: If
993: .Fl d
994: is given, the new window does not become the current window.
1.128 nicm 995: .It Xo Ic capture-pane
996: .Op Fl b Ar buffer-index
1.213 nicm 997: .Op Fl E Ar end-line
998: .Op Fl S Ar start-line
1.128 nicm 999: .Op Fl t Ar target-pane
1000: .Xc
1001: .D1 (alias: Ic capturep )
1002: Capture the contents of a pane to the specified buffer, or a new buffer if none
1003: is specified.
1.213 nicm 1004: .Pp
1005: .Fl S
1006: and
1007: .Fl E
1008: specify the starting and ending line numbers, zero is the first line of the
1009: visible pane and negative numbers are lines in the history.
1010: The default is to capture only the visible contents of the pane.
1.76 nicm 1011: .It Xo
1012: .Ic choose-client
1013: .Op Fl t Ar target-window
1014: .Op Ar template
1015: .Xc
1016: Put a window into client choice mode, allowing a client to be selected
1017: interactively from a list.
1018: After a client is chosen,
1019: .Ql %%
1020: is replaced by the client
1021: .Xr pty 4
1022: path in
1023: .Ar template
1024: and the result executed as a command.
1025: If
1026: .Ar template
1027: is not given, "detach-client -t '%%'" is used.
1.57 jmc 1028: This command works only from inside
1029: .Nm .
1.76 nicm 1030: .It Xo
1031: .Ic choose-session
1032: .Op Fl t Ar target-window
1033: .Op Ar template
1034: .Xc
1035: Put a window into session choice mode, where a session may be selected
1036: interactively from a list.
1037: When one is chosen,
1038: .Ql %%
1039: is replaced by the session name in
1040: .Ar template
1041: and the result executed as a command.
1042: If
1043: .Ar template
1044: is not given, "switch-client -t '%%'" is used.
1045: This command works only from inside
1046: .Nm .
1047: .It Xo
1048: .Ic choose-window
1049: .Op Fl t Ar target-window
1050: .Op Ar template
1051: .Xc
1052: Put a window into window choice mode, where a window may be chosen
1053: interactively from a list.
1054: After a window is selected,
1055: .Ql %%
1056: is replaced by the session name and window index in
1057: .Ar template
1058: and the result executed as a command.
1059: If
1060: .Ar template
1061: is not given, "select-window -t '%%'" is used.
1.57 jmc 1062: This command works only from inside
1063: .Nm .
1.78 nicm 1064: .It Ic display-panes Op Fl t Ar target-client
1065: .D1 (alias: Ic displayp)
1066: Display a visible indicator of each pane shown by
1067: .Ar target-client .
1068: See the
1.145 nicm 1069: .Ic display-panes-time ,
1070: .Ic display-panes-colour ,
1.78 nicm 1071: and
1.145 nicm 1072: .Ic display-panes-active-colour
1.78 nicm 1073: session options.
1.84 nicm 1074: While the indicator is on screen, a pane may be selected with the
1075: .Ql 0
1076: to
1077: .Ql 9
1078: keys.
1.57 jmc 1079: .It Xo Ic find-window
1080: .Op Fl t Ar target-window
1081: .Ar match-string
1082: .Xc
1083: .D1 (alias: Ic findw )
1084: Search for the
1085: .Xr fnmatch 3
1086: pattern
1087: .Ar match-string
1088: in window names, titles, and visible content (but not history).
1089: If only one window is matched, it'll be automatically selected, otherwise a
1090: choice list is shown.
1091: This command only works from inside
1.1 nicm 1092: .Nm .
1.137 nicm 1093: .It Xo Ic join-pane
1094: .Op Fl dhv
1095: .Oo Fl l
1096: .Ar size |
1097: .Fl p Ar percentage Oc
1098: .Op Fl s Ar src-pane
1099: .Op Fl t Ar dst-pane
1100: .Xc
1101: .D1 (alias: Ic joinp )
1102: Like
1103: .Ic split-window ,
1104: but instead of splitting
1105: .Ar dst-pane
1106: and creating a new pane, split it and move
1107: .Ar src-pane
1108: into the space.
1109: This can be used to reverse
1110: .Ic break-pane .
1.112 nicm 1111: .It Xo Ic kill-pane
1112: .Op Fl a
1113: .Op Fl t Ar target-pane
1114: .Xc
1.57 jmc 1115: .D1 (alias: Ic killp )
1116: Destroy the given pane.
1117: If no panes remain in the containing window, it is also destroyed.
1.112 nicm 1118: The
1119: .Fl a
1120: option kills all but the pane given with
1121: .Fl t .
1.57 jmc 1122: .It Ic kill-window Op Fl t Ar target-window
1123: .D1 (alias: Ic killw )
1124: Kill the current window or the window at
1125: .Ar target-window ,
1.1 nicm 1126: removing it from any sessions to which it is linked.
1.187 nicm 1127: .It Ic last-pane Op Fl t Ar target-window
1128: .D1 (alias: Ic lastp )
1129: Select the last (previously selected) pane.
1.56 jmc 1130: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 1131: .D1 (alias: Ic last )
1132: Select the last (previously selected) window.
1133: If no
1134: .Ar target-session
1135: is specified, select the last window of the current session.
1136: .It Xo Ic link-window
1137: .Op Fl dk
1138: .Op Fl s Ar src-window
1139: .Op Fl t Ar dst-window
1140: .Xc
1141: .D1 (alias: Ic linkw )
1142: Link the window at
1143: .Ar src-window
1144: to the specified
1145: .Ar dst-window .
1146: If
1147: .Ar dst-window
1148: is specified and no such window exists, the
1149: .Ar src-window
1150: is linked there.
1151: If
1152: .Fl k
1153: is given and
1154: .Ar dst-window
1155: exists, it is killed, otherwise an error is generated.
1156: If
1157: .Fl d
1158: is given, the newly linked window is not selected.
1.214 nicm 1159: .It Xo Ic list-panes
1160: .Op Fl as
1.245 nicm 1161: .Op Fl F Ar format
1.214 nicm 1162: .Op Fl t Ar target
1163: .Xc
1.104 nicm 1164: .D1 (alias: Ic lsp )
1.214 nicm 1165: If
1166: .Fl a
1167: is given,
1168: .Ar target
1169: is ignored and all panes on the server are listed.
1170: If
1171: .Fl s
1172: is given,
1173: .Ar target
1174: is a session (or the current session).
1175: If neither is given,
1176: .Ar target
1177: is a window (or the current window).
1.247 nicm 1178: For the meaning of the
1179: .Fl F
1180: flag, see the
1181: .Sx FORMATS
1182: section.
1.214 nicm 1183: .It Xo Ic list-windows
1184: .Op Fl a
1.245 nicm 1185: .Op Fl F Ar format
1.214 nicm 1186: .Op Fl t Ar target-session
1187: .Xc
1.1 nicm 1188: .D1 (alias: Ic lsw )
1.214 nicm 1189: If
1190: .Fl a
1191: is given, list all windows on the server.
1192: Otherwise, list windows in the current session or in
1.1 nicm 1193: .Ar target-session .
1.245 nicm 1194: For the meaning of the
1195: .Fl F
1196: flag, see the
1197: .Sx FORMATS
1198: section.
1.1 nicm 1199: .It Xo Ic move-window
1.175 nicm 1200: .Op Fl dk
1.1 nicm 1201: .Op Fl s Ar src-window
1202: .Op Fl t Ar dst-window
1203: .Xc
1204: .D1 (alias: Ic movew )
1205: This is similar to
1206: .Ic link-window ,
1207: except the window at
1208: .Ar src-window
1209: is moved to
1210: .Ar dst-window .
1211: .It Xo Ic new-window
1.201 nicm 1212: .Op Fl adkP
1.1 nicm 1213: .Op Fl n Ar window-name
1214: .Op Fl t Ar target-window
1.153 nicm 1215: .Op Ar shell-command
1.1 nicm 1216: .Xc
1217: .D1 (alias: Ic neww )
1218: Create a new window.
1.160 nicm 1219: With
1220: .Fl a ,
1221: the new window is inserted at the next index up from the specified
1222: .Ar target-window ,
1223: moving windows up if necessary,
1224: otherwise
1225: .Ar target-window
1226: is the new window location.
1227: .Pp
1.1 nicm 1228: If
1229: .Fl d
1230: is given, the session does not make the new window the current window.
1231: .Ar target-window
1.28 nicm 1232: represents the window to be created; if the target already exists an error is
1233: shown, unless the
1234: .Fl k
1235: flag is used, in which case it is destroyed.
1.153 nicm 1236: .Ar shell-command
1.1 nicm 1237: is the command to execute.
1238: If
1.153 nicm 1239: .Ar shell-command
1240: is not specified, the value of the
1241: .Ic default-command
1242: option is used.
1243: .Pp
1244: When the shell command completes, the window closes.
1245: See the
1246: .Ic remain-on-exit
1247: option to change this behaviour.
1.1 nicm 1248: .Pp
1249: The
1250: .Ev TERM
1251: environment variable must be set to
1252: .Dq screen
1253: for all programs running
1254: .Em inside
1255: .Nm .
1256: New windows will automatically have
1257: .Dq TERM=screen
1258: added to their environment, but care must be taken not to reset this in shell
1259: start-up files.
1.201 nicm 1260: .Pp
1261: The
1262: .Fl P
1263: option prints the location of the new window after it has been created.
1.56 jmc 1264: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 1265: .D1 (alias: Ic nextl )
1266: Move a window to the next layout and rearrange the panes to fit.
1267: .It Xo Ic next-window
1.9 nicm 1268: .Op Fl a
1.1 nicm 1269: .Op Fl t Ar target-session
1270: .Xc
1271: .D1 (alias: Ic next )
1272: Move to the next window in the session.
1.9 nicm 1273: If
1.12 jmc 1274: .Fl a
1.9 nicm 1275: is used, move to the next window with a bell, activity or content alert.
1.107 nicm 1276: .It Xo Ic pipe-pane
1277: .Op Fl o
1278: .Op Fl t Ar target-pane
1.153 nicm 1279: .Op Ar shell-command
1.107 nicm 1280: .Xc
1281: .D1 (alias: Ic pipep )
1282: Pipe any output sent by the program in
1283: .Ar target-pane
1284: to a shell command.
1285: A pane may only be piped to one command at a time, any existing pipe is
1286: closed before
1.153 nicm 1287: .Ar shell-command
1.107 nicm 1288: is executed.
1.174 nicm 1289: The
1290: .Ar shell-command
1291: string may contain the special character sequences supported by the
1292: .Ic status-left
1.231 nicm 1293: option.
1.107 nicm 1294: If no
1.153 nicm 1295: .Ar shell-command
1.107 nicm 1296: is given, the current pipe (if any) is closed.
1297: .Pp
1298: The
1299: .Fl o
1300: option only opens a new pipe if no previous pipe exists, allowing a pipe to
1301: be toggled with a single key, for example:
1302: .Bd -literal -offset indent
1.174 nicm 1303: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
1.107 nicm 1304: .Ed
1.176 nicm 1305: .It Xo Ic previous-layout
1306: .Op Fl t Ar target-window
1307: .Xc
1308: .D1 (alias: Ic prevl )
1309: Move to the previous layout in the session.
1.1 nicm 1310: .It Xo Ic previous-window
1.9 nicm 1311: .Op Fl a
1.1 nicm 1312: .Op Fl t Ar target-session
1313: .Xc
1314: .D1 (alias: Ic prev )
1315: Move to the previous window in the session.
1.9 nicm 1316: With
1317: .Fl a ,
1318: move to the previous window with a bell, activity or content alert.
1.1 nicm 1319: .It Xo Ic rename-window
1320: .Op Fl t Ar target-window
1321: .Ar new-name
1322: .Xc
1323: .D1 (alias: Ic renamew )
1324: Rename the current window, or the window at
1325: .Ar target-window
1326: if specified, to
1327: .Ar new-name .
1328: .It Xo Ic resize-pane
1.39 jmc 1329: .Op Fl DLRU
1.52 nicm 1330: .Op Fl t Ar target-pane
1.1 nicm 1331: .Op Ar adjustment
1332: .Xc
1333: .D1 (alias: Ic resizep )
1.57 jmc 1334: Resize a pane, upward with
1335: .Fl U
1336: (the default), downward with
1337: .Fl D ,
1338: to the left with
1339: .Fl L
1340: and to the right with
1341: .Fl R .
1342: The
1343: .Ar adjustment
1344: is given in lines or cells (the default is 1).
1.234 nicm 1345: .It Xo Ic respawn-pane
1346: .Op Fl k
1347: .Op Fl t Ar target-pane
1348: .Op Ar shell-command
1349: .Xc
1350: .D1 (alias: Ic respawnp )
1351: Reactivate a pane in which the command has exited (see the
1352: .Ic remain-on-exit
1353: window option).
1354: If
1355: .Ar shell-command
1356: is not given, the command used when the pane was created is executed.
1357: The pane must be already inactive, unless
1358: .Fl k
1359: is given, in which case any existing command is killed.
1.57 jmc 1360: .It Xo Ic respawn-window
1361: .Op Fl k
1362: .Op Fl t Ar target-window
1.153 nicm 1363: .Op Ar shell-command
1.57 jmc 1364: .Xc
1365: .D1 (alias: Ic respawnw )
1.153 nicm 1366: Reactivate a window in which the command has exited (see the
1.57 jmc 1367: .Ic remain-on-exit
1368: window option).
1369: If
1.153 nicm 1370: .Ar shell-command
1.57 jmc 1371: is not given, the command used when the window was created is executed.
1372: The window must be already inactive, unless
1373: .Fl k
1374: is given, in which case any existing command is killed.
1375: .It Xo Ic rotate-window
1376: .Op Fl DU
1377: .Op Fl t Ar target-window
1378: .Xc
1379: .D1 (alias: Ic rotatew )
1380: Rotate the positions of the panes within a window, either upward (numerically
1381: lower) with
1382: .Fl U
1383: or downward (numerically higher).
1384: .It Xo Ic select-layout
1.204 nicm 1385: .Op Fl np
1.57 jmc 1386: .Op Fl t Ar target-window
1387: .Op Ar layout-name
1388: .Xc
1.176 nicm 1389: .D1 (alias: Ic selectl )
1.57 jmc 1390: Choose a specific layout for a window.
1391: If
1392: .Ar layout-name
1.181 nicm 1393: is not given, the last preset layout used (if any) is reapplied.
1.204 nicm 1394: .Fl n
1395: and
1396: .Fl p
1397: are equivalent to the
1398: .Ic next-layout
1399: and
1400: .Ic previous-layout
1401: commands.
1.156 nicm 1402: .It Xo Ic select-pane
1.204 nicm 1403: .Op Fl lDLRU
1.156 nicm 1404: .Op Fl t Ar target-pane
1405: .Xc
1.57 jmc 1406: .D1 (alias: Ic selectp )
1407: Make pane
1408: .Ar target-pane
1409: the active pane in window
1410: .Ar target-window .
1.156 nicm 1411: If one of
1412: .Fl D ,
1413: .Fl L ,
1414: .Fl R ,
1415: or
1416: .Fl U
1417: is used, respectively the pane below, to the left, to the right, or above the
1418: target pane is used.
1.204 nicm 1419: .Fl l
1420: is the same as using the
1421: .Ic last-pane
1422: command.
1423: .It Xo Ic select-window
1424: .Op Fl lnp
1425: .Op Fl t Ar target-window
1426: .Xc
1.57 jmc 1427: .D1 (alias: Ic selectw )
1428: Select the window at
1429: .Ar target-window .
1.204 nicm 1430: .Fl l ,
1431: .Fl n
1432: and
1433: .Fl p
1434: are equivalent to the
1435: .Ic last-window ,
1436: .Ic next-window
1437: and
1438: .Ic previous-window
1439: commands.
1.57 jmc 1440: .It Xo Ic split-window
1.201 nicm 1441: .Op Fl dhvP
1.57 jmc 1442: .Oo Fl l
1443: .Ar size |
1444: .Fl p Ar percentage Oc
1.136 nicm 1445: .Op Fl t Ar target-pane
1.153 nicm 1446: .Op Ar shell-command
1.57 jmc 1447: .Xc
1.176 nicm 1448: .D1 (alias: Ic splitw )
1.136 nicm 1449: Create a new pane by splitting
1450: .Ar target-pane :
1.57 jmc 1451: .Fl h
1452: does a horizontal split and
1453: .Fl v
1454: a vertical split; if neither is specified,
1455: .Fl v
1456: is assumed.
1457: The
1458: .Fl l
1459: and
1460: .Fl p
1.136 nicm 1461: options specify the size of the new pane in lines (for vertical split) or in
1.57 jmc 1462: cells (for horizontal split), or as a percentage, respectively.
1.136 nicm 1463: All other options have the same meaning as for the
1.57 jmc 1464: .Ic new-window
1465: command.
1466: .It Xo Ic swap-pane
1467: .Op Fl dDU
1468: .Op Fl s Ar src-pane
1469: .Op Fl t Ar dst-pane
1470: .Xc
1471: .D1 (alias: Ic swapp )
1472: Swap two panes.
1473: If
1474: .Fl U
1475: is used and no source pane is specified with
1476: .Fl s ,
1477: .Ar dst-pane
1478: is swapped with the previous pane (before it numerically);
1479: .Fl D
1480: swaps with the next pane (after it numerically).
1.138 nicm 1481: .Fl d
1482: instructs
1483: .Nm
1484: not to change the active pane.
1.57 jmc 1485: .It Xo Ic swap-window
1486: .Op Fl d
1487: .Op Fl s Ar src-window
1488: .Op Fl t Ar dst-window
1489: .Xc
1490: .D1 (alias: Ic swapw )
1491: This is similar to
1492: .Ic link-window ,
1493: except the source and destination windows are swapped.
1494: It is an error if no window exists at
1495: .Ar src-window .
1496: .It Xo Ic unlink-window
1.1 nicm 1497: .Op Fl k
1498: .Op Fl t Ar target-window
1499: .Xc
1.57 jmc 1500: .D1 (alias: Ic unlinkw )
1501: Unlink
1502: .Ar target-window .
1503: Unless
1504: .Fl k
1505: is given, a window may be unlinked only if it is linked to multiple sessions -
1506: windows may not be linked to no sessions;
1507: if
1.1 nicm 1508: .Fl k
1.57 jmc 1509: is specified and the window is linked to only one session, it is unlinked and
1510: destroyed.
1511: .El
1512: .Sh KEY BINDINGS
1.93 nicm 1513: .Nm
1514: allows a command to be bound to most keys, with or without a prefix key.
1515: When specifying keys, most represent themselves (for example
1516: .Ql A
1517: to
1.95 jmc 1518: .Ql Z ) .
1.93 nicm 1519: Ctrl keys may be prefixed with
1520: .Ql C-
1521: or
1.95 jmc 1522: .Ql ^ ,
1523: and Alt (meta) with
1.93 nicm 1524: .Ql M- .
1525: In addition, the following special key names are accepted:
1.126 nicm 1526: .Em Up ,
1527: .Em Down ,
1528: .Em Left ,
1529: .Em Right ,
1.93 nicm 1530: .Em BSpace ,
1531: .Em BTab ,
1532: .Em DC
1533: (Delete),
1534: .Em End ,
1535: .Em Enter ,
1536: .Em Escape ,
1537: .Em F1
1538: to
1539: .Em F20 ,
1540: .Em Home ,
1541: .Em IC
1542: (Insert),
1543: .Em NPage
1544: (Page Up),
1545: .Em PPage
1546: (Page Down),
1547: .Em Space ,
1548: and
1549: .Em Tab .
1550: Note that to bind the
1551: .Ql \&"
1552: or
1553: .Ql '
1554: keys, quotation marks are necessary, for example:
1555: .Bd -literal -offset indent
1556: bind-key '"' split-window
1.167 nicm 1557: bind-key "'" new-window
1.93 nicm 1558: .Ed
1559: .Pp
1.57 jmc 1560: Commands related to key bindings are as follows:
1561: .Bl -tag -width Ds
1562: .It Xo Ic bind-key
1563: .Op Fl cnr
1564: .Op Fl t Ar key-table
1565: .Ar key Ar command Op Ar arguments
1.1 nicm 1566: .Xc
1.57 jmc 1567: .D1 (alias: Ic bind )
1568: Bind key
1569: .Ar key
1570: to
1571: .Ar command .
1572: By default (without
1573: .Fl t )
1574: the primary key bindings are modified (those normally activated with the prefix
1575: key); in this case, if
1576: .Fl n
1577: is specified, it is not necessary to use the prefix key,
1578: .Ar command
1579: is bound to
1580: .Ar key
1581: alone.
1.1 nicm 1582: The
1.57 jmc 1583: .Fl r
1584: flag indicates this key may repeat, see the
1585: .Ic repeat-time
1586: option.
1587: .Pp
1588: If
1589: .Fl t
1590: is present,
1591: .Ar key
1592: is bound in
1593: .Ar key-table :
1594: the binding for command mode with
1595: .Fl c
1596: or for normal mode without.
1597: To view the default bindings and possible commands, see the
1598: .Ic list-keys
1599: command.
1600: .It Ic list-keys Op Fl t Ar key-table
1601: .D1 (alias: Ic lsk )
1602: List all key bindings.
1603: Without
1604: .Fl t
1605: the primary key bindings - those executed when preceded by the prefix key -
1606: are printed.
1607: Keys bound without the prefix key (see
1608: .Ic bind-key
1609: .Fl n )
1.119 nicm 1610: are marked with
1611: .Ql (no prefix) .
1.57 jmc 1612: .Pp
1613: With
1614: .Fl t ,
1615: the key bindings in
1616: .Ar key-table
1617: are listed; this may be one of:
1618: .Em vi-edit ,
1619: .Em emacs-edit ,
1620: .Em vi-choice ,
1621: .Em emacs-choice ,
1622: .Em vi-copy
1623: or
1624: .Em emacs-copy .
1625: .It Xo Ic send-keys
1.72 nicm 1626: .Op Fl t Ar target-pane
1.57 jmc 1627: .Ar key Ar ...
1.1 nicm 1628: .Xc
1.57 jmc 1629: .D1 (alias: Ic send )
1630: Send a key or keys to a window.
1631: Each argument
1632: .Ar key
1633: is the name of the key (such as
1634: .Ql C-a
1635: or
1636: .Ql npage
1637: ) to send; if the string is not recognised as a key, it is sent as a series of
1638: characters.
1639: All arguments are sent sequentially from first to last.
1.72 nicm 1640: .It Ic send-prefix Op Fl t Ar target-pane
1.57 jmc 1641: Send the prefix key to a window as if it was pressed.
1.89 nicm 1642: If multiple prefix keys are configured, only the first is sent.
1.57 jmc 1643: .It Xo Ic unbind-key
1.189 nicm 1644: .Op Fl acn
1.57 jmc 1645: .Op Fl t Ar key-table
1646: .Ar key
1.2 nicm 1647: .Xc
1.57 jmc 1648: .D1 (alias: Ic unbind )
1649: Unbind the command bound to
1650: .Ar key .
1651: Without
1652: .Fl t
1653: the primary key bindings are modified; in this case, if
1654: .Fl n
1655: is specified, the command bound to
1656: .Ar key
1657: without a prefix (if any) is removed.
1.189 nicm 1658: If
1659: .Fl a
1660: is present, all key bindings are removed.
1.57 jmc 1661: .Pp
1.47 nicm 1662: If
1.57 jmc 1663: .Fl t
1664: is present,
1665: .Ar key
1666: in
1667: .Ar key-table
1668: is unbound: the binding for command mode with
1669: .Fl c
1670: or for normal mode without.
1671: .El
1672: .Sh OPTIONS
1673: The appearance and behaviour of
1674: .Nm
1675: may be modified by changing the value of various options.
1.133 nicm 1676: There are three types of option:
1677: .Em server options ,
1.57 jmc 1678: .Em session options
1679: and
1680: .Em window options .
1681: .Pp
1.133 nicm 1682: The
1683: .Nm
1684: server has a set of global options which do not apply to any particular
1685: window or session.
1686: These are altered with the
1687: .Ic set-option
1688: .Fl s
1689: command, or displayed with the
1690: .Ic show-options
1691: .Fl s
1692: command.
1693: .Pp
1694: In addition, each individual session may have a set of session options, and
1695: there is a separate set of global session options.
1.57 jmc 1696: Sessions which do not have a particular option configured inherit the value
1697: from the global session options.
1698: Session options are set or unset with the
1699: .Ic set-option
1700: command and may be listed with the
1701: .Ic show-options
1702: command.
1.133 nicm 1703: The available server and session options are listed under the
1.57 jmc 1704: .Ic set-option
1705: command.
1706: .Pp
1707: Similarly, a set of window options is attached to each window, and there is
1708: a set of global window options from which any unset options are inherited.
1709: Window options are altered with the
1710: .Ic set-window-option
1711: command and can be listed with the
1712: .Ic show-window-options
1713: command.
1714: All window options are documented with the
1715: .Ic set-window-option
1716: command.
1717: .Pp
1718: Commands which set options are as follows:
1719: .Bl -tag -width Ds
1.1 nicm 1720: .It Xo Ic set-option
1.133 nicm 1721: .Op Fl agsuw
1.129 nicm 1722: .Op Fl t Ar target-session | Ar target-window
1.1 nicm 1723: .Ar option Ar value
1724: .Xc
1725: .D1 (alias: Ic set )
1.133 nicm 1726: Set a window option with
1727: .Fl w
1728: (equivalent to the
1729: .Ic set-window-option
1730: command),
1731: a server option with
1732: .Fl s ,
1733: otherwise a session option.
1734: .Pp
1735: If
1736: .Fl g
1737: is specified, the global session or window option is set.
1.58 nicm 1738: With
1739: .Fl a ,
1740: and if the option expects a string,
1741: .Ar value
1742: is appended to the existing setting.
1.1 nicm 1743: The
1744: .Fl u
1745: flag unsets an option, so a session inherits the option from the global
1.133 nicm 1746: options.
1747: It is not possible to unset a global option.
1.1 nicm 1748: .Pp
1.133 nicm 1749: Available window options are listed under
1750: .Ic set-window-option .
1751: .Pp
1752: Available server options are:
1753: .Bl -tag -width Ds
1.198 nicm 1754: .It Ic buffer-limit Ar number
1755: Set the number of buffers; as new buffers are added to the top of the stack,
1756: old ones are removed from the bottom if necessary to maintain this maximum
1757: length.
1.239 nicm 1758: .It Ic escape-time Ar time
1759: Set the time in milliseconds for which
1760: .Nm
1761: waits after an escape is input to determine if it is part of a function or meta
1762: key sequences.
1763: The default is 500 milliseconds.
1764: .It Xo Ic exit-unattached
1765: .Op Ic on | off
1766: .Xc
1767: If enabled, the server will exit when there are no attached clients.
1768: .It Xo Ic quiet
1769: .Op Ic on | off
1770: .Xc
1771: Enable or disable the display of various informational messages (see also the
1772: .Fl q
1773: command line flag).
1.228 nicm 1774: .It Xo Ic set-clipboard
1775: .Op Ic on | off
1776: .Xc
1777: Attempt to set the terminal clipboard content using the
1778: \ee]52;...\e007
1779: .Xr xterm 1
1780: escape sequences.
1781: This option is on by default if there is an
1782: .Em \&Ms
1783: entry in the
1784: .Xr terminfo 5
1785: description for the client terminal.
1786: Note that this feature needs to be enabled in
1787: .Xr xterm 1
1788: by setting the resource:
1789: .Bd -literal -offset indent
1790: disallowedWindowOps: 20,21,SetXprop
1791: .Ed
1792: .Pp
1793: Or changing this property from the
1794: .Xr xterm 1
1795: interactive menu when required.
1.133 nicm 1796: .El
1.129 nicm 1797: .Pp
1.18 nicm 1798: Available session options are:
1.1 nicm 1799: .Bl -tag -width Ds
1.69 nicm 1800: .It Ic base-index Ar index
1801: Set the base index from which an unused index should be searched when a new
1802: window is created.
1803: The default is zero.
1.1 nicm 1804: .It Xo Ic bell-action
1.56 jmc 1805: .Op Ic any | none | current
1.1 nicm 1806: .Xc
1807: Set action on window bell.
1808: .Ic any
1809: means a bell in any window linked to a session causes a bell in the current
1810: window of that session,
1811: .Ic none
1812: means all bells are ignored and
1813: .Ic current
1814: means only bell in windows other than the current window are ignored.
1.237 nicm 1815: .It Xo Ic bell-on-alert
1816: .Op Ic on | off
1817: .Xc
1818: If on, ring the terminal bell when an activity, content or silence alert
1819: occurs.
1.153 nicm 1820: .It Ic default-command Ar shell-command
1.1 nicm 1821: Set the command used for new windows (if not specified when the window is
1822: created) to
1.153 nicm 1823: .Ar shell-command ,
1.79 nicm 1824: which may be any
1825: .Xr sh 1
1826: command.
1.19 nicm 1827: The default is an empty string, which instructs
1828: .Nm
1.79 nicm 1829: to create a login shell using the value of the
1830: .Ic default-shell
1831: option.
1.196 nicm 1832: .It Ic default-path Ar path
1833: Set the default working directory for processes created from keys, or
1834: interactively from the prompt.
1835: The default is empty, which means to use the working directory of the shell
1836: from which the server was started if it is available or the user's home if not.
1.79 nicm 1837: .It Ic default-shell Ar path
1838: Specify the default shell.
1839: This is used as the login shell for new windows when the
1840: .Ic default-command
1841: option is set to empty, and must be the full path of the executable.
1842: When started
1843: .Nm
1844: tries to set a default value from the first suitable of the
1.19 nicm 1845: .Ev SHELL
1.79 nicm 1846: environment variable, the shell returned by
1847: .Xr getpwuid 3 ,
1848: or
1849: .Pa /bin/sh .
1850: This option should be configured when
1851: .Nm
1852: is used as a login shell.
1.22 nicm 1853: .It Ic default-terminal Ar terminal
1854: Set the default terminal for new windows created in this session - the
1855: default value of the
1856: .Ev TERM
1857: environment variable.
1858: For
1859: .Nm
1860: to work correctly, this
1861: .Em must
1862: be set to
1863: .Ql screen
1864: or a derivative of it.
1.206 nicm 1865: .It Xo Ic destroy-unattached
1866: .Op Ic on | off
1867: .Xc
1.185 nicm 1868: If enabled and the session is no longer attached to any clients, it is
1869: destroyed.
1.206 nicm 1870: .It Xo Ic detach-on-destroy
1871: .Op Ic on | off
1872: .Xc
1.184 nicm 1873: If on (the default), the client is detached when the session it is attached to
1874: is destroyed.
1875: If off, the client is switched to the most recently active of the remaining
1876: sessions.
1.145 nicm 1877: .It Ic display-panes-active-colour Ar colour
1878: Set the colour used by the
1879: .Ic display-panes
1880: command to show the indicator for the active pane.
1.78 nicm 1881: .It Ic display-panes-colour Ar colour
1.145 nicm 1882: Set the colour used by the
1.78 nicm 1883: .Ic display-panes
1.145 nicm 1884: command to show the indicators for inactive panes.
1.78 nicm 1885: .It Ic display-panes-time Ar time
1886: Set the time in milliseconds for which the indicators shown by the
1887: .Ic display-panes
1888: command appear.
1.21 nicm 1889: .It Ic display-time Ar time
1.78 nicm 1890: Set the amount of time for which status line messages and other on-screen
1891: indicators are displayed.
1.21 nicm 1892: .Ar time
1893: is in milliseconds.
1.1 nicm 1894: .It Ic history-limit Ar lines
1895: Set the maximum number of lines held in window history.
1896: This setting applies only to new windows - existing window histories are not
1897: resized and retain the limit at the point they were created.
1898: .It Ic lock-after-time Ar number
1.100 nicm 1899: Lock the session (like the
1900: .Ic lock-session
1.90 nicm 1901: command) after
1.1 nicm 1902: .Ar number
1.100 nicm 1903: seconds of inactivity, or the entire server (all sessions) if the
1904: .Ic lock-server
1905: option is set.
1906: The default is not to lock (set to 0).
1.153 nicm 1907: .It Ic lock-command Ar shell-command
1.90 nicm 1908: Command to run when locking each client.
1909: The default is to run
1910: .Xr lock 1
1911: with
1912: .Fl np .
1.100 nicm 1913: .It Xo Ic lock-server
1914: .Op Ic on | off
1915: .Xc
1916: If this option is
1.102 nicm 1917: .Ic on
1.100 nicm 1918: (the default),
1919: instead of each session locking individually as each has been
1920: idle for
1.108 jmc 1921: .Ic lock-after-time ,
1922: the entire server will lock after
1.100 nicm 1923: .Em all
1924: sessions would have locked.
1925: This has no effect as a session option; it must be set as a global option.
1.1 nicm 1926: .It Ic message-attr Ar attributes
1927: Set status line message attributes, where
1928: .Ar attributes
1929: is either
1.168 nicm 1930: .Ic none
1.1 nicm 1931: or a comma-delimited list of one or more of:
1932: .Ic bright
1933: (or
1934: .Ic bold ) ,
1935: .Ic dim ,
1936: .Ic underscore ,
1937: .Ic blink ,
1938: .Ic reverse ,
1939: .Ic hidden ,
1940: or
1941: .Ic italics .
1942: .It Ic message-bg Ar colour
1943: Set status line message background colour, where
1944: .Ar colour
1945: is one of:
1946: .Ic black ,
1947: .Ic red ,
1948: .Ic green ,
1949: .Ic yellow ,
1950: .Ic blue ,
1951: .Ic magenta ,
1952: .Ic cyan ,
1.85 nicm 1953: .Ic white ,
1954: .Ic colour0
1955: to
1956: .Ic colour255
1.205 nicm 1957: from the 256-colour set,
1958: .Ic default ,
1959: or a hexadecimal RGB string such as
1960: .Ql #ffffff ,
1961: which chooses the closest match from the default 256-colour set.
1.1 nicm 1962: .It Ic message-fg Ar colour
1963: Set status line message foreground colour.
1.120 nicm 1964: .It Ic message-limit Ar number
1965: Set the number of error or information messages to save in the message log for
1966: each client.
1967: The default is 20.
1.226 nicm 1968: .It Xo Ic mouse-resize-pane
1969: .Op Ic on | off
1970: .Xc
1971: If on,
1972: .Nm
1973: captures the mouse and allows panes to be resized by dragging on their borders.
1.102 nicm 1974: .It Xo Ic mouse-select-pane
1975: .Op Ic on | off
1976: .Xc
1977: If on,
1978: .Nm
1979: captures the mouse and when a window is split into multiple panes the mouse may
1980: be used to select the current pane.
1981: The mouse click is also passed through to the application as normal.
1.222 nicm 1982: .It Xo Ic mouse-select-window
1983: .Op Ic on | off
1984: .Xc
1985: If on, clicking the mouse on a window name in the status line will select that
1986: window.
1.239 nicm 1987: .It Xo Ic mouse-utf8
1988: .Op Ic on | off
1989: .Xc
1990: If enabled, request mouse input as UTF-8 on UTF-8 terminals.
1.196 nicm 1991: .It Ic pane-active-border-bg Ar colour
1992: .It Ic pane-active-border-fg Ar colour
1993: Set the pane border colour for the currently active pane.
1994: .It Ic pane-border-bg Ar colour
1.135 nicm 1995: .It Ic pane-border-fg Ar colour
1996: Set the pane border colour for panes aside from the active pane.
1.89 nicm 1997: .It Ic prefix Ar keys
1998: Set the keys accepted as a prefix key.
1999: .Ar keys
2000: is a comma-separated list of key names, each of which individually behave as
2001: the prefix key.
1.21 nicm 2002: .It Ic repeat-time Ar time
1.1 nicm 2003: Allow multiple commands to be entered without pressing the prefix-key again
2004: in the specified
1.21 nicm 2005: .Ar time
1.1 nicm 2006: milliseconds (the default is 500).
2007: Whether a key repeats may be set when it is bound using the
2008: .Fl r
2009: flag to
2010: .Ic bind-key .
1.52 nicm 2011: Repeat is enabled for the default keys bound to the
2012: .Ic resize-pane
2013: command.
1.1 nicm 2014: .It Xo Ic set-remain-on-exit
1.56 jmc 2015: .Op Ic on | off
1.1 nicm 2016: .Xc
2017: Set the
2018: .Ic remain-on-exit
2019: window option for any windows first created in this session.
1.153 nicm 2020: When this option is true, windows in which the running program has
2021: exited do not close, instead remaining open but inactivate.
2022: Use the
2023: .Ic respawn-window
2024: command to reactivate such a window, or the
2025: .Ic kill-window
2026: command to destroy it.
1.1 nicm 2027: .It Xo Ic set-titles
1.56 jmc 2028: .Op Ic on | off
1.1 nicm 2029: .Xc
1.77 stsp 2030: Attempt to set the window title using the \ee]2;...\e007 xterm code if
1.1 nicm 2031: the terminal appears to be an xterm.
1.11 nicm 2032: This option is off by default.
1.6 jmc 2033: Note that elinks
1.1 nicm 2034: will only attempt to set the window title if the STY environment
2035: variable is set.
1.86 nicm 2036: .It Ic set-titles-string Ar string
2037: String used to set the window title if
2038: .Ic set-titles
2039: is on.
2040: Character sequences are replaced as for the
2041: .Ic status-left
2042: option.
1.1 nicm 2043: .It Xo Ic status
1.56 jmc 2044: .Op Ic on | off
1.1 nicm 2045: .Xc
2046: Show or hide the status line.
2047: .It Ic status-attr Ar attributes
2048: Set status line attributes.
2049: .It Ic status-bg Ar colour
2050: Set status line background colour.
2051: .It Ic status-fg Ar colour
2052: Set status line foreground colour.
2053: .It Ic status-interval Ar interval
2054: Update the status bar every
2055: .Ar interval
2056: seconds.
2057: By default, updates will occur every 15 seconds.
2058: A setting of zero disables redrawing at interval.
1.41 nicm 2059: .It Xo Ic status-justify
1.56 jmc 2060: .Op Ic left | centre | right
1.41 nicm 2061: .Xc
2062: Set the position of the window list component of the status line: left, centre
2063: or right justified.
1.1 nicm 2064: .It Xo Ic status-keys
1.56 jmc 2065: .Op Ic vi | emacs
1.1 nicm 2066: .Xc
1.6 jmc 2067: Use vi or emacs-style
1.1 nicm 2068: key bindings in the status line, for example at the command prompt.
1.191 nicm 2069: The default is emacs, unless the
2070: .Ev VISUAL
2071: or
2072: .Ev EDITOR
2073: environment variables are set and contain the string
2074: .Ql vi .
1.1 nicm 2075: .It Ic status-left Ar string
2076: Display
2077: .Ar string
2078: to the left of the status bar.
2079: .Ar string
2080: will be passed through
2081: .Xr strftime 3
2082: before being used.
2083: By default, the session name is shown.
2084: .Ar string
1.83 nicm 2085: may contain any of the following special character sequences:
1.1 nicm 2086: .Bl -column "Character pair" "Replaced with" -offset indent
2087: .It Sy "Character pair" Ta Sy "Replaced with"
1.153 nicm 2088: .It Li "#(shell-command)" Ta "First line of the command's output"
1.83 nicm 2089: .It Li "#[attributes]" Ta "Colour or attribute change"
1.1 nicm 2090: .It Li "#H" Ta "Hostname of local host"
1.224 nicm 2091: .It Li "#h" Ta "Hostname of local host without the domain name"
1.125 nicm 2092: .It Li "#F" Ta "Current window flag"
1.35 nicm 2093: .It Li "#I" Ta "Current window index"
2094: .It Li "#P" Ta "Current pane index"
1.1 nicm 2095: .It Li "#S" Ta "Session name"
2096: .It Li "#T" Ta "Current window title"
1.35 nicm 2097: .It Li "#W" Ta "Current window name"
1.1 nicm 2098: .It Li "##" Ta "A literal" Ql #
2099: .El
1.83 nicm 2100: .Pp
1.153 nicm 2101: The #(shell-command) form executes
2102: .Ql shell-command
2103: and inserts the first line of its output.
1.103 nicm 2104: Note that shell commands are only executed once at the interval specified by
2105: the
2106: .Ic status-interval
2107: option: if the status line is redrawn in the meantime, the previous result is
2108: used.
1.161 nicm 2109: Shell commands are executed with the
2110: .Nm
2111: global environment set (see the
1.162 jmc 2112: .Sx ENVIRONMENT
2113: section).
1.163 nicm 2114: .Pp
2115: The window title (#T) is the title set by the program running within the window
2116: using the OSC title setting sequence, for example:
2117: .Bd -literal -offset indent
2118: $ printf '\e033]2;My Title\e033\e\e'
2119: .Ed
2120: .Pp
2121: When a window is first created, its title is the hostname.
1.109 nicm 2122: .Pp
1.83 nicm 2123: #[attributes] allows a comma-separated list of attributes to be specified,
2124: these may be
2125: .Ql fg=colour
2126: to set the foreground colour,
2127: .Ql bg=colour
1.131 nicm 2128: to set the background colour, the name of one of the attributes (listed under
2129: the
1.83 nicm 2130: .Ic message-attr
1.109 nicm 2131: option) to turn an attribute on, or an attribute prefixed with
2132: .Ql no
2133: to turn one off, for example
2134: .Ic nobright .
1.83 nicm 2135: Examples are:
2136: .Bd -literal -offset indent
2137: #(sysctl vm.loadavg)
2138: #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
2139: .Ed
1.1 nicm 2140: .Pp
1.109 nicm 2141: Where appropriate, special character sequences may be prefixed with a number to
2142: specify the maximum length, for example
1.1 nicm 2143: .Ql #24T .
1.10 nicm 2144: .Pp
1.12 jmc 2145: By default, UTF-8 in
1.10 nicm 2146: .Ar string
2147: is not interpreted, to enable UTF-8, use the
2148: .Ic status-utf8
2149: option.
1.62 nicm 2150: .It Ic status-left-attr Ar attributes
1.66 jmc 2151: Set the attribute of the left part of the status line.
1.196 nicm 2152: .It Ic status-left-bg Ar colour
2153: Set the background colour of the left part of the status line.
1.62 nicm 2154: .It Ic status-left-fg Ar colour
2155: Set the foreground colour of the left part of the status line.
1.1 nicm 2156: .It Ic status-left-length Ar length
2157: Set the maximum
2158: .Ar length
2159: of the left component of the status bar.
2160: The default is 10.
2161: .It Ic status-right Ar string
2162: Display
2163: .Ar string
2164: to the right of the status bar.
1.151 nicm 2165: By default, the current window title in double quotes, the date and the time
2166: are shown.
1.1 nicm 2167: As with
2168: .Ic status-left ,
2169: .Ar string
2170: will be passed to
1.10 nicm 2171: .Xr strftime 3 ,
2172: character pairs are replaced, and UTF-8 is dependent on the
2173: .Ic status-utf8
2174: option.
1.62 nicm 2175: .It Ic status-right-attr Ar attributes
1.66 jmc 2176: Set the attribute of the right part of the status line.
1.196 nicm 2177: .It Ic status-right-bg Ar colour
2178: Set the background colour of the right part of the status line.
1.62 nicm 2179: .It Ic status-right-fg Ar colour
2180: Set the foreground colour of the right part of the status line.
1.1 nicm 2181: .It Ic status-right-length Ar length
2182: Set the maximum
2183: .Ar length
2184: of the right component of the status bar.
2185: The default is 40.
1.10 nicm 2186: .It Xo Ic status-utf8
1.56 jmc 2187: .Op Ic on | off
1.10 nicm 2188: .Xc
2189: Instruct
2190: .Nm
2191: to treat top-bit-set characters in the
2192: .Ic status-left
2193: and
2194: .Ic status-right
2195: strings as UTF-8; notably, this is important for wide characters.
2196: This option defaults to off.
1.55 jmc 2197: .It Ic terminal-overrides Ar string
1.54 nicm 2198: Contains a list of entries which override terminal descriptions read using
2199: .Xr terminfo 5 .
2200: .Ar string
2201: is a comma-separated list of items each a colon-separated string made up of a
2202: terminal type pattern (matched using
2203: .Xr fnmatch 3 )
2204: and a set of
2205: .Em name=value
2206: entries.
2207: .Pp
2208: For example, to set the
2209: .Ql clear
2210: .Xr terminfo 5
2211: entry to
2212: .Ql \ee[H\ee[2J
2213: for all terminal types and the
2214: .Ql dch1
2215: entry to
2216: .Ql \ee[P
1.55 jmc 2217: for the
1.54 nicm 2218: .Ql rxvt
2219: terminal type, the option could be set to the string:
2220: .Bd -literal -offset indent
2221: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
2222: .Ed
2223: .Pp
2224: The terminal entry value is passed through
2225: .Xr strunvis 3
2226: before interpretation.
2227: The default value forcibly corrects the
2228: .Ql colors
2229: entry for terminals which support 88 or 256 colours:
2230: .Bd -literal -offset indent
1.225 nicm 2231: "*88col*:colors=88,*256col*:colors=256,xterm*:XT"
1.54 nicm 2232: .Ed
1.63 nicm 2233: .It Ic update-environment Ar variables
2234: Set a space-separated string containing a list of environment variables to be
2235: copied into the session environment when a new session is created or an
2236: existing session is attached.
2237: Any variables that do not exist in the source environment are set to be
2238: removed from the session environment (as if
2239: .Fl r
2240: was given to the
2241: .Ic set-environment
2242: command).
2243: The default is
1.190 nicm 2244: "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID
2245: XAUTHORITY".
1.37 nicm 2246: .It Xo Ic visual-activity
1.56 jmc 2247: .Op Ic on | off
1.37 nicm 2248: .Xc
2249: If on, display a status line message when activity occurs in a window
1.39 jmc 2250: for which the
1.37 nicm 2251: .Ic monitor-activity
2252: window option is enabled.
2253: .It Xo Ic visual-bell
1.56 jmc 2254: .Op Ic on | off
1.37 nicm 2255: .Xc
2256: If this option is on, a message is shown on a bell instead of it being passed
2257: through to the terminal (which normally makes a sound).
2258: Also see the
2259: .Ic bell-action
2260: option.
2261: .It Xo Ic visual-content
1.56 jmc 2262: .Op Ic on | off
1.37 nicm 2263: .Xc
2264: Like
2265: .Ic visual-activity ,
2266: display a message when content is present in a window
1.39 jmc 2267: for which the
1.37 nicm 2268: .Ic monitor-content
2269: window option is enabled.
1.192 nicm 2270: .It Xo Ic visual-silence
2271: .Op Ic on | off
2272: .Xc
2273: If
2274: .Ic monitor-silence
2275: is enabled, prints a message after the interval has expired on a given window.
1.1 nicm 2276: .El
2277: .It Xo Ic set-window-option
1.58 nicm 2278: .Op Fl agu
1.1 nicm 2279: .Op Fl t Ar target-window
2280: .Ar option Ar value
2281: .Xc
2282: .D1 (alias: Ic setw )
1.18 nicm 2283: Set a window option.
1.1 nicm 2284: The
1.58 nicm 2285: .Fl a ,
1.1 nicm 2286: .Fl g
2287: and
2288: .Fl u
2289: flags work similarly to the
2290: .Ic set-option
2291: command.
2292: .Pp
1.18 nicm 2293: Supported window options are:
1.56 jmc 2294: .Pp
2295: .Bl -tag -width Ds -compact
1.1 nicm 2296: .It Xo Ic aggressive-resize
1.56 jmc 2297: .Op Ic on | off
1.1 nicm 2298: .Xc
2299: Aggressively resize the chosen window.
2300: This means that
2301: .Nm
2302: will resize the window to the size of the smallest session for which it is the
2303: current window, rather than the smallest session to which it is attached.
2304: The window may resize when the current window is changed on another sessions;
1.6 jmc 2305: this option is good for full-screen programs which support
2306: .Dv SIGWINCH
2307: and poor for interactive programs such as shells.
1.56 jmc 2308: .Pp
1.196 nicm 2309: .It Xo Ic alternate-screen
2310: .Op Ic on | off
2311: .Xc
2312: This option configures whether programs running inside
2313: .Nm
2314: may use the terminal alternate screen feature, which allows the
2315: .Em smcup
2316: and
2317: .Em rmcup
2318: .Xr terminfo 5
1.209 nicm 2319: capabilities.
2320: The alternate screen feature preserves the contents of the window when an
2321: interactive application starts and restores it on exit, so that any output
2322: visible before the application starts reappears unchanged after it exits.
2323: The default is on.
1.196 nicm 2324: .Pp
1.1 nicm 2325: .It Xo Ic automatic-rename
1.56 jmc 2326: .Op Ic on | off
1.1 nicm 2327: .Xc
2328: Control automatic window renaming.
2329: When this setting is enabled,
2330: .Nm
2331: will attempt - on supported platforms - to rename the window to reflect the
2332: command currently running in it.
2333: This flag is automatically disabled for an individual window when a name
2334: is specified at creation with
1.186 nicm 2335: .Ic new-window
2336: or
1.1 nicm 2337: .Ic new-session ,
2338: or later with
2339: .Ic rename-window .
2340: It may be switched off globally with:
2341: .Bd -literal -offset indent
2342: set-window-option -g automatic-rename off
2343: .Ed
1.56 jmc 2344: .Pp
1.1 nicm 2345: .It Ic clock-mode-colour Ar colour
2346: Set clock colour.
1.56 jmc 2347: .Pp
1.1 nicm 2348: .It Xo Ic clock-mode-style
1.56 jmc 2349: .Op Ic 12 | 24
1.1 nicm 2350: .Xc
2351: Set clock hour format.
1.56 jmc 2352: .Pp
1.1 nicm 2353: .It Ic force-height Ar height
2354: .It Ic force-width Ar width
2355: Prevent
2356: .Nm
2357: from resizing a window to greater than
2358: .Ar width
2359: or
2360: .Ar height .
2361: A value of zero restores the default unlimited setting.
1.56 jmc 2362: .Pp
1.196 nicm 2363: .It Ic main-pane-height Ar height
1.2 nicm 2364: .It Ic main-pane-width Ar width
2365: Set the width or height of the main (left or top) pane in the
2366: .Ic main-horizontal
2367: or
2368: .Ic main-vertical
2369: layouts.
1.56 jmc 2370: .Pp
1.1 nicm 2371: .It Ic mode-attr Ar attributes
2372: Set window modes attributes.
1.56 jmc 2373: .Pp
1.1 nicm 2374: .It Ic mode-bg Ar colour
2375: Set window modes background colour.
1.56 jmc 2376: .Pp
1.1 nicm 2377: .It Ic mode-fg Ar colour
2378: Set window modes foreground colour.
1.56 jmc 2379: .Pp
1.1 nicm 2380: .It Xo Ic mode-keys
1.56 jmc 2381: .Op Ic vi | emacs
1.1 nicm 2382: .Xc
1.105 nicm 2383: Use vi or emacs-style key bindings in copy and choice modes.
1.191 nicm 2384: As with the
2385: .Ic status-keys
2386: option, the default is emacs, unless
2387: .Ev VISUAL
2388: or
2389: .Ev EDITOR
2390: contains
2391: .Ql vi .
1.56 jmc 2392: .Pp
1.50 nicm 2393: .It Xo Ic mode-mouse
1.240 nicm 2394: .Op Ic on | off | copy-mode
1.50 nicm 2395: .Xc
1.51 jmc 2396: Mouse state in modes.
1.223 nicm 2397: If on, the mouse may be used to enter copy mode and copy a selection by
2398: dragging, to enter copy mode and scroll with the mouse wheel, or to select an
2399: option in choice mode.
1.240 nicm 2400: If set to
1.241 jmc 2401: .Em copy-mode ,
1.240 nicm 2402: the mouse behaves as set to on, but cannot be used to enter copy
2403: mode.
1.56 jmc 2404: .Pp
1.1 nicm 2405: .It Xo Ic monitor-activity
1.56 jmc 2406: .Op Ic on | off
1.1 nicm 2407: .Xc
2408: Monitor for activity in the window.
2409: Windows with activity are highlighted in the status line.
1.56 jmc 2410: .Pp
2411: .It Ic monitor-content Ar match-string
1.6 jmc 2412: Monitor content in the window.
2413: When
1.16 nicm 2414: .Xr fnmatch 3
2415: pattern
1.1 nicm 2416: .Ar match-string
2417: appears in the window, it is highlighted in the status line.
1.56 jmc 2418: .Pp
1.192 nicm 2419: .It Xo Ic monitor-silence
2420: .Op Ic interval
2421: .Xc
2422: Monitor for silence (no activity) in the window within
2423: .Ic interval
2424: seconds.
2425: Windows that have been silent for the interval are highlighted in the
2426: status line.
2427: An interval of zero disables the monitoring.
1.195 nicm 2428: .Pp
2429: .It Ic other-pane-height Ar height
2430: Set the height of the other panes (not the main pane) in the
2431: .Ic main-horizontal
2432: layout.
2433: If this option is set to 0 (the default), it will have no effect.
2434: If both the
2435: .Ic main-pane-height
2436: and
2437: .Ic other-pane-height
2438: options are set, the main pane will grow taller to make the other panes the
2439: specified height, but will never shrink to do so.
2440: .Pp
2441: .It Ic other-pane-width Ar width
2442: Like
2443: .Ic other-pane-height ,
2444: but set the width of other panes in the
2445: .Ic main-vertical
2446: layout.
1.243 nicm 2447: .Pp
2448: .It Ic pane-base-index Ar index
2449: Like
2450: .Ic base-index ,
2451: but set the starting index for pane numbers.
1.192 nicm 2452: .Pp
1.1 nicm 2453: .It Xo Ic remain-on-exit
1.56 jmc 2454: .Op Ic on | off
1.1 nicm 2455: .Xc
2456: A window with this flag set is not destroyed when the program running in it
2457: exits.
2458: The window may be reactivated with the
2459: .Ic respawn-window
2460: command.
1.56 jmc 2461: .Pp
1.99 nicm 2462: .It Xo Ic synchronize-panes
2463: .Op Ic on | off
2464: .Xc
1.164 nicm 2465: Duplicate input to any pane to all other panes in the same window (only
2466: for panes that are not in any special mode).
1.139 nicm 2467: .Pp
1.1 nicm 2468: .It Xo Ic utf8
1.56 jmc 2469: .Op Ic on | off
1.1 nicm 2470: .Xc
2471: Instructs
2472: .Nm
2473: to expect UTF-8 sequences to appear in this window.
1.56 jmc 2474: .Pp
1.169 nicm 2475: .It Ic window-status-alert-attr Ar attributes
2476: Set status line attributes for windows which have an alert (bell, activity
2477: or content).
2478: .Pp
2479: .It Ic window-status-alert-bg Ar colour
2480: Set status line background colour for windows with an alert.
2481: .Pp
2482: .It Ic window-status-alert-fg Ar colour
2483: Set status line foreground colour for windows with an alert.
1.125 nicm 2484: .Pp
1.239 nicm 2485: .It Ic window-status-attr Ar attributes
2486: Set status line attributes for a single window.
2487: .Pp
2488: .It Ic window-status-bg Ar colour
2489: Set status line background colour for a single window.
2490: .Pp
1.40 nicm 2491: .It Ic window-status-current-attr Ar attributes
2492: Set status line attributes for the currently active window.
1.56 jmc 2493: .Pp
1.40 nicm 2494: .It Ic window-status-current-bg Ar colour
2495: Set status line background colour for the currently active window.
1.56 jmc 2496: .Pp
1.40 nicm 2497: .It Ic window-status-current-fg Ar colour
2498: Set status line foreground colour for the currently active window.
1.56 jmc 2499: .Pp
1.125 nicm 2500: .It Ic window-status-current-format Ar string
2501: Like
2502: .Ar window-status-format ,
2503: but is the format used when the window is the current window.
1.239 nicm 2504: .Pp
2505: .It Ic window-status-fg Ar colour
2506: Set status line foreground colour for a single window.
2507: .Pp
2508: .It Ic window-status-format Ar string
2509: Set the format in which the window is displayed in the status line window list.
2510: See the
2511: .Ar status-left
2512: option for details of special character sequences available.
2513: The default is
2514: .Ql #I:#W#F .
1.154 nicm 2515: .Pp
2516: .It Ic word-separators Ar string
2517: Sets the window's conception of what characters are considered word
2518: separators, for the purposes of the next and previous word commands in
2519: copy mode.
2520: The default is
2521: .Ql \ -_@ .
1.125 nicm 2522: .Pp
1.1 nicm 2523: .It Xo Ic xterm-keys
1.56 jmc 2524: .Op Ic on | off
1.1 nicm 2525: .Xc
2526: If this option is set,
2527: .Nm
2528: will generate
1.57 jmc 2529: .Xr xterm 1 -style
2530: function key sequences; these have a number included to indicate modifiers such
2531: as Shift, Alt or Ctrl.
1.123 nicm 2532: The default is off.
1.57 jmc 2533: .El
2534: .It Xo Ic show-options
1.133 nicm 2535: .Op Fl gsw
1.129 nicm 2536: .Op Fl t Ar target-session | Ar target-window
1.57 jmc 2537: .Xc
2538: .D1 (alias: Ic show )
1.133 nicm 2539: Show the window options with
1.129 nicm 2540: .Fl w
1.133 nicm 2541: (equivalent to
1.134 nicm 2542: .Ic show-window-options ) ,
1.133 nicm 2543: the server options with
2544: .Fl s ,
2545: otherwise the session options for
2546: .Ar target session .
2547: Global session or window options are listed if
2548: .Fl g
2549: is used.
1.57 jmc 2550: .It Xo Ic show-window-options
2551: .Op Fl g
2552: .Op Fl t Ar target-window
2553: .Xc
2554: .D1 (alias: Ic showw )
2555: List the window options for
2556: .Ar target-window ,
2557: or the global window options if
2558: .Fl g
2559: is used.
1.63 nicm 2560: .El
1.245 nicm 2561: .Sh FORMATS
2562: The
2563: .Ic list-sessions ,
2564: .Ic list-windows
2565: and
2566: .Ic list-panes
2567: commands accept the
2568: .Fl F
2569: flag with a
2570: .Ar format
2571: argument.
2572: This is a string which controls the output format of the command.
2573: Special character sequences are replaced as documented under the
2574: .Ic status-left
2575: option and an additional long form is accepted.
2576: Replacement variables are enclosed in
2577: .Ql #{
2578: and
2579: .Ql } ,
2580: for example
2581: .Ql #{session_name}
2582: is equivalent to
2583: .Ql #S .
2584: Conditionals are also accepted by prefixing with
1.246 jmc 2585: .Ql \&?
1.245 nicm 2586: and separating two alternatives with a comma;
2587: if the specified variable exists and is not zero, the first alternative
1.246 jmc 2588: is chosen, otherwise the second is used.
2589: For example
1.245 nicm 2590: .Ql #{?session_attached,attached,not attached}
2591: will include the string
2592: .Ql attached
2593: if the session is attached and the string
2594: .Ql not attached
2595: if it is unattached.
2596: .Pp
2597: The following variables are available, where appropriate:
2598: .Bl -column "session_created_string" "Replaced with" -offset indent
2599: .It Sy "Variable name" Ta Sy "Replaced with"
2600: .It Li "host" Ta "Hostname of local host"
2601: .It Li "line" Ta "Line number in the list"
2602: .It Li "pane_active" Ta "1 if active pane"
2603: .It Li "pane_dead" Ta "1 if pane is dead"
2604: .It Li "pane_height" Ta "Height of pane"
2605: .It Li "pane_id" Ta "Unique pane id"
2606: .It Li "pane_title" Ta "Title of pane"
2607: .It Li "pane_width" Ta "Width of pane"
2608: .It Li "session_attached" Ta "1 if session attached"
2609: .It Li "session_created" Ta "Integer time session created"
2610: .It Li "session_created_string" Ta "String time session created"
2611: .It Li "session_group" Ta "Number of session group"
2612: .It Li "session_grouped" Ta "1 if session in a group"
2613: .It Li "session_height" Ta "Height of session"
2614: .It Li "session_name" Ta "Name of session"
2615: .It Li "session_width" Ta "Width of session"
2616: .It Li "session_windows" Ta "Number of windows in session"
2617: .It Li "window_active" Ta "1 if window active"
2618: .It Li "window_flags" Ta "Window flags"
2619: .It Li "window_height" Ta "Height of window"
2620: .It Li "window_index" Ta "Index of window"
2621: .It Li "window_layout" Ta "Window layout description"
2622: .It Li "window_name" Ta "Name of window"
2623: .It Li "window_width" Ta "Width of window"
2624: .El
1.63 nicm 2625: .Sh ENVIRONMENT
2626: When the server is started,
2627: .Nm
2628: copies the environment into the
2629: .Em global environment ;
2630: in addition, each session has a
2631: .Em session environment .
1.193 nicm 2632: When a window is created, the session and global environments are merged.
2633: If a variable exists in both, the value from the session environment is used.
2634: The result is the initial environment passed to the new process.
1.63 nicm 2635: .Pp
2636: The
2637: .Ic update-environment
2638: session option may be used to update the session environment from the client
2639: when a new session is created or an old reattached.
2640: .Nm
2641: also initialises the
2642: .Ev TMUX
2643: variable with some internal information to allow commands to be executed
2644: from inside, and the
2645: .Ev TERM
2646: variable with the correct terminal setting of
2647: .Ql screen .
2648: .Pp
2649: Commands to alter and view the environment are:
2650: .Bl -tag -width Ds
2651: .It Xo Ic set-environment
2652: .Op Fl gru
2653: .Op Fl t Ar target-session
2654: .Ar name Op Ar value
2655: .Xc
1.115 nicm 2656: .D1 (alias: Ic setenv )
1.63 nicm 2657: Set or unset an environment variable.
2658: If
2659: .Fl g
2660: is used, the change is made in the global environment; otherwise, it is applied
2661: to the session environment for
2662: .Ar target-session .
2663: The
2664: .Fl u
2665: flag unsets a variable.
2666: .Fl r
2667: indicates the variable is to be removed from the environment before starting a
2668: new process.
2669: .It Xo Ic show-environment
2670: .Op Fl g
2671: .Op Fl t Ar target-session
2672: .Xc
1.115 nicm 2673: .D1 (alias: Ic showenv )
1.63 nicm 2674: Display the environment for
2675: .Ar target-session
2676: or the global environment with
2677: .Fl g .
2678: Variables removed from the environment are prefixed with
2679: .Ql - .
1.57 jmc 2680: .El
2681: .Sh STATUS LINE
2682: .Nm
2683: includes an optional status line which is displayed in the bottom line of each
2684: terminal.
2685: By default, the status line is enabled (it may be disabled with the
2686: .Ic status
2687: session option) and contains, from left-to-right: the name of the current
2688: session in square brackets; the window list; the current window title in double
2689: quotes; and the time and date.
2690: .Pp
2691: The status line is made of three parts: configurable left and right sections
2692: (which may contain dynamic content such as the time or output from a shell
2693: command, see the
2694: .Ic status-left ,
2695: .Ic status-left-length ,
2696: .Ic status-right ,
2697: and
2698: .Ic status-right-length
2699: options below), and a central window list.
1.125 nicm 2700: By default, the window list shows the index, name and (if any) flag of the
2701: windows present in the current session in ascending numerical order.
2702: It may be customised with the
2703: .Ar window-status-format
2704: and
2705: .Ar window-status-current-format
2706: options.
1.57 jmc 2707: The flag is one of the following symbols appended to the window name:
2708: .Bl -column "Symbol" "Meaning" -offset indent
2709: .It Sy "Symbol" Ta Sy "Meaning"
2710: .It Li "*" Ta "Denotes the current window."
2711: .It Li "-" Ta "Marks the last window (previously selected)."
2712: .It Li "#" Ta "Window is monitored and activity has been detected."
2713: .It Li "!" Ta "A bell has occurred in the window."
2714: .It Li "+" Ta "Window is monitored for content and it has appeared."
1.192 nicm 2715: .It Li "~" Ta "The window has been silent for the monitor-silence interval."
1.57 jmc 2716: .El
2717: .Pp
2718: The # symbol relates to the
2719: .Ic monitor-activity
2720: and + to the
2721: .Ic monitor-content
2722: window options.
2723: The window name is printed in inverted colours if an alert (bell, activity or
2724: content) is present.
2725: .Pp
1.131 nicm 2726: The colour and attributes of the status line may be configured, the entire
2727: status line using the
1.57 jmc 2728: .Ic status-attr ,
2729: .Ic status-fg
2730: and
2731: .Ic status-bg
2732: session options and individual windows using the
2733: .Ic window-status-attr ,
2734: .Ic window-status-fg
2735: and
2736: .Ic window-status-bg
2737: window options.
2738: .Pp
1.131 nicm 2739: The status line is automatically refreshed at interval if it has changed, the
2740: interval may be controlled with the
1.57 jmc 2741: .Ic status-interval
2742: session option.
2743: .Pp
2744: Commands related to the status line are as follows:
2745: .Bl -tag -width Ds
2746: .It Xo Ic command-prompt
1.235 nicm 2747: .Op Fl I Ar inputs
1.73 nicm 2748: .Op Fl p Ar prompts
1.57 jmc 2749: .Op Fl t Ar target-client
2750: .Op Ar template
2751: .Xc
2752: Open the command prompt in a client.
2753: This may be used from inside
2754: .Nm
2755: to execute commands interactively.
1.231 nicm 2756: .Pp
1.57 jmc 2757: If
2758: .Ar template
1.73 nicm 2759: is specified, it is used as the command.
1.235 nicm 2760: If present,
2761: .Fl I
2762: is a comma-separated list of the initial text for each prompt.
1.73 nicm 2763: If
2764: .Fl p
2765: is given,
2766: .Ar prompts
2767: is a comma-separated list of prompts which are displayed in order; otherwise
2768: a single prompt is displayed, constructed from
2769: .Ar template
2770: if it is present, or
2771: .Ql \&:
2772: if not.
1.235 nicm 2773: .Pp
2774: Both
2775: .Ar inputs
2776: and
1.231 nicm 2777: .Ar prompts
2778: may contain the special character sequences supported by the
2779: .Ic status-left
2780: option.
2781: .Pp
1.73 nicm 2782: Before the command is executed, the first occurrence of the string
2783: .Ql %%
1.74 jmc 2784: and all occurrences of
1.73 nicm 2785: .Ql %1
2786: are replaced by the response to the first prompt, the second
2787: .Ql %%
2788: and all
2789: .Ql %2
2790: are replaced with the response to the second prompt, and so on for further
1.74 jmc 2791: prompts.
2792: Up to nine prompt responses may be replaced
2793: .Po
2794: .Ql %1
1.73 nicm 2795: to
1.74 jmc 2796: .Ql %9
2797: .Pc .
1.57 jmc 2798: .It Xo Ic confirm-before
1.238 nicm 2799: .Op Fl p Ar prompt
1.57 jmc 2800: .Op Fl t Ar target-client
2801: .Ar command
2802: .Xc
2803: .D1 (alias: Ic confirm )
2804: Ask for confirmation before executing
2805: .Ar command .
1.238 nicm 2806: If
2807: .Fl p
2808: is given,
2809: .Ar prompt
2810: is the prompt to display; otherwise a prompt is constructed from
2811: .Ar command .
2812: It may contain the special character sequences supported by the
2813: .Ic status-left
2814: option.
2815: .Pp
1.57 jmc 2816: This command works only from inside
2817: .Nm .
2818: .It Xo Ic display-message
1.127 nicm 2819: .Op Fl p
1.215 nicm 2820: .Op Fl c Ar target-client
2821: .Op Fl t Ar target-pane
1.57 jmc 2822: .Op Ar message
2823: .Xc
2824: .D1 (alias: Ic display )
1.127 nicm 2825: Display a message.
2826: If
2827: .Fl p
2828: is given, the output is printed to stdout, otherwise it is displayed in the
2829: .Ar target-client
2830: status line.
1.122 nicm 2831: The format of
1.124 jmc 2832: .Ar message
2833: is as for
1.122 nicm 2834: .Ic status-left ,
1.215 nicm 2835: with the exception that #() are not handled; information is taken from
2836: .Ar target-pane
2837: if
2838: .Fl t
2839: is given, otherwise the active pane for the session attached to
2840: .Ar target-client .
1.57 jmc 2841: .El
2842: .Sh BUFFERS
2843: .Nm
2844: maintains a stack of
1.199 nicm 2845: .Em paste buffers .
1.57 jmc 2846: Up to the value of the
2847: .Ic buffer-limit
2848: option are kept; when a new buffer is added, the buffer at the bottom of the
2849: stack is removed.
2850: Buffers may be added using
2851: .Ic copy-mode
2852: or the
2853: .Ic set-buffer
2854: command, and pasted into a window using the
2855: .Ic paste-buffer
2856: command.
2857: .Pp
2858: A configurable history buffer is also maintained for each window.
2859: By default, up to 2000 lines are kept; this can be altered with the
2860: .Ic history-limit
2861: option (see the
2862: .Ic set-option
2863: command above).
2864: .Pp
2865: The buffer commands are as follows:
2866: .Bl -tag -width Ds
1.178 nicm 2867: .It Xo
2868: .Ic choose-buffer
2869: .Op Fl t Ar target-window
2870: .Op Ar template
2871: .Xc
2872: Put a window into buffer choice mode, where a buffer may be chosen
2873: interactively from a list.
2874: After a buffer is selected,
2875: .Ql %%
2876: is replaced by the buffer index in
2877: .Ar template
2878: and the result executed as a command.
2879: If
2880: .Ar template
2881: is not given, "paste-buffer -b '%%'" is used.
2882: This command works only from inside
2883: .Nm .
1.57 jmc 2884: .It Ic clear-history Op Fl t Ar target-pane
2885: .D1 (alias: Ic clearhist )
2886: Remove and free the history for the specified pane.
1.198 nicm 2887: .It Ic delete-buffer Op Fl b Ar buffer-index
1.57 jmc 2888: .D1 (alias: Ic deleteb )
2889: Delete the buffer at
2890: .Ar buffer-index ,
2891: or the top buffer if not specified.
1.198 nicm 2892: .It Ic list-buffers
1.57 jmc 2893: .D1 (alias: Ic lsb )
1.198 nicm 2894: List the global buffers.
1.200 jmc 2895: .It Xo Ic load-buffer
1.57 jmc 2896: .Op Fl b Ar buffer-index
2897: .Ar path
2898: .Xc
2899: .D1 (alias: Ic loadb )
2900: Load the contents of the specified paste buffer from
2901: .Ar path .
2902: .It Xo Ic paste-buffer
2903: .Op Fl dr
2904: .Op Fl b Ar buffer-index
1.170 nicm 2905: .Op Fl s Ar separator
1.158 nicm 2906: .Op Fl t Ar target-pane
1.57 jmc 2907: .Xc
2908: .D1 (alias: Ic pasteb )
1.158 nicm 2909: Insert the contents of a paste buffer into the specified pane.
2910: If not specified, paste into the current one.
1.57 jmc 2911: With
2912: .Fl d ,
2913: also delete the paste buffer from the stack.
2914: When output, any linefeed (LF) characters in the paste buffer are replaced with
1.170 nicm 2915: a separator, by default carriage return (CR).
2916: A custom separator may be specified using the
2917: .Fl s
2918: flag.
2919: The
1.57 jmc 2920: .Fl r
1.170 nicm 2921: flag means to do no replacement (equivalent to a separator of LF).
1.57 jmc 2922: .It Xo Ic save-buffer
2923: .Op Fl a
2924: .Op Fl b Ar buffer-index
2925: .Ar path
2926: .Xc
2927: .D1 (alias: Ic saveb )
2928: Save the contents of the specified paste buffer to
2929: .Ar path .
2930: The
2931: .Fl a
2932: option appends to rather than overwriting the file.
2933: .It Xo Ic set-buffer
2934: .Op Fl b Ar buffer-index
2935: .Ar data
2936: .Xc
2937: .D1 (alias: Ic setb )
2938: Set the contents of the specified buffer to
2939: .Ar data .
1.1 nicm 2940: .It Xo Ic show-buffer
2941: .Op Fl b Ar buffer-index
2942: .Xc
2943: .D1 (alias: Ic showb )
2944: Display the contents of the specified buffer.
1.57 jmc 2945: .El
2946: .Sh MISCELLANEOUS
2947: Miscellaneous commands are as follows:
2948: .Bl -tag -width Ds
1.72 nicm 2949: .It Ic clock-mode Op Fl t Ar target-pane
1.57 jmc 2950: Display a large clock.
2951: .It Ic if-shell Ar shell-command command
2952: .D1 (alias: Ic if )
2953: Execute
2954: .Ar command
2955: if
2956: .Ar shell-command
2957: returns success.
2958: .It Ic lock-server
2959: .D1 (alias: Ic lock )
1.90 nicm 2960: Lock each client individually by running the command specified by the
2961: .Ic lock-command
2962: option.
1.153 nicm 2963: .It Ic run-shell Ar shell-command
1.87 nicm 2964: .D1 (alias: Ic run )
2965: Execute
1.153 nicm 2966: .Ar shell-command
1.106 nicm 2967: in the background without creating a window.
1.164 nicm 2968: After it finishes, any output to stdout is displayed in copy mode.
1.153 nicm 2969: If the command doesn't return success, the exit status is also displayed.
1.57 jmc 2970: .It Ic server-info
2971: .D1 (alias: Ic info )
2972: Show server information and terminal details.
1.228 nicm 2973: .El
2974: .Sh TERMINFO EXTENSIONS
2975: .Nm
2976: understands some extensions to
2977: .Xr terminfo 5 :
2978: .Bl -tag -width Ds
1.232 jmc 2979: .It Em Cc , Cr
1.233 nicm 2980: Set the cursor colour.
1.232 jmc 2981: The first takes a single string argument and is used to set the colour;
2982: the second takes no arguments and restores the default cursor colour.
2983: If set, a sequence such as this may be used
2984: to change the cursor colour from inside
2985: .Nm :
2986: .Bd -literal -offset indent
2987: $ printf '\e033]12;red\e033\e\e'
2988: .Ed
2989: .It Em Cs , Csr
1.230 nicm 2990: Change the cursor style.
1.232 jmc 2991: If set, a sequence such as this may be used
2992: to change the cursor to an underline:
1.230 nicm 2993: .Bd -literal -offset indent
2994: $ printf '\e033[4 q'
2995: .Ed
2996: .Pp
2997: If
2998: .Em Csr
2999: is set, it will be used to reset the cursor style instead
3000: of
3001: .Em Cs .
1.232 jmc 3002: .It Em \&Ms
3003: This sequence can be used by
3004: .Nm
3005: to store the current buffer in the host terminal's selection (clipboard).
3006: See the
3007: .Em set-clipboard
3008: option above and the
3009: .Xr xterm 1
3010: man page.
1.1 nicm 3011: .El
3012: .Sh FILES
1.26 nicm 3013: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 3014: .It Pa ~/.tmux.conf
1.6 jmc 3015: Default
1.1 nicm 3016: .Nm
1.6 jmc 3017: configuration file.
1.26 nicm 3018: .It Pa /etc/tmux.conf
3019: System-wide configuration file.
1.1 nicm 3020: .El
1.57 jmc 3021: .Sh EXAMPLES
3022: To create a new
3023: .Nm
3024: session running
3025: .Xr vi 1 :
3026: .Pp
3027: .Dl $ tmux new-session vi
3028: .Pp
3029: Most commands have a shorter form, known as an alias.
3030: For new-session, this is
3031: .Ic new :
3032: .Pp
3033: .Dl $ tmux new vi
3034: .Pp
3035: Alternatively, the shortest unambiguous form of a command is accepted.
3036: If there are several options, they are listed:
3037: .Bd -literal -offset indent
3038: $ tmux n
3039: ambiguous command: n, could be: new-session, new-window, next-window
3040: .Ed
3041: .Pp
3042: Within an active session, a new window may be created by typing
3043: .Ql C-b c
3044: (Ctrl
3045: followed by the
3046: .Ql b
3047: key
3048: followed by the
3049: .Ql c
3050: key).
3051: .Pp
3052: Windows may be navigated with:
3053: .Ql C-b 0
3054: (to select window 0),
3055: .Ql C-b 1
3056: (to select window 1), and so on;
3057: .Ql C-b n
3058: to select the next window; and
3059: .Ql C-b p
3060: to select the previous window.
3061: .Pp
3062: A session may be detached using
3063: .Ql C-b d
1.64 nicm 3064: (or by an external event such as
3065: .Xr ssh 1
3066: disconnection) and reattached with:
1.57 jmc 3067: .Pp
3068: .Dl $ tmux attach-session
3069: .Pp
3070: Typing
3071: .Ql C-b \&?
3072: lists the current key bindings in the current window; up and down may be used
3073: to navigate the list or
3074: .Ql q
3075: to exit from it.
3076: .Pp
3077: Commands to be run when the
3078: .Nm
3079: server is started may be placed in the
3080: .Pa ~/.tmux.conf
3081: configuration file.
3082: Common examples include:
3083: .Pp
3084: Changing the default prefix key:
3085: .Bd -literal -offset indent
3086: set-option -g prefix C-a
3087: unbind-key C-b
3088: bind-key C-a send-prefix
3089: .Ed
3090: .Pp
3091: Turning the status line off, or changing its colour:
3092: .Bd -literal -offset indent
3093: set-option -g status off
3094: set-option -g status-bg blue
3095: .Ed
3096: .Pp
3097: Setting other options, such as the default command,
3098: or locking after 30 minutes of inactivity:
3099: .Bd -literal -offset indent
3100: set-option -g default-command "exec /bin/ksh"
3101: set-option -g lock-after-time 1800
3102: .Ed
3103: .Pp
3104: Creating new key bindings:
3105: .Bd -literal -offset indent
3106: bind-key b set-option status
3107: bind-key / command-prompt "split-window 'exec man %%'"
1.73 nicm 3108: bind-key S command-prompt "new-window -n %1 'ssh %1'"
1.57 jmc 3109: .Ed
1.1 nicm 3110: .Sh SEE ALSO
3111: .Xr pty 4
3112: .Sh AUTHORS
3113: .An Nicholas Marriott Aq nicm@users.sourceforge.net