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