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