Annotation of src/usr.bin/tmux/tmux.1, Revision 1.60
1.60 ! nicm 1: .\" $OpenBSD: tmux.1,v 1.59 2009/08/06 21:06:35 jmc 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.60 ! nicm 17: .Dd $Mdocdate: August 6 2009 $
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
26: .Op Fl 28dqUuv
27: .Op Fl f Ar file
28: .Op Fl L Ar socket-name
29: .Op Fl S Ar socket-path
30: .Op Ar command Op Ar flags
31: .Ek
32: .Sh DESCRIPTION
33: .Nm
1.59 jmc 34: is a terminal multiplexer:
35: it enables a number of terminals to be created, accessed, and
36: controlled from a single screen.
1.1 nicm 37: .Pp
1.60 ! nicm 38: When
! 39: .Nm
! 40: is started it creates a new
! 41: .Em session
! 42: with a single
! 43: .Em window
! 44: and displays it on screen.
! 45: A status line at the bottom of the screen
! 46: shows information on the current session
! 47: and is used to enter interactive commands.
! 48: .Pp
! 49: A session is a single collection of
! 50: .Em pseudo terminals
! 51: under the management of
! 52: .Nm .
! 53: Each session has one or more
! 54: windows linked to it.
! 55: A window occupies the entire screen
! 56: and may be split into rectangular panes,
! 57: each of which is a separate pseudo terminal
! 58: (the
! 59: .Xr pty 4
! 60: manual page documents the technical details of pseudo terminals).
! 61: Any number of
! 62: .Nm
! 63: instances may connect to the same session,
! 64: and any number of windows may be present in the same session.
! 65: Once all sessions are killed,
! 66: .Nm
! 67: exits.
! 68: .Pp
! 69: For a quick start guide,
! 70: see the
! 71: .Sx EXAMPLES
! 72: section at the bottom of the page.
! 73: An overview of the sections in this manual page:
! 74: .Bl -ohang
! 75: .It Sy Commands
! 76: An overview of how
! 77: .Nm
! 78: commands work.
! 79: .It Sy Clients and sessions
! 80: Commands for managing clients and sessions.
! 81: .It Sy Windows and panes
! 82: Commands for managing windows and panes.
! 83: .It Sy Key bindings
! 84: How key bindings work.
! 85: .It Sy Options
! 86: Configuration options for
! 87: .Nm .
! 88: .It Sy Status line
! 89: Commands pertinent to the status line.
! 90: .It Sy Buffers
! 91: Copy and paste operations.
! 92: .It Sy Miscellaneous
! 93: Miscellaneous commands.
! 94: .It Sy Examples
! 95: A quick start guide.
! 96: .El
! 97: .Pp
1.1 nicm 98: The options are as follows:
99: .Bl -tag -width "XXXXXXXXXXXX"
100: .It Fl 2
101: Force
102: .Nm
103: to assume the terminal supports 256 colours.
104: .It Fl 8
105: Like
106: .Fl 2 ,
1.6 jmc 107: but indicates that the terminal supports 88 colours.
1.1 nicm 108: .It Fl d
109: Force
110: .Nm
111: to assume the terminal supports default colours.
112: .It Fl f Ar file
113: Specify an alternative configuration file.
114: By default,
115: .Nm
1.26 nicm 116: loads the system configuration file from
117: .Pa /etc/tmux.conf ,
118: if present, then looks for a user configuration file at
1.1 nicm 119: .Pa ~/.tmux.conf .
120: The configuration file is a set of
121: .Nm
122: commands which are executed in sequence when the server is first started.
123: .It Fl L Ar socket-name
124: .Nm
125: stores the server socket in a directory under
126: .Pa /tmp ;
127: the default socket is named
128: .Em default .
129: This option allows a different socket name to be specified, allowing several
130: independent
131: .Nm
132: servers to be run.
133: Unlike
134: .Fl S
135: a full path is not necessary: the sockets are all created in the same
136: directory.
1.2 nicm 137: .Pp
138: If the socket is accidentally removed, the
1.6 jmc 139: .Dv SIGUSR1
1.2 nicm 140: signal may be sent to the
141: .Nm
142: server process to recreate it.
1.4 sobrado 143: .It Fl q
1.6 jmc 144: Prevent the server sending various informational messages, for example when
1.4 sobrado 145: window flags are altered.
1.1 nicm 146: .It Fl S Ar socket-path
147: Specify a full alternative path to the server socket.
148: If
149: .Fl S
150: is specified, the default socket directory is not used and any
151: .Fl L
152: flag is ignored.
153: .It Fl U
154: Unlock the server.
155: .It Fl u
156: .Nm
1.14 nicm 157: attempts to guess if the terminal is likely to support UTF-8 by checking the
158: first of the
159: .Ev LC_ALL ,
160: .Ev LC_CTYPE
161: and
1.2 nicm 162: .Ev LANG
1.14 nicm 163: environment variables to be set for the string "UTF-8".
1.5 nicm 164: This is not always correct: the
1.2 nicm 165: .Fl u
166: flag explicitly informs
167: .Nm
1.6 jmc 168: that UTF-8 is supported.
1.33 nicm 169: .Pp
170: If the server is started from a client passed
171: .Fl u
172: or where UTF-8 is detected, the
173: .Ic utf8
174: and
175: .Ic status-utf8
176: options are enabled in the global window and session options respectively.
1.1 nicm 177: .It Fl v
178: Request verbose logging.
179: This option may be specified multiple times for increasing verbosity.
180: Log messages will be saved into
181: .Pa tmux-client-PID.log
182: and
183: .Pa tmux-server-PID.log
184: files in the current directory, where
185: .Em PID
1.6 jmc 186: is the PID of the server or client process.
1.1 nicm 187: .It Ar command Op Ar flags
188: This specifies one of a set of commands used to control
189: .Nm ,
1.6 jmc 190: as described in the following sections.
1.59 jmc 191: If no commands are specified, the
1.1 nicm 192: .Ic new-session
193: command is assumed.
1.57 jmc 194: .El
195: .Sh COMMANDS
196: This section contains a list of the commands supported by
197: .Nm .
198: Most commands accept the optional
199: .Fl t
200: argument with one of
201: .Ar target-client ,
202: .Ar target-session
203: .Ar target-window ,
204: or
205: .Ar target-pane .
206: These specify the client, session, window or pane which a command should affect.
207: .Ar target-client
208: is the name of the
209: .Xr pty 4
210: file to which the client is connected, for example either of
211: .Pa /dev/ttyp1
212: or
213: .Pa ttyp1
214: for the client attached to
215: .Pa /dev/ttyp1 .
216: If no client is specified, the current client is chosen, if possible, or an
217: error is reported.
218: Clients may be listed with the
219: .Ic list-clients
220: command.
1.1 nicm 221: .Pp
1.57 jmc 222: .Ar target-session
223: is either the name of a session (as listed by the
224: .Ic list-sessions
225: command) or the name of a client with the same syntax as
226: .Ar target-client ,
227: in which case the session attached to the client is used.
228: When looking for the session name,
229: .Nm
230: initially searches for an exact match; if none is found, the session names
231: are checked for any for which
232: .Ar target-session
233: is a prefix or for which it matches as an
234: .Xr fnmatch 3
235: pattern.
236: If a single match is found, it is used as the target session; multiple matches
237: produce an error.
238: If a session is omitted, the current session is used if available; if no
239: current session is available, the most recently created is chosen.
1.1 nicm 240: .Pp
1.57 jmc 241: .Ar target-window
242: specifies a window in the form
243: .Em session Ns \&: Ns Em window .
244: .Em session
245: follows the same rules as for
246: .Ar target-session ,
247: and
248: .Em window
249: is looked for in order: as a window index, for example mysession:1; as an exact
250: window name, such as mysession:mywindow; then as an
251: .Xr fnmatch 3
252: pattern or the start of a window name, such as mysession:mywin* or
253: mysession:mywin.
254: An empty window name specifies the next unused index if appropriate (for
255: example the
256: .Ic new-window
257: and
258: .Ic link-window
259: commands)
260: otherwise the current window in
261: .Em session
262: is chosen.
263: When the argument does not contain a colon,
264: .Nm
265: first attempts to parse it as window; if that fails, an attempt is made to
266: match a session.
1.1 nicm 267: .Pp
1.57 jmc 268: .Ar target-pane
269: takes a similar form to
270: .Ar target-window
271: but with the optional addition of a period followed by a pane index, for
272: example: mysession:mywindow.1.
273: If the pane index is omitted, the currently active pane in the specified
274: window is used.
275: If neither a colon nor period appears,
1.13 nicm 276: .Nm
1.57 jmc 277: first attempts to use the argument as a pane index; if that fails, it is looked
278: up as for
279: .Ar target-window .
1.15 jmc 280: .Pp
1.57 jmc 281: Multiple commands may be specified together as part of a
282: .Em command sequence .
283: Each command should be separated by spaces and a semicolon;
284: commands are executed sequentially from left to right.
285: A literal semicolon may be included by escaping it with a backslash (for
286: example, when specifying a command sequence to
287: .Ic bind-key ) .
1.13 nicm 288: .Pp
1.57 jmc 289: Examples include:
1.13 nicm 290: .Bd -literal -offset indent
1.57 jmc 291: refresh-client -t/dev/ttyp2
292:
293: rename-session -tfirst newname
294:
295: set-window-option -t:0 monitor-activity on
296:
297: new-window ; split-window -d
298:
299: bind-key D detach-client \e\; lock-server
1.13 nicm 300: .Ed
1.57 jmc 301: .Sh CLIENTS AND SESSIONS
302: The following commands are available:
303: .Bl -tag -width Ds
304: .It Xo Ic attach-session
305: .Op Fl d
306: .Op Fl t Ar target-session
307: .Xc
308: .D1 (alias: Ic attach )
309: If run from outside
310: .Nm ,
311: create a new client in the current terminal and attach it to
312: .Ar target-session .
313: If used from inside, switch the current client.
314: If
315: .Fl d
316: is specified, any other clients attached to the session are detached.
1.13 nicm 317: .Pp
1.57 jmc 318: If no server is started,
319: .Ic attach-session
320: will attempt to start it; this will fail unless sessions are created in the
321: configuration file.
322: .It Ic detach-client Op Fl t Ar target-client
323: .D1 (alias: Ic detach )
324: Detach the current client if bound to a key, or the specified client with
325: .Fl t .
326: .It Ic has-session Op Fl t Ar target-session
327: .D1 (alias: Ic has )
328: Report an error and exit with 1 if the specified session does not exist.
329: If it does exist, exit with 0.
330: .It Ic kill-server
331: Kill the
1.1 nicm 332: .Nm
1.57 jmc 333: server and clients and destroy all sessions.
334: .It Ic kill-session Op Fl t Ar target-session
335: Destroy the given session, closing any windows linked to it and no other
336: sessions, and detaching all clients attached to it.
337: .It Ic list-clients
338: .D1 (alias: Ic lsc )
339: List all clients attached to the server.
340: .It Ic list-commands
341: .D1 (alias: Ic lscm )
342: List the syntax of all commands supported by
343: .Nm .
344: .It Ic list-sessions
345: .D1 (alias: Ic ls )
346: List all sessions managed by the server.
347: .It Xo Ic new-session
348: .Op Fl d
349: .Op Fl n Ar window-name
350: .Op Fl s Ar session-name
351: .Op Ar command
352: .Xc
353: .D1 (alias: Ic new )
354: Create a new session with name
355: .Ar session-name .
356: The new session is attached to the current terminal unless
357: .Fl d
358: is given.
359: .Ar window-name
1.1 nicm 360: and
1.57 jmc 361: .Ar command
362: are the name of and command to execute in the initial window.
363: .It Ic refresh-client Op Fl t Ar target-client
364: .D1 (alias: Ic refresh )
365: Refresh the current client if bound to a key, or a single client if one is given
366: with
367: .Fl t .
368: .It Xo Ic rename-session
369: .Op Fl t Ar target-session
370: .Ar new-name
371: .Xc
372: .D1 (alias: Ic rename )
373: Rename the session to
374: .Ar new-name .
375: .It Ic source-file Ar path
376: .D1 (alias: Ic source )
377: Execute commands from
378: .Ar path .
379: .It Ic start-server
380: .D1 (alias: Ic start )
381: Start the
1.1 nicm 382: .Nm
1.57 jmc 383: server, if not already running, without creating any sessions.
384: .It Xo Ic suspend-client
385: .Op Fl c Ar target-client
386: .Xc
387: .D1 (alias: Ic suspendc )
388: Suspend a client by sending
389: .Dv SIGTSTP
390: (tty stop).
391: .It Xo Ic switch-client
392: .Op Fl c Ar target-client
393: .Op Fl t Ar target-session
394: .Xc
395: .D1 (alias: Ic switchc )
396: Switch the current session for client
397: .Ar target-client
398: to
399: .Ar target-session .
400: .El
401: .Sh WINDOWS AND PANES
1.1 nicm 402: A
403: .Nm
404: window may be in one of several modes.
405: The default permits direct access to the terminal attached to the window.
406: The others are:
407: .Bl -tag -width Ds
408: .It Em output mode
409: This is entered when a command which produces output, such as
410: .Ic list-keys ,
411: is executed from a key binding.
412: .It Em scroll mode
413: This is entered with the
414: .Ic scroll-mode
415: command (bound to
416: .Ql =
417: by default) and permits the window history buffer to be inspected.
418: .It Em copy mode
419: This permits a section of a window or its history to be copied to a
420: .Em paste buffer
421: for later insertion into another window.
422: This mode is entered with the
423: .Ic copy-mode
424: command, bound to
425: .Ql [
426: by default.
427: .El
428: .Pp
1.6 jmc 429: The keys available depend on whether emacs or vi mode is selected
430: (see the
1.1 nicm 431: .Ic mode-keys
432: option).
433: The following keys are supported as appropriate for the mode:
434: .Bl -column "FunctionXXXXXXXXXXXX" "viXXXXXX" "emacs" -offset indent
435: .It Sy "Function" Ta Sy "vi" Ta Sy "emacs"
1.27 nicm 436: .It Li "Start of line" Ta "0" Ta "C-a"
437: .It Li "Back to indentation" Ta "^" Ta "M-m"
1.1 nicm 438: .It Li "Clear selection" Ta "Escape" Ta "C-g"
439: .It Li "Copy selection" Ta "Enter" Ta "M-w"
440: .It Li "Cursor down" Ta "j" Ta "Down"
441: .It Li "End of line" Ta "$" Ta "C-e"
442: .It Li "Cursor left" Ta "h" Ta "Left"
443: .It Li "Next page" Ta "C-f" Ta "Page down"
444: .It Li "Next word" Ta "w" Ta "M-f"
445: .It Li "Previous page" Ta "C-u" Ta "Page up"
446: .It Li "Previous word" Ta "b" Ta "M-b"
447: .It Li "Quit mode" Ta "q" Ta "Escape"
448: .It Li "Cursor right" Ta "l" Ta "Right"
449: .It Li "Start selection" Ta "Space" Ta "C-Space"
450: .It Li "Cursor up" Ta "k" Ta "Up"
1.48 nicm 451: .It Li "Delete to end of line" Ta "D" Ta "C-k"
1.2 nicm 452: .It Li "Paste buffer" Ta "p" Ta "C-y"
1.1 nicm 453: .El
454: .Pp
1.48 nicm 455: These key bindings are defined in a set of named tables:
456: .Em vi-edit
457: and
458: .Em emacs-edit
459: for keys used when line editing at the command prompt;
460: .Em vi-choice
461: and
462: .Em emacs-choice
463: for keys used when choosing from lists (such as produced by the
464: .Ic window-choose
465: command) or in output mode; and
466: .Em vi-copy
467: and
468: .Em emacs-copy
469: used in copy and scroll modes.
470: The tables may be viewed with the
471: .Ic list-keys
1.49 nicm 472: command and keys modified or removed with
473: .Ic bind-key
474: and
475: .Ic unbind-key .
1.48 nicm 476: .Pp
1.2 nicm 477: The paste buffer key pastes the first line from the top paste buffer on the
478: stack.
1.57 jmc 479: .Pp
480: The mode commands are as follows:
481: .Bl -tag -width Ds
482: .It Xo Ic copy-mode
483: .Op Fl u
484: .Op Fl t Ar target-window
485: .Xc
486: Enter copy mode.
487: The
488: .Fl u
489: option scrolls one page up.
490: .It Xo Ic scroll-mode
491: .Op Fl u
492: .Op Fl t Ar target-window
493: .Xc
494: Enter scroll mode.
495: The
496: .Fl u
497: has the same meaning as in the
1.1 nicm 498: .Ic copy-mode
1.18 nicm 499: command.
1.57 jmc 500: .El
1.18 nicm 501: .Pp
1.1 nicm 502: Each window displayed by
503: .Nm
504: may be split into one or more
505: .Em panes ;
506: each pane takes up a certain area of the display and is a separate terminal.
507: A window may be split into panes using the
508: .Ic split-window
509: command.
1.38 nicm 510: Windows may be split horizontally (with the
511: .Fl h
512: flag) or vertically.
513: Panes may be resized with the
514: .Ic resize-pane
1.1 nicm 515: command (bound to
1.38 nicm 516: .Ql C-up ,
517: .Ql C-down
518: .Ql C-left
519: and
520: .Ql C-right
1.1 nicm 521: by default), the current pane may be changed with the
522: .Ic up-pane
523: and
524: .Ic down-pane
525: commands and the
526: .Ic rotate-window
527: and
528: .Ic swap-pane
1.38 nicm 529: commands may be used to swap panes without changing their position.
530: Panes are numbered beginning from zero in the order they are created.
531: .Pp
532: A number of preset
533: .Em layouts
534: are available.
535: These may be selected with the
536: .Ic select-layout
537: command or cycled with
538: .Ic next-layout
539: (bound to
540: .Ql C-space
541: by default); once a layout is chosen, panes within it may be moved and resized as normal.
1.1 nicm 542: .Pp
543: The following layouts are supported:
544: .Bl -tag -width Ds
545: .It Ic even-horizontal
546: Panes are spread out evenly from left to right across the window.
547: .It Ic even-vertical
548: Panes are spread evenly from top to bottom.
1.2 nicm 549: .It Ic main-horizontal
550: A large (main) pane is shown at the top of the window and the remaining panes are
1.6 jmc 551: spread from left to right in the leftover space at the bottom.
1.2 nicm 552: Use the
553: .Em main-pane-height
554: window option to specify the height of the top pane.
1.1 nicm 555: .It Ic main-vertical
1.2 nicm 556: Similar to
557: .Ic main-horizontal
558: but the large pane is placed on the left and the others spread from top to
559: bottom along the right.
560: See the
561: .Em main-pane-width
562: window option.
1.1 nicm 563: .El
1.8 nicm 564: .Pp
1.57 jmc 565: Commands related to windows and panes are as follows:
566: .Bl -tag -width Ds
567: .It Xo Ic break-pane
568: .Op Fl d
569: .Op Fl t Ar target-pane
570: .Xc
571: .D1 (alias: Ic breakp )
572: Break
573: .Ar target-pane
574: off from its containing window to make it the only pane in a new window.
575: If
576: .Fl d
577: is given, the new window does not become the current window.
578: .It Ic choose-session Op Fl t Ar target-window
579: Put a window into session choice mode, where the session for the current
580: client may be selected interactively from a list.
581: This command works only from inside
582: .Nm .
583: .It Ic choose-window Op Fl t Ar target-window
584: Put a window into window choice mode, where the window for the session
585: attached to the current client may be selected interactively from a list.
586: This command works only from inside
587: .Nm .
588: .It Ic down-pane Op Fl t Ar target-pane
589: .D1 (alias: Ic downp )
590: Move down a pane.
591: .It Xo Ic find-window
592: .Op Fl t Ar target-window
593: .Ar match-string
594: .Xc
595: .D1 (alias: Ic findw )
596: Search for the
597: .Xr fnmatch 3
598: pattern
599: .Ar match-string
600: in window names, titles, and visible content (but not history).
601: If only one window is matched, it'll be automatically selected, otherwise a
602: choice list is shown.
603: This command only works from inside
1.1 nicm 604: .Nm .
1.57 jmc 605: .It Ic kill-pane Op Fl t Ar target-pane
606: .D1 (alias: Ic killp )
607: Destroy the given pane.
608: If no panes remain in the containing window, it is also destroyed.
609: .It Ic kill-window Op Fl t Ar target-window
610: .D1 (alias: Ic killw )
611: Kill the current window or the window at
612: .Ar target-window ,
1.1 nicm 613: removing it from any sessions to which it is linked.
1.56 jmc 614: .It Ic last-window Op Fl t Ar target-session
1.1 nicm 615: .D1 (alias: Ic last )
616: Select the last (previously selected) window.
617: If no
618: .Ar target-session
619: is specified, select the last window of the current session.
620: .It Xo Ic link-window
621: .Op Fl dk
622: .Op Fl s Ar src-window
623: .Op Fl t Ar dst-window
624: .Xc
625: .D1 (alias: Ic linkw )
626: Link the window at
627: .Ar src-window
628: to the specified
629: .Ar dst-window .
630: If
631: .Ar dst-window
632: is specified and no such window exists, the
633: .Ar src-window
634: is linked there.
635: If
636: .Fl k
637: is given and
638: .Ar dst-window
639: exists, it is killed, otherwise an error is generated.
640: If
641: .Fl d
642: is given, the newly linked window is not selected.
1.56 jmc 643: .It Ic list-windows Op Fl t Ar target-session
1.1 nicm 644: .D1 (alias: Ic lsw )
645: List windows in the current session or in
646: .Ar target-session .
647: .It Xo Ic move-window
648: .Op Fl d
649: .Op Fl s Ar src-window
650: .Op Fl t Ar dst-window
651: .Xc
652: .D1 (alias: Ic movew )
653: This is similar to
654: .Ic link-window ,
655: except the window at
656: .Ar src-window
657: is moved to
658: .Ar dst-window .
659: .It Xo Ic new-window
1.28 nicm 660: .Op Fl dk
1.1 nicm 661: .Op Fl n Ar window-name
662: .Op Fl t Ar target-window
663: .Op Ar command
664: .Xc
665: .D1 (alias: Ic neww )
666: Create a new window.
667: If
668: .Fl d
669: is given, the session does not make the new window the current window.
670: .Ar target-window
1.28 nicm 671: represents the window to be created; if the target already exists an error is
672: shown, unless the
673: .Fl k
674: flag is used, in which case it is destroyed.
1.1 nicm 675: .Ar command
676: is the command to execute.
677: If
678: .Ar command
679: is not specified, the default command is used.
680: .Pp
681: The
682: .Ev TERM
683: environment variable must be set to
684: .Dq screen
685: for all programs running
686: .Em inside
687: .Nm .
688: New windows will automatically have
689: .Dq TERM=screen
690: added to their environment, but care must be taken not to reset this in shell
691: start-up files.
1.56 jmc 692: .It Ic next-layout Op Fl t Ar target-window
1.1 nicm 693: .D1 (alias: Ic nextl )
694: Move a window to the next layout and rearrange the panes to fit.
695: .It Xo Ic next-window
1.9 nicm 696: .Op Fl a
1.1 nicm 697: .Op Fl t Ar target-session
698: .Xc
699: .D1 (alias: Ic next )
700: Move to the next window in the session.
1.9 nicm 701: If
1.12 jmc 702: .Fl a
1.9 nicm 703: is used, move to the next window with a bell, activity or content alert.
1.1 nicm 704: .It Xo Ic previous-window
1.9 nicm 705: .Op Fl a
1.1 nicm 706: .Op Fl t Ar target-session
707: .Xc
708: .D1 (alias: Ic prev )
709: Move to the previous window in the session.
1.9 nicm 710: With
711: .Fl a ,
712: move to the previous window with a bell, activity or content alert.
1.1 nicm 713: .It Xo Ic rename-window
714: .Op Fl t Ar target-window
715: .Ar new-name
716: .Xc
717: .D1 (alias: Ic renamew )
718: Rename the current window, or the window at
719: .Ar target-window
720: if specified, to
721: .Ar new-name .
722: .It Xo Ic resize-pane
1.39 jmc 723: .Op Fl DLRU
1.52 nicm 724: .Op Fl t Ar target-pane
1.1 nicm 725: .Op Ar adjustment
726: .Xc
727: .D1 (alias: Ic resizep )
1.57 jmc 728: Resize a pane, upward with
729: .Fl U
730: (the default), downward with
731: .Fl D ,
732: to the left with
733: .Fl L
734: and to the right with
735: .Fl R .
736: The
737: .Ar adjustment
738: is given in lines or cells (the default is 1).
739: .It Xo Ic respawn-window
740: .Op Fl k
741: .Op Fl t Ar target-window
742: .Op Ar command
743: .Xc
744: .D1 (alias: Ic respawnw )
745: Reactive a window in which the command has exited (see the
746: .Ic remain-on-exit
747: window option).
748: If
749: .Ar command
750: is not given, the command used when the window was created is executed.
751: The window must be already inactive, unless
752: .Fl k
753: is given, in which case any existing command is killed.
754: .It Xo Ic rotate-window
755: .Op Fl DU
756: .Op Fl t Ar target-window
757: .Xc
758: .D1 (alias: Ic rotatew )
759: Rotate the positions of the panes within a window, either upward (numerically
760: lower) with
761: .Fl U
762: or downward (numerically higher).
763: .It Xo Ic select-layout
764: .Op Fl t Ar target-window
765: .Op Ar layout-name
766: .Xc
767: .D1 (alias: selectl )
768: Choose a specific layout for a window.
769: If
770: .Ar layout-name
771: is not given, the last layout used (if any) is reapplied.
772: .It Ic select-pane Op Fl t Ar target-pane
773: .D1 (alias: Ic selectp )
774: Make pane
775: .Ar target-pane
776: the active pane in window
777: .Ar target-window .
778: .It Ic select-window Op Fl t Ar target-window
779: .D1 (alias: Ic selectw )
780: Select the window at
781: .Ar target-window .
782: .It Xo Ic split-window
783: .Op Fl dhv
784: .Oo Fl l
785: .Ar size |
786: .Fl p Ar percentage Oc
787: .Op Fl t Ar target-window
788: .Op Ar command
789: .Xc
790: .D1 (alias: splitw )
791: Creates a new pane by splitting the active pane:
792: .Fl h
793: does a horizontal split and
794: .Fl v
795: a vertical split; if neither is specified,
796: .Fl v
797: is assumed.
798: The
799: .Fl l
800: and
801: .Fl p
802: options specify the size of the new window in lines (for vertical split) or in
803: cells (for horizontal split), or as a percentage, respectively.
804: All other options have the same meaning as in the
805: .Ic new-window
806: command.
807: .It Xo Ic swap-pane
808: .Op Fl dDU
809: .Op Fl s Ar src-pane
810: .Op Fl t Ar dst-pane
811: .Xc
812: .D1 (alias: Ic swapp )
813: Swap two panes.
814: If
815: .Fl U
816: is used and no source pane is specified with
817: .Fl s ,
818: .Ar dst-pane
819: is swapped with the previous pane (before it numerically);
820: .Fl D
821: swaps with the next pane (after it numerically).
822: .It Xo Ic swap-window
823: .Op Fl d
824: .Op Fl s Ar src-window
825: .Op Fl t Ar dst-window
826: .Xc
827: .D1 (alias: Ic swapw )
828: This is similar to
829: .Ic link-window ,
830: except the source and destination windows are swapped.
831: It is an error if no window exists at
832: .Ar src-window .
833: .It Xo Ic unlink-window
1.1 nicm 834: .Op Fl k
835: .Op Fl t Ar target-window
836: .Xc
1.57 jmc 837: .D1 (alias: Ic unlinkw )
838: Unlink
839: .Ar target-window .
840: Unless
841: .Fl k
842: is given, a window may be unlinked only if it is linked to multiple sessions -
843: windows may not be linked to no sessions;
844: if
1.1 nicm 845: .Fl k
1.57 jmc 846: is specified and the window is linked to only one session, it is unlinked and
847: destroyed.
848: .It Ic up-pane Op Fl t Ar target-pane
849: .D1 (alias: Ic upp )
850: Move up a pane.
851: .El
852: .Sh KEY BINDINGS
853: .Nm
854: may be controlled from an attached client by using a key combination of a
855: prefix key,
856: .Ql C-b
857: (Ctrl-b) by default, followed by a command key.
858: .Pp
859: Some of the default key bindings include:
860: .Pp
861: .Bl -tag -width Ds -offset 3n -compact
862: .It c
863: Create new window.
864: .It d
865: Detach current client.
866: .It l
867: Move to last (previously selected) window in the current session.
868: .It n
869: Change to next window in the current session.
870: .It p
871: Change to previous window in the current session.
872: .It t
873: Display a large clock.
874: .It \&?
875: List current key bindings.
876: .El
877: .Pp
878: A complete list may be obtained with the
879: .Ic list-keys
880: command (bound to
881: .Ql \&?
882: by default).
883: Key bindings may be changed with the
884: .Ic bind-key
885: and
886: .Ic unbind-key
887: commands.
888: .Pp
889: Commands related to key bindings are as follows:
890: .Bl -tag -width Ds
891: .It Xo Ic bind-key
892: .Op Fl cnr
893: .Op Fl t Ar key-table
894: .Ar key Ar command Op Ar arguments
1.1 nicm 895: .Xc
1.57 jmc 896: .D1 (alias: Ic bind )
897: Bind key
898: .Ar key
899: to
900: .Ar command .
901: Keys may be specified prefixed with
902: .Ql C-
903: or
904: .Ql ^
905: for Ctrl keys, or
906: .Ql M-
907: for Alt (meta) keys.
908: .Pp
909: By default (without
910: .Fl t )
911: the primary key bindings are modified (those normally activated with the prefix
912: key); in this case, if
913: .Fl n
914: is specified, it is not necessary to use the prefix key,
915: .Ar command
916: is bound to
917: .Ar key
918: alone.
1.1 nicm 919: The
1.57 jmc 920: .Fl r
921: flag indicates this key may repeat, see the
922: .Ic repeat-time
923: option.
924: .Pp
925: If
926: .Fl t
927: is present,
928: .Ar key
929: is bound in
930: .Ar key-table :
931: the binding for command mode with
932: .Fl c
933: or for normal mode without.
934: To view the default bindings and possible commands, see the
935: .Ic list-keys
936: command.
937: .It Ic list-keys Op Fl t Ar key-table
938: .D1 (alias: Ic lsk )
939: List all key bindings.
940: Without
941: .Fl t
942: the primary key bindings - those executed when preceded by the prefix key -
943: are printed.
944: Keys bound without the prefix key (see
945: .Ic bind-key
946: .Fl n )
947: are enclosed in square brackets.
948: .Pp
949: With
950: .Fl t ,
951: the key bindings in
952: .Ar key-table
953: are listed; this may be one of:
954: .Em vi-edit ,
955: .Em emacs-edit ,
956: .Em vi-choice ,
957: .Em emacs-choice ,
958: .Em vi-copy
959: or
960: .Em emacs-copy .
961: .It Xo Ic send-keys
1.1 nicm 962: .Op Fl t Ar target-window
1.57 jmc 963: .Ar key Ar ...
1.1 nicm 964: .Xc
1.57 jmc 965: .D1 (alias: Ic send )
966: Send a key or keys to a window.
967: Each argument
968: .Ar key
969: is the name of the key (such as
970: .Ql C-a
971: or
972: .Ql npage
973: ) to send; if the string is not recognised as a key, it is sent as a series of
974: characters.
975: All arguments are sent sequentially from first to last.
976: .It Ic send-prefix Op Fl t Ar target-window
977: Send the prefix key to a window as if it was pressed.
978: .It Xo Ic unbind-key
979: .Op Fl cn
980: .Op Fl t Ar key-table
981: .Ar key
1.2 nicm 982: .Xc
1.57 jmc 983: .D1 (alias: Ic unbind )
984: Unbind the command bound to
985: .Ar key .
986: Without
987: .Fl t
988: the primary key bindings are modified; in this case, if
989: .Fl n
990: is specified, the command bound to
991: .Ar key
992: without a prefix (if any) is removed.
993: .Pp
1.47 nicm 994: If
1.57 jmc 995: .Fl t
996: is present,
997: .Ar key
998: in
999: .Ar key-table
1000: is unbound: the binding for command mode with
1001: .Fl c
1002: or for normal mode without.
1003: .El
1004: .Sh OPTIONS
1005: The appearance and behaviour of
1006: .Nm
1007: may be modified by changing the value of various options.
1008: There are two types of option:
1009: .Em session options
1010: and
1011: .Em window options .
1012: .Pp
1013: Each individual session may have a set of session options, and there is a
1014: separate set of global session options.
1015: Sessions which do not have a particular option configured inherit the value
1016: from the global session options.
1017: Session options are set or unset with the
1018: .Ic set-option
1019: command and may be listed with the
1020: .Ic show-options
1021: command.
1022: The available session options are listed under the
1023: .Ic set-option
1024: command.
1025: .Pp
1026: Similarly, a set of window options is attached to each window, and there is
1027: a set of global window options from which any unset options are inherited.
1028: Window options are altered with the
1029: .Ic set-window-option
1030: command and can be listed with the
1031: .Ic show-window-options
1032: command.
1033: All window options are documented with the
1034: .Ic set-window-option
1035: command.
1036: .Pp
1037: Commands which set options are as follows:
1038: .Bl -tag -width Ds
1.1 nicm 1039: .It Xo Ic set-option
1.58 nicm 1040: .Op Fl agu
1.1 nicm 1041: .Op Fl t Ar target-session
1042: .Ar option Ar value
1043: .Xc
1044: .D1 (alias: Ic set )
1.18 nicm 1045: Set a session option.
1.58 nicm 1046: With
1047: .Fl a ,
1048: and if the option expects a string,
1049: .Ar value
1050: is appended to the existing setting.
1.1 nicm 1051: If
1052: .Fl g
1.18 nicm 1053: is specified, the global session option is set.
1.1 nicm 1054: The
1055: .Fl u
1056: flag unsets an option, so a session inherits the option from the global
1057: options - it is not possible to unset a global option.
1058: .Pp
1.18 nicm 1059: Available session options are:
1.1 nicm 1060: .Bl -tag -width Ds
1061: .It Xo Ic bell-action
1.56 jmc 1062: .Op Ic any | none | current
1.1 nicm 1063: .Xc
1064: Set action on window bell.
1065: .Ic any
1066: means a bell in any window linked to a session causes a bell in the current
1067: window of that session,
1068: .Ic none
1069: means all bells are ignored and
1070: .Ic current
1071: means only bell in windows other than the current window are ignored.
1072: .It Ic buffer-limit Ar number
1073: Set the number of buffers kept for each session; as new buffers are added to
1074: the top of the stack, old ones are removed from the bottom if necessary to
1075: maintain this maximum length.
1076: .It Ic default-command Ar command
1077: Set the command used for new windows (if not specified when the window is
1078: created) to
1079: .Ar command .
1.19 nicm 1080: The default is an empty string, which instructs
1081: .Nm
1082: to create a login shell using the
1083: .Ev SHELL
1084: environment variable or, if it is unset, the user's shell returned by
1085: .Xr getpwuid 3 .
1.1 nicm 1086: .It Ic default-path Ar path
1087: Set the default working directory for processes created from keys, or
1088: interactively from the prompt.
1089: The default is the current working directory when the server is started.
1.22 nicm 1090: .It Ic default-terminal Ar terminal
1091: Set the default terminal for new windows created in this session - the
1092: default value of the
1093: .Ev TERM
1094: environment variable.
1095: For
1096: .Nm
1097: to work correctly, this
1098: .Em must
1099: be set to
1100: .Ql screen
1101: or a derivative of it.
1.21 nicm 1102: .It Ic display-time Ar time
1103: Set the amount of time for which status line messages are displayed.
1104: .Ar time
1105: is in milliseconds.
1.1 nicm 1106: .It Ic history-limit Ar lines
1107: Set the maximum number of lines held in window history.
1108: This setting applies only to new windows - existing window histories are not
1109: resized and retain the limit at the point they were created.
1110: .It Ic lock-after-time Ar number
1111: Lock the server after
1112: .Ar number
1113: seconds of inactivity.
1114: The default is off (set to 0).
1115: This has no effect as a session option; it must be set as a global option using
1116: .Fl g .
1117: .It Ic message-attr Ar attributes
1118: Set status line message attributes, where
1119: .Ar attributes
1120: is either
1121: .Ic default
1122: or a comma-delimited list of one or more of:
1123: .Ic bright
1124: (or
1125: .Ic bold ) ,
1126: .Ic dim ,
1127: .Ic underscore ,
1128: .Ic blink ,
1129: .Ic reverse ,
1130: .Ic hidden ,
1131: or
1132: .Ic italics .
1133: .It Ic message-bg Ar colour
1134: Set status line message background colour, where
1135: .Ar colour
1136: is one of:
1137: .Ic black ,
1138: .Ic red ,
1139: .Ic green ,
1140: .Ic yellow ,
1141: .Ic blue ,
1142: .Ic magenta ,
1143: .Ic cyan ,
1144: .Ic white
1145: or
1146: .Ic default .
1147: .It Ic message-fg Ar colour
1148: Set status line message foreground colour.
1149: .It Ic prefix Ar key
1150: Set the current prefix key.
1.21 nicm 1151: .It Ic repeat-time Ar time
1.1 nicm 1152: Allow multiple commands to be entered without pressing the prefix-key again
1153: in the specified
1.21 nicm 1154: .Ar time
1.1 nicm 1155: milliseconds (the default is 500).
1156: Whether a key repeats may be set when it is bound using the
1157: .Fl r
1158: flag to
1159: .Ic bind-key .
1.52 nicm 1160: Repeat is enabled for the default keys bound to the
1161: .Ic resize-pane
1162: command.
1.1 nicm 1163: .It Xo Ic set-remain-on-exit
1.56 jmc 1164: .Op Ic on | off
1.1 nicm 1165: .Xc
1166: Set the
1167: .Ic remain-on-exit
1168: window option for any windows first created in this session.
1169: .It Xo Ic set-titles
1.56 jmc 1170: .Op Ic on | off
1.1 nicm 1171: .Xc
1172: Attempt to set the window title using the \ee]2;...\e007 xterm code and
1173: the terminal appears to be an xterm.
1.11 nicm 1174: This option is off by default.
1.6 jmc 1175: Note that elinks
1.1 nicm 1176: will only attempt to set the window title if the STY environment
1177: variable is set.
1178: .It Xo Ic status
1.56 jmc 1179: .Op Ic on | off
1.1 nicm 1180: .Xc
1181: Show or hide the status line.
1182: .It Ic status-attr Ar attributes
1183: Set status line attributes.
1184: .It Ic status-bg Ar colour
1185: Set status line background colour.
1186: .It Ic status-fg Ar colour
1187: Set status line foreground colour.
1188: .It Ic status-interval Ar interval
1189: Update the status bar every
1190: .Ar interval
1191: seconds.
1192: By default, updates will occur every 15 seconds.
1193: A setting of zero disables redrawing at interval.
1.41 nicm 1194: .It Xo Ic status-justify
1.56 jmc 1195: .Op Ic left | centre | right
1.41 nicm 1196: .Xc
1197: Set the position of the window list component of the status line: left, centre
1198: or right justified.
1.1 nicm 1199: .It Xo Ic status-keys
1.56 jmc 1200: .Op Ic vi | emacs
1.1 nicm 1201: .Xc
1.6 jmc 1202: Use vi or emacs-style
1.1 nicm 1203: key bindings in the status line, for example at the command prompt.
1204: Defaults to emacs.
1205: .It Ic status-left Ar string
1206: Display
1207: .Ar string
1208: to the left of the status bar.
1209: .Ar string
1210: will be passed through
1211: .Xr strftime 3
1212: before being used.
1213: By default, the session name is shown.
1214: .Ar string
1215: may contain any of the following special character pairs:
1216: .Bl -column "Character pair" "Replaced with" -offset indent
1217: .It Sy "Character pair" Ta Sy "Replaced with"
1218: .It Li "#(command)" Ta "First line of command's output"
1219: .It Li "#H" Ta "Hostname of local host"
1.35 nicm 1220: .It Li "#I" Ta "Current window index"
1221: .It Li "#P" Ta "Current pane index"
1.1 nicm 1222: .It Li "#S" Ta "Session name"
1223: .It Li "#T" Ta "Current window title"
1.35 nicm 1224: .It Li "#W" Ta "Current window name"
1.1 nicm 1225: .It Li "##" Ta "A literal" Ql #
1226: .El
1227: .Pp
1228: Where appropriate, these may be prefixed with a number to specify the maximum
1229: length, for example
1230: .Ql #24T .
1.10 nicm 1231: .Pp
1.12 jmc 1232: By default, UTF-8 in
1.10 nicm 1233: .Ar string
1234: is not interpreted, to enable UTF-8, use the
1235: .Ic status-utf8
1236: option.
1.1 nicm 1237: .It Ic status-left-length Ar length
1238: Set the maximum
1239: .Ar length
1240: of the left component of the status bar.
1241: The default is 10.
1242: .It Ic status-right Ar string
1243: Display
1244: .Ar string
1245: to the right of the status bar.
1246: By default, the date and time will be shown.
1247: As with
1248: .Ic status-left ,
1249: .Ar string
1250: will be passed to
1.10 nicm 1251: .Xr strftime 3 ,
1252: character pairs are replaced, and UTF-8 is dependent on the
1253: .Ic status-utf8
1254: option.
1.1 nicm 1255: .It Ic status-right-length Ar length
1256: Set the maximum
1257: .Ar length
1258: of the right component of the status bar.
1259: The default is 40.
1.10 nicm 1260: .Pp
1261: .It Xo Ic status-utf8
1.56 jmc 1262: .Op Ic on | off
1.10 nicm 1263: .Xc
1264: Instruct
1265: .Nm
1266: to treat top-bit-set characters in the
1267: .Ic status-left
1268: and
1269: .Ic status-right
1270: strings as UTF-8; notably, this is important for wide characters.
1271: This option defaults to off.
1.55 jmc 1272: .It Ic terminal-overrides Ar string
1.54 nicm 1273: Contains a list of entries which override terminal descriptions read using
1274: .Xr terminfo 5 .
1275: .Ar string
1276: is a comma-separated list of items each a colon-separated string made up of a
1277: terminal type pattern (matched using
1278: .Xr fnmatch 3 )
1279: and a set of
1280: .Em name=value
1281: entries.
1282: .Pp
1283: For example, to set the
1284: .Ql clear
1285: .Xr terminfo 5
1286: entry to
1287: .Ql \ee[H\ee[2J
1288: for all terminal types and the
1289: .Ql dch1
1290: entry to
1291: .Ql \ee[P
1.55 jmc 1292: for the
1.54 nicm 1293: .Ql rxvt
1294: terminal type, the option could be set to the string:
1295: .Bd -literal -offset indent
1296: "*:clear=\ee[H\ee[2J,rxvt:dch1=\ee[P"
1297: .Ed
1298: .Pp
1299: The terminal entry value is passed through
1300: .Xr strunvis 3
1301: before interpretation.
1302: The default value forcibly corrects the
1303: .Ql colors
1304: entry for terminals which support 88 or 256 colours:
1305: .Bd -literal -offset indent
1306: "*88col*:colors=88,*256col*:colors=256"
1307: .Ed
1.37 nicm 1308: .It Xo Ic visual-activity
1.56 jmc 1309: .Op Ic on | off
1.37 nicm 1310: .Xc
1311: If on, display a status line message when activity occurs in a window
1.39 jmc 1312: for which the
1.37 nicm 1313: .Ic monitor-activity
1314: window option is enabled.
1315: .It Xo Ic visual-bell
1.56 jmc 1316: .Op Ic on | off
1.37 nicm 1317: .Xc
1318: If this option is on, a message is shown on a bell instead of it being passed
1319: through to the terminal (which normally makes a sound).
1320: Also see the
1321: .Ic bell-action
1322: option.
1323: .It Xo Ic visual-content
1.56 jmc 1324: .Op Ic on | off
1.37 nicm 1325: .Xc
1326: Like
1327: .Ic visual-activity ,
1328: display a message when content is present in a window
1.39 jmc 1329: for which the
1.37 nicm 1330: .Ic monitor-content
1331: window option is enabled.
1.1 nicm 1332: .El
1333: .It Xo Ic set-window-option
1.58 nicm 1334: .Op Fl agu
1.1 nicm 1335: .Op Fl t Ar target-window
1336: .Ar option Ar value
1337: .Xc
1338: .D1 (alias: Ic setw )
1.18 nicm 1339: Set a window option.
1.1 nicm 1340: The
1.58 nicm 1341: .Fl a ,
1.1 nicm 1342: .Fl g
1343: and
1344: .Fl u
1345: flags work similarly to the
1346: .Ic set-option
1347: command.
1348: .Pp
1.18 nicm 1349: Supported window options are:
1.56 jmc 1350: .Pp
1351: .Bl -tag -width Ds -compact
1.1 nicm 1352: .It Xo Ic aggressive-resize
1.56 jmc 1353: .Op Ic on | off
1.1 nicm 1354: .Xc
1355: Aggressively resize the chosen window.
1356: This means that
1357: .Nm
1358: will resize the window to the size of the smallest session for which it is the
1359: current window, rather than the smallest session to which it is attached.
1360: The window may resize when the current window is changed on another sessions;
1.6 jmc 1361: this option is good for full-screen programs which support
1362: .Dv SIGWINCH
1363: and poor for interactive programs such as shells.
1.56 jmc 1364: .Pp
1.1 nicm 1365: .It Xo Ic automatic-rename
1.56 jmc 1366: .Op Ic on | off
1.1 nicm 1367: .Xc
1368: Control automatic window renaming.
1369: When this setting is enabled,
1370: .Nm
1371: will attempt - on supported platforms - to rename the window to reflect the
1372: command currently running in it.
1373: This flag is automatically disabled for an individual window when a name
1374: is specified at creation with
1375: .Ic new-window or
1376: .Ic new-session ,
1377: or later with
1378: .Ic rename-window .
1379: It may be switched off globally with:
1380: .Bd -literal -offset indent
1381: set-window-option -g automatic-rename off
1382: .Ed
1.56 jmc 1383: .Pp
1.1 nicm 1384: .It Ic clock-mode-colour Ar colour
1385: Set clock colour.
1.56 jmc 1386: .Pp
1.1 nicm 1387: .It Xo Ic clock-mode-style
1.56 jmc 1388: .Op Ic 12 | 24
1.1 nicm 1389: .Xc
1390: Set clock hour format.
1.56 jmc 1391: .Pp
1.1 nicm 1392: .It Ic force-height Ar height
1393: .It Ic force-width Ar width
1394: Prevent
1395: .Nm
1396: from resizing a window to greater than
1397: .Ar width
1398: or
1399: .Ar height .
1400: A value of zero restores the default unlimited setting.
1.56 jmc 1401: .Pp
1.2 nicm 1402: .It Ic main-pane-width Ar width
1403: .It Ic main-pane-height Ar height
1404: Set the width or height of the main (left or top) pane in the
1405: .Ic main-horizontal
1406: or
1407: .Ic main-vertical
1408: layouts.
1.56 jmc 1409: .Pp
1.1 nicm 1410: .It Ic mode-attr Ar attributes
1411: Set window modes attributes.
1.56 jmc 1412: .Pp
1.1 nicm 1413: .It Ic mode-bg Ar colour
1414: Set window modes background colour.
1.56 jmc 1415: .Pp
1.1 nicm 1416: .It Ic mode-fg Ar colour
1417: Set window modes foreground colour.
1.56 jmc 1418: .Pp
1.1 nicm 1419: .It Xo Ic mode-keys
1.56 jmc 1420: .Op Ic vi | emacs
1.1 nicm 1421: .Xc
1.50 nicm 1422: Use vi or emacs-style key bindings in scroll, copy and choice modes.
1.1 nicm 1423: Key bindings default to emacs.
1.56 jmc 1424: .Pp
1.50 nicm 1425: .It Xo Ic mode-mouse
1.56 jmc 1426: .Op Ic on | off
1.50 nicm 1427: .Xc
1.51 jmc 1428: Mouse state in modes.
1429: If on,
1.50 nicm 1430: .Nm
1431: will respond to mouse clicks by moving the cursor in copy mode or selecting an
1432: option in choice mode.
1.56 jmc 1433: .Pp
1.1 nicm 1434: .It Xo Ic monitor-activity
1.56 jmc 1435: .Op Ic on | off
1.1 nicm 1436: .Xc
1437: Monitor for activity in the window.
1438: Windows with activity are highlighted in the status line.
1.56 jmc 1439: .Pp
1440: .It Ic monitor-content Ar match-string
1.6 jmc 1441: Monitor content in the window.
1442: When
1.16 nicm 1443: .Xr fnmatch 3
1444: pattern
1.1 nicm 1445: .Ar match-string
1446: appears in the window, it is highlighted in the status line.
1.56 jmc 1447: .Pp
1.1 nicm 1448: .It Xo Ic remain-on-exit
1.56 jmc 1449: .Op Ic on | off
1.1 nicm 1450: .Xc
1451: A window with this flag set is not destroyed when the program running in it
1452: exits.
1453: The window may be reactivated with the
1454: .Ic respawn-window
1455: command.
1.56 jmc 1456: .Pp
1.1 nicm 1457: .It Xo Ic utf8
1.56 jmc 1458: .Op Ic on | off
1.1 nicm 1459: .Xc
1460: Instructs
1461: .Nm
1462: to expect UTF-8 sequences to appear in this window.
1.56 jmc 1463: .Pp
1.1 nicm 1464: .It Ic window-status-attr Ar attributes
1465: Set status line attributes for a single window.
1.56 jmc 1466: .Pp
1.1 nicm 1467: .It Ic window-status-bg Ar colour
1468: Set status line background colour for a single window.
1.56 jmc 1469: .Pp
1.1 nicm 1470: .It Ic window-status-fg Ar colour
1471: Set status line foreground colour for a single window.
1.56 jmc 1472: .Pp
1.40 nicm 1473: .It Ic window-status-current-attr Ar attributes
1474: Set status line attributes for the currently active window.
1.56 jmc 1475: .Pp
1.40 nicm 1476: .It Ic window-status-current-bg Ar colour
1477: Set status line background colour for the currently active window.
1.56 jmc 1478: .Pp
1.40 nicm 1479: .It Ic window-status-current-fg Ar colour
1480: Set status line foreground colour for the currently active window.
1.56 jmc 1481: .Pp
1.1 nicm 1482: .It Xo Ic xterm-keys
1.56 jmc 1483: .Op Ic on | off
1.1 nicm 1484: .Xc
1485: If this option is set,
1486: .Nm
1487: will generate
1.57 jmc 1488: .Xr xterm 1 -style
1489: function key sequences; these have a number included to indicate modifiers such
1490: as Shift, Alt or Ctrl.
1491: .El
1492: .It Xo Ic show-options
1493: .Op Fl g
1494: .Op Fl t Ar target-session
1495: .Xc
1496: .D1 (alias: Ic show )
1497: Show the session options for
1498: .Ar target session ,
1499: or the global session options with
1500: .Fl g .
1501: .It Xo Ic show-window-options
1502: .Op Fl g
1503: .Op Fl t Ar target-window
1504: .Xc
1505: .D1 (alias: Ic showw )
1506: List the window options for
1507: .Ar target-window ,
1508: or the global window options if
1509: .Fl g
1510: is used.
1511: .El
1512: .Sh STATUS LINE
1513: .Nm
1514: includes an optional status line which is displayed in the bottom line of each
1515: terminal.
1516: By default, the status line is enabled (it may be disabled with the
1517: .Ic status
1518: session option) and contains, from left-to-right: the name of the current
1519: session in square brackets; the window list; the current window title in double
1520: quotes; and the time and date.
1521: .Pp
1522: The status line is made of three parts: configurable left and right sections
1523: (which may contain dynamic content such as the time or output from a shell
1524: command, see the
1525: .Ic status-left ,
1526: .Ic status-left-length ,
1527: .Ic status-right ,
1528: and
1529: .Ic status-right-length
1530: options below), and a central window list.
1531: The window list shows the index, name and (if any) flag of the windows
1532: present in the current session in ascending numerical order.
1533: The flag is one of the following symbols appended to the window name:
1534: .Bl -column "Symbol" "Meaning" -offset indent
1535: .It Sy "Symbol" Ta Sy "Meaning"
1536: .It Li "*" Ta "Denotes the current window."
1537: .It Li "-" Ta "Marks the last window (previously selected)."
1538: .It Li "#" Ta "Window is monitored and activity has been detected."
1539: .It Li "!" Ta "A bell has occurred in the window."
1540: .It Li "+" Ta "Window is monitored for content and it has appeared."
1541: .El
1542: .Pp
1543: The # symbol relates to the
1544: .Ic monitor-activity
1545: and + to the
1546: .Ic monitor-content
1547: window options.
1548: The window name is printed in inverted colours if an alert (bell, activity or
1549: content) is present.
1550: .Pp
1551: The colour and attributes of the status line may be configured, the entire status line using
1552: the
1553: .Ic status-attr ,
1554: .Ic status-fg
1555: and
1556: .Ic status-bg
1557: session options and individual windows using the
1558: .Ic window-status-attr ,
1559: .Ic window-status-fg
1560: and
1561: .Ic window-status-bg
1562: window options.
1563: .Pp
1564: The status line is automatically refreshed at interval if it has changed, the interval may be
1565: controlled with the
1566: .Ic status-interval
1567: session option.
1568: .Pp
1569: Commands related to the status line are as follows:
1570: .Bl -tag -width Ds
1571: .It Xo Ic command-prompt
1572: .Op Fl t Ar target-client
1573: .Op Ar template
1574: .Xc
1575: Open the command prompt in a client.
1576: This may be used from inside
1577: .Nm
1578: to execute commands interactively.
1579: If
1580: .Ar template
1581: is specified, it is used as the command; any %% in the template will be
1582: replaced by what is entered at the prompt.
1583: .It Xo Ic confirm-before
1584: .Op Fl t Ar target-client
1585: .Ar command
1586: .Xc
1587: .D1 (alias: Ic confirm )
1588: Ask for confirmation before executing
1589: .Ar command .
1590: This command works only from inside
1591: .Nm .
1592: .It Xo Ic display-message
1593: .Op Fl t Ar target-client
1594: .Op Ar message
1595: .Xc
1596: .D1 (alias: Ic display )
1597: Display a message (see the
1598: .Ic status-left
1599: option below)
1600: in the status line.
1601: .It Ic select-prompt Op Fl t Ar target-client
1602: Open a prompt inside
1603: .Ar target-client
1604: allowing a window index to be entered interactively.
1605: .El
1606: .Sh BUFFERS
1607: .Nm
1608: maintains a stack of
1609: .Em paste buffers
1610: for each session.
1611: Up to the value of the
1612: .Ic buffer-limit
1613: option are kept; when a new buffer is added, the buffer at the bottom of the
1614: stack is removed.
1615: Buffers may be added using
1616: .Ic copy-mode
1617: or the
1618: .Ic set-buffer
1619: command, and pasted into a window using the
1620: .Ic paste-buffer
1621: command.
1622: .Pp
1623: A configurable history buffer is also maintained for each window.
1624: By default, up to 2000 lines are kept; this can be altered with the
1625: .Ic history-limit
1626: option (see the
1627: .Ic set-option
1628: command above).
1629: .Pp
1630: The buffer commands are as follows:
1631: .Bl -tag -width Ds
1632: .It Ic clear-history Op Fl t Ar target-pane
1633: .D1 (alias: Ic clearhist )
1634: Remove and free the history for the specified pane.
1635: .It Xo Ic copy-buffer
1636: .Op Fl a Ar src-index
1637: .Op Fl b Ar dst-index
1638: .Op Fl s Ar src-session
1639: .Op Fl t Ar dst-session
1640: .Xc
1641: .D1 (alias: Ic copyb )
1642: Copy a session paste buffer to another session.
1643: If no sessions are specified, the current one is used instead.
1644: .It Xo Ic delete-buffer
1645: .Op Fl b Ar buffer-index
1646: .Op Fl t Ar target-session
1647: .Xc
1648: .D1 (alias: Ic deleteb )
1649: Delete the buffer at
1650: .Ar buffer-index ,
1651: or the top buffer if not specified.
1652: .It Ic list-buffers Op Fl t Ar target-session
1653: .D1 (alias: Ic lsb )
1654: List the buffers in the given session.
1655: .It Xo Ic load-buffer
1656: .Op Fl b Ar buffer-index
1657: .Op Fl t Ar target-session
1658: .Ar path
1659: .Xc
1660: .D1 (alias: Ic loadb )
1661: Load the contents of the specified paste buffer from
1662: .Ar path .
1663: .It Xo Ic paste-buffer
1664: .Op Fl dr
1665: .Op Fl b Ar buffer-index
1666: .Op Fl t Ar target-window
1667: .Xc
1668: .D1 (alias: Ic pasteb )
1669: Insert the contents of a paste buffer into the current window.
1670: With
1671: .Fl d ,
1672: also delete the paste buffer from the stack.
1673: When output, any linefeed (LF) characters in the paste buffer are replaced with
1674: carriage returns (CR).
1675: This translation may be disabled with the
1676: .Fl r
1677: flag.
1678: .It Xo Ic save-buffer
1679: .Op Fl a
1680: .Op Fl b Ar buffer-index
1681: .Op Fl t Ar target-session
1682: .Ar path
1683: .Xc
1684: .D1 (alias: Ic saveb )
1685: Save the contents of the specified paste buffer to
1686: .Ar path .
1687: The
1688: .Fl a
1689: option appends to rather than overwriting the file.
1690: .It Xo Ic set-buffer
1691: .Op Fl b Ar buffer-index
1692: .Op Fl t Ar target-session
1693: .Ar data
1694: .Xc
1695: .D1 (alias: Ic setb )
1696: Set the contents of the specified buffer to
1697: .Ar data .
1.1 nicm 1698: .It Xo Ic show-buffer
1699: .Op Fl b Ar buffer-index
1700: .Op Fl t Ar target-session
1701: .Xc
1702: .D1 (alias: Ic showb )
1703: Display the contents of the specified buffer.
1.57 jmc 1704: .El
1705: .Sh MISCELLANEOUS
1706: .Pp
1707: Miscellaneous commands are as follows:
1708: .Bl -tag -width Ds
1709: .It Ic clock-mode Op Fl t Ar target-window
1710: Display a large clock.
1711: .It Ic if-shell Ar shell-command command
1712: .D1 (alias: Ic if )
1713: Execute
1714: .Ar command
1715: if
1716: .Ar shell-command
1717: returns success.
1718: .It Ic lock-server
1719: .D1 (alias: Ic lock )
1720: Lock the server until a password is entered.
1721: .It Ic server-info
1722: .D1 (alias: Ic info )
1723: Show server information and terminal details.
1724: .It Xo Ic set-password
1725: .Op Fl c
1726: .Ar password
1.1 nicm 1727: .Xc
1.57 jmc 1728: .D1 (alias: Ic pass )
1729: Set the server password.
1730: If the
1.49 nicm 1731: .Fl c
1.57 jmc 1732: option is given, a pre-encrypted password may be specified.
1733: By default, the password is blank, thus any entered password will be accepted
1734: when unlocking the server (see the
1735: .Ic lock-server
1736: command).
1737: To prevent variable expansion when an encrypted password is read from a
1738: configuration file, enclose it in single quotes (').
1.1 nicm 1739: .El
1740: .Sh FILES
1.26 nicm 1741: .Bl -tag -width "/etc/tmux.confXXX" -compact
1.1 nicm 1742: .It Pa ~/.tmux.conf
1.6 jmc 1743: Default
1.1 nicm 1744: .Nm
1.6 jmc 1745: configuration file.
1.26 nicm 1746: .It Pa /etc/tmux.conf
1747: System-wide configuration file.
1.1 nicm 1748: .El
1.57 jmc 1749: .Sh EXAMPLES
1750: To create a new
1751: .Nm
1752: session running
1753: .Xr vi 1 :
1754: .Pp
1755: .Dl $ tmux new-session vi
1756: .Pp
1757: Most commands have a shorter form, known as an alias.
1758: For new-session, this is
1759: .Ic new :
1760: .Pp
1761: .Dl $ tmux new vi
1762: .Pp
1763: Alternatively, the shortest unambiguous form of a command is accepted.
1764: If there are several options, they are listed:
1765: .Bd -literal -offset indent
1766: $ tmux n
1767: ambiguous command: n, could be: new-session, new-window, next-window
1768: .Ed
1769: .Pp
1770: Within an active session, a new window may be created by typing
1771: .Ql C-b c
1772: (Ctrl
1773: followed by the
1774: .Ql b
1775: key
1776: followed by the
1777: .Ql c
1778: key).
1779: .Pp
1780: Windows may be navigated with:
1781: .Ql C-b 0
1782: (to select window 0),
1783: .Ql C-b 1
1784: (to select window 1), and so on;
1785: .Ql C-b n
1786: to select the next window; and
1787: .Ql C-b p
1788: to select the previous window.
1789: .Pp
1790: A session may be detached using
1791: .Ql C-b d
1792: and reattached with:
1793: .Pp
1794: .Dl $ tmux attach-session
1795: .Pp
1796: Typing
1797: .Ql C-b \&?
1798: lists the current key bindings in the current window; up and down may be used
1799: to navigate the list or
1800: .Ql q
1801: to exit from it.
1802: .Pp
1803: Commands to be run when the
1804: .Nm
1805: server is started may be placed in the
1806: .Pa ~/.tmux.conf
1807: configuration file.
1808: Common examples include:
1809: .Pp
1810: Changing the default prefix key:
1811: .Bd -literal -offset indent
1812: set-option -g prefix C-a
1813: unbind-key C-b
1814: bind-key C-a send-prefix
1815: .Ed
1816: .Pp
1817: Turning the status line off, or changing its colour:
1818: .Bd -literal -offset indent
1819: set-option -g status off
1820: set-option -g status-bg blue
1821: .Ed
1822: .Pp
1823: Setting other options, such as the default command,
1824: or locking after 30 minutes of inactivity:
1825: .Bd -literal -offset indent
1826: set-option -g default-command "exec /bin/ksh"
1827: set-option -g lock-after-time 1800
1828: .Ed
1829: .Pp
1830: Creating new key bindings:
1831: .Bd -literal -offset indent
1832: bind-key b set-option status
1833: bind-key / command-prompt "split-window 'exec man %%'"
1834: .Ed
1.1 nicm 1835: .Sh SEE ALSO
1836: .Xr pty 4
1837: .Sh AUTHORS
1838: .An Nicholas Marriott Aq nicm@users.sourceforge.net