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