1.\" $OpenBSD: tmux.1,v 1.826 2021/03/01 17:49:08 jmc 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: March 1 2021 $ 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 2CDluvV 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 Fl T Ar features 32.Op Ar command Op Ar flags 33.Ek 34.Sh DESCRIPTION 35.Nm 36is a terminal multiplexer: 37it enables a number of terminals to be created, accessed, and 38controlled from a single screen. 39.Nm 40may be detached from a screen 41and continue running in the background, 42then later reattached. 43.Pp 44When 45.Nm 46is started it creates a new 47.Em session 48with a single 49.Em window 50and displays it on screen. 51A status line at the bottom of the screen 52shows information on the current session 53and is used to enter interactive commands. 54.Pp 55A session is a single collection of 56.Em pseudo terminals 57under the management of 58.Nm . 59Each session has one or more 60windows linked to it. 61A window occupies the entire screen 62and may be split into rectangular panes, 63each of which is a separate pseudo terminal 64(the 65.Xr pty 4 66manual page documents the technical details of pseudo terminals). 67Any number of 68.Nm 69instances may connect to the same session, 70and any number of windows may be present in the same session. 71Once all sessions are killed, 72.Nm 73exits. 74.Pp 75Each session is persistent and will survive accidental disconnection 76(such as 77.Xr ssh 1 78connection timeout) or intentional detaching (with the 79.Ql C-b d 80key strokes). 81.Nm 82may be reattached using: 83.Pp 84.Dl $ tmux attach 85.Pp 86In 87.Nm , 88a session is displayed on screen by a 89.Em client 90and all sessions are managed by a single 91.Em server . 92The server and each client are separate processes which communicate through a 93socket in 94.Pa /tmp . 95.Pp 96The options are as follows: 97.Bl -tag -width "XXXXXXXXXXXX" 98.It Fl 2 99Force 100.Nm 101to assume the terminal supports 256 colours. 102This is equivalent to 103.Fl T Ar 256 . 104.It Fl C 105Start in control mode (see the 106.Sx CONTROL MODE 107section). 108Given twice 109.Xo ( Fl CC ) Xc 110disables echo. 111.It Fl c Ar shell-command 112Execute 113.Ar shell-command 114using the default shell. 115If necessary, the 116.Nm 117server will be started to retrieve the 118.Ic default-shell 119option. 120This option is for compatibility with 121.Xr sh 1 122when 123.Nm 124is used as a login shell. 125.It Fl D 126Do not start the 127.Nm 128server as a daemon. 129This also turns the 130.Ic exit-empty 131option off. 132With 133.Fl D , 134.Ar command 135may not be specified. 136.It Fl f Ar file 137Specify an alternative configuration file. 138By default, 139.Nm 140loads the system configuration file from 141.Pa /etc/tmux.conf , 142if present, then looks for a user configuration file at 143.Pa ~/.tmux.conf . 144.Pp 145The configuration file is a set of 146.Nm 147commands which are executed in sequence when the server is first started. 148.Nm 149loads configuration files once when the server process has started. 150The 151.Ic source-file 152command may be used to load a file later. 153.Pp 154.Nm 155shows any error messages from commands in configuration files in the first 156session created, and continues to process the rest of the configuration file. 157.It Fl L Ar socket-name 158.Nm 159stores the server socket in a directory under 160.Ev TMUX_TMPDIR 161or 162.Pa /tmp 163if it is unset. 164The default socket is named 165.Em default . 166This option allows a different socket name to be specified, allowing several 167independent 168.Nm 169servers to be run. 170Unlike 171.Fl S 172a full path is not necessary: the sockets are all created in a directory 173.Pa tmux-UID 174under the directory given by 175.Ev TMUX_TMPDIR 176or in 177.Pa /tmp . 178The 179.Pa tmux-UID 180directory is created by 181.Nm 182and must not be world readable, writable or executable. 183.Pp 184If the socket is accidentally removed, the 185.Dv SIGUSR1 186signal may be sent to the 187.Nm 188server process to recreate it (note that this will fail if any parent 189directories are missing). 190.It Fl l 191Behave as a login shell. 192This flag currently has no effect and is for compatibility with other shells 193when using tmux as a login shell. 194.It Fl N 195Do not start the server even if the command would normally do so (for example 196.Ic new-session 197or 198.Ic start-server ) . 199.It Fl S Ar socket-path 200Specify a full alternative path to the server socket. 201If 202.Fl S 203is specified, the default socket directory is not used and any 204.Fl L 205flag is ignored. 206.It Fl u 207Write UTF-8 output to the terminal even if the first environment 208variable of 209.Ev LC_ALL , 210.Ev LC_CTYPE , 211or 212.Ev LANG 213that is set does not contain 214.Qq UTF-8 215or 216.Qq UTF8 . 217This is equivalent to 218.Fl T Ar UTF-8 . 219.It Fl T Ar features 220Set terminal features for the client. 221This is a comma-separated list of features. 222See the 223.Ic terminal-features 224option. 225.It Fl v 226Request verbose logging. 227Log messages will be saved into 228.Pa tmux-client-PID.log 229and 230.Pa tmux-server-PID.log 231files in the current directory, where 232.Em PID 233is the PID of the server or client process. 234If 235.Fl v 236is specified twice, an additional 237.Pa tmux-out-PID.log 238file is generated with a copy of everything 239.Nm 240writes to the terminal. 241.Pp 242The 243.Dv SIGUSR2 244signal may be sent to the 245.Nm 246server process to toggle logging between on (as if 247.Fl v 248was given) and off. 249.It Fl V 250Report the 251.Nm 252version. 253.It Ar command Op Ar flags 254This specifies one of a set of commands used to control 255.Nm , 256as described in the following sections. 257If no commands are specified, the 258.Ic new-session 259command is assumed. 260.El 261.Sh DEFAULT KEY BINDINGS 262.Nm 263may be controlled from an attached client by using a key combination of a 264prefix key, 265.Ql C-b 266(Ctrl-b) by default, followed by a command key. 267.Pp 268The default command key bindings are: 269.Pp 270.Bl -tag -width "XXXXXXXXXX" -offset indent -compact 271.It C-b 272Send the prefix key (C-b) through to the application. 273.It C-o 274Rotate the panes in the current window forwards. 275.It C-z 276Suspend the 277.Nm 278client. 279.It ! 280Break the current pane out of the window. 281.It \&" 282.\" " 283Split the current pane into two, top and bottom. 284.It # 285List all paste buffers. 286.It $ 287Rename the current session. 288.It % 289Split the current pane into two, left and right. 290.It & 291Kill the current window. 292.It ' 293Prompt for a window index to select. 294.It \&( 295Switch the attached client to the previous session. 296.It \&) 297Switch the attached client to the next session. 298.It , 299Rename the current window. 300.It - 301Delete the most recently copied buffer of text. 302.It . 303Prompt for an index to move the current window. 304.It 0 to 9 305Select windows 0 to 9. 306.It : 307Enter the 308.Nm 309command prompt. 310.It ; 311Move to the previously active pane. 312.It = 313Choose which buffer to paste interactively from a list. 314.It \&? 315List all key bindings. 316.It D 317Choose a client to detach. 318.It L 319Switch the attached client back to the last session. 320.It \&[ 321Enter copy mode to copy text or view the history. 322.It \&] 323Paste the most recently copied buffer of text. 324.It c 325Create a new window. 326.It d 327Detach the current client. 328.It f 329Prompt to search for text in open windows. 330.It i 331Display some information about the current window. 332.It l 333Move to the previously selected window. 334.It m 335Mark the current pane (see 336.Ic select-pane 337.Fl m ) . 338.It M 339Clear the marked pane. 340.It n 341Change to the next window. 342.It o 343Select the next pane in the current window. 344.It p 345Change to the previous window. 346.It q 347Briefly display pane indexes. 348.It r 349Force redraw of the attached client. 350.It s 351Select a new session for the attached client interactively. 352.It t 353Show the time. 354.It w 355Choose the current window interactively. 356.It x 357Kill the current pane. 358.It z 359Toggle zoom state of the current pane. 360.It { 361Swap the current pane with the previous pane. 362.It } 363Swap the current pane with the next pane. 364.It ~ 365Show previous messages from 366.Nm , 367if any. 368.It Page Up 369Enter copy mode and scroll one page up. 370.It Up, Down 371.It Left, Right 372Change to the pane above, below, to the left, or to the right of the current 373pane. 374.It M-1 to M-5 375Arrange panes in one of the five preset layouts: even-horizontal, 376even-vertical, main-horizontal, main-vertical, or tiled. 377.It Space 378Arrange the current window in the next preset layout. 379.It M-n 380Move to the next window with a bell or activity marker. 381.It M-o 382Rotate the panes in the current window backwards. 383.It M-p 384Move to the previous window with a bell or activity marker. 385.It C-Up, C-Down 386.It C-Left, C-Right 387Resize the current pane in steps of one cell. 388.It M-Up, M-Down 389.It M-Left, M-Right 390Resize the current pane in steps of five cells. 391.El 392.Pp 393Key bindings may be changed with the 394.Ic bind-key 395and 396.Ic unbind-key 397commands. 398.Sh COMMAND PARSING AND EXECUTION 399.Nm 400supports a large number of commands which can be used to control its 401behaviour. 402Each command is named and can accept zero or more flags and arguments. 403They may be bound to a key with the 404.Ic bind-key 405command or run from the shell prompt, a shell script, a configuration file or 406the command prompt. 407For example, the same 408.Ic set-option 409command run from the shell prompt, from 410.Pa ~/.tmux.conf 411and bound to a key may look like: 412.Bd -literal -offset indent 413$ tmux set-option -g status-style bg=cyan 414 415set-option -g status-style bg=cyan 416 417bind-key C set-option -g status-style bg=cyan 418.Ed 419.Pp 420Here, the command name is 421.Ql set-option , 422.Ql Fl g 423is a flag and 424.Ql status-style 425and 426.Ql bg=cyan 427are arguments. 428.Pp 429.Nm 430distinguishes between command parsing and execution. 431In order to execute a command, 432.Nm 433needs it to be split up into its name and arguments. 434This is command parsing. 435If a command is run from the shell, the shell parses it; from inside 436.Nm 437or from a configuration file, 438.Nm 439does. 440Examples of when 441.Nm 442parses commands are: 443.Bl -dash -offset indent 444.It 445in a configuration file; 446.It 447typed at the command prompt (see 448.Ic command-prompt ) ; 449.It 450given to 451.Ic bind-key ; 452.It 453passed as arguments to 454.Ic if-shell 455or 456.Ic confirm-before . 457.El 458.Pp 459To execute commands, each client has a 460.Ql command queue . 461A global command queue not attached to any client is used on startup 462for configuration files like 463.Pa ~/.tmux.conf . 464Parsed commands added to the queue are executed in order. 465Some commands, like 466.Ic if-shell 467and 468.Ic confirm-before , 469parse their argument to create a new command which is inserted immediately 470after themselves. 471This means that arguments can be parsed twice or more - once when the parent command (such as 472.Ic if-shell ) 473is parsed and again when it parses and executes its command. 474Commands like 475.Ic if-shell , 476.Ic run-shell 477and 478.Ic display-panes 479stop execution of subsequent commands on the queue until something happens - 480.Ic if-shell 481and 482.Ic run-shell 483until a shell command finishes and 484.Ic display-panes 485until a key is pressed. 486For example, the following commands: 487.Bd -literal -offset indent 488new-session; new-window 489if-shell "true" "split-window" 490kill-session 491.Ed 492.Pp 493Will execute 494.Ic new-session , 495.Ic new-window , 496.Ic if-shell , 497the shell command 498.Xr true 1 , 499.Ic split-window 500and 501.Ic kill-session 502in that order. 503.Pp 504The 505.Sx COMMANDS 506section lists the 507.Nm 508commands and their arguments. 509.Sh PARSING SYNTAX 510This section describes the syntax of commands parsed by 511.Nm , 512for example in a configuration file or at the command prompt. 513Note that when commands are entered into the shell, they are parsed by the shell 514- see for example 515.Xr ksh 1 516or 517.Xr csh 1 . 518.Pp 519Each command is terminated by a newline or a semicolon (;). 520Commands separated by semicolons together form a 521.Ql command sequence 522- if a command in the sequence encounters an error, no subsequent commands are 523executed. 524.Pp 525It is recommended that a semicolon used as a command separator should be 526written as an individual token, for example from 527.Xr sh 1 : 528.Bd -literal -offset indent 529$ tmux neww \\; splitw 530.Ed 531.Pp 532Or: 533.Bd -literal -offset indent 534$ tmux neww ';' splitw 535.Ed 536.Pp 537Or from the tmux command prompt: 538.Bd -literal -offset indent 539neww ; splitw 540.Ed 541.Pp 542However, a trailing semicolon is also interpreted as a command separator, 543for example in these 544.Xr sh 1 545commands: 546.Bd -literal -offset indent 547$ tmux neww\e\e; splitw 548.Ed 549.Pp 550Or: 551.Bd -literal -offset indent 552$ tmux 'neww;' splitw 553.Ed 554.Pp 555As in these examples, when running tmux from the shell extra care must be taken 556to properly quote semicolons: 557.Bl -enum -offset Ds 558.It 559Semicolons that should be interpreted as a command separator 560should be escaped according to the shell conventions. 561For 562.Xr sh 1 563this typically means quoted (such as 564.Ql neww ';' splitw ) 565or escaped (such as 566.Ql neww \e\e\e\e; splitw ) . 567.It 568Individual semicolons or trailing semicolons that should be interpreted as 569arguments should be escaped twice: once according to the shell conventions and 570a second time for 571.Nm ; 572for example: 573.Bd -literal -offset indent 574$ tmux neww 'foo\e\e;' bar 575$ tmux neww foo\e\e\e\e; bar 576.Ed 577.It 578Semicolons that are not individual tokens or trailing another token should only 579be escaped once according to shell conventions; for example: 580.Bd -literal -offset indent 581$ tmux neww 'foo-;-bar' 582$ tmux neww foo-\e\e;-bar 583.Ed 584.El 585.Pp 586Comments are marked by the unquoted # character - any remaining text after a 587comment is ignored until the end of the line. 588.Pp 589If the last character of a line is \e, the line is joined with the following 590line (the \e and the newline are completely removed). 591This is called line continuation and applies both inside and outside quoted 592strings and in comments, but not inside braces. 593.Pp 594Command arguments may be specified as strings surrounded by single (') quotes, 595double quotes (") or braces ({}). 596.\" " 597This is required when the argument contains any special character. 598Single and double quoted strings cannot span multiple lines except with line 599continuation. 600Braces can span multiple lines. 601.Pp 602Outside of quotes and inside double quotes, these replacements are performed: 603.Bl -dash -offset indent 604.It 605Environment variables preceded by $ are replaced with their value from the 606global environment (see the 607.Sx GLOBAL AND SESSION ENVIRONMENT 608section). 609.It 610A leading ~ or ~user is expanded to the home directory of the current or 611specified user. 612.It 613\euXXXX or \euXXXXXXXX is replaced by the Unicode codepoint corresponding to 614the given four or eight digit hexadecimal number. 615.It 616When preceded (escaped) by a \e, the following characters are replaced: \ee by 617the escape character; \er by a carriage return; \en by a newline; and \et by a 618tab. 619.It 620\eooo is replaced by a character of the octal value ooo. 621Three octal digits are required, for example \e001. 622The largest valid character is \e377. 623.It 624Any other characters preceded by \e are replaced by themselves (that is, the \e 625is removed) and are not treated as having any special meaning - so for example 626\e; will not mark a command sequence and \e$ will not expand an environment 627variable. 628.El 629.Pp 630Braces are parsed as a configuration file (so conditions such as 631.Ql %if 632are processed) and then converted into a string. 633They are designed to avoid the need for additional escaping when passing a 634group of 635.Nm 636commands as an argument (for example to 637.Ic if-shell ) . 638These two examples produce an identical command - note that no escaping is 639needed when using {}: 640.Bd -literal -offset indent 641if-shell true { 642 display -p 'brace-dollar-foo: }$foo' 643} 644 645if-shell true "display -p 'brace-dollar-foo: }\e$foo'" 646.Ed 647.Pp 648Braces may be enclosed inside braces, for example: 649.Bd -literal -offset indent 650bind x if-shell "true" { 651 if-shell "true" { 652 display "true!" 653 } 654} 655.Ed 656.Pp 657Environment variables may be set by using the syntax 658.Ql name=value , 659for example 660.Ql HOME=/home/user . 661Variables set during parsing are added to the global environment. 662A hidden variable may be set with 663.Ql %hidden , 664for example: 665.Bd -literal -offset indent 666%hidden MYVAR=42 667.Ed 668.Pp 669Hidden variables are not passed to the environment of processes created 670by tmux. 671See the 672.Sx GLOBAL AND SESSION ENVIRONMENT 673section. 674.Pp 675Commands may be parsed conditionally by surrounding them with 676.Ql %if , 677.Ql %elif , 678.Ql %else 679and 680.Ql %endif . 681The argument to 682.Ql %if 683and 684.Ql %elif 685is expanded as a format (see 686.Sx FORMATS ) 687and if it evaluates to false (zero or empty), subsequent text is ignored until 688the closing 689.Ql %elif , 690.Ql %else 691or 692.Ql %endif . 693For example: 694.Bd -literal -offset indent 695%if "#{==:#{host},myhost}" 696set -g status-style bg=red 697%elif "#{==:#{host},myotherhost}" 698set -g status-style bg=green 699%else 700set -g status-style bg=blue 701%endif 702.Ed 703.Pp 704Will change the status line to red if running on 705.Ql myhost , 706green if running on 707.Ql myotherhost , 708or blue if running on another host. 709Conditionals may be given on one line, for example: 710.Bd -literal -offset indent 711%if #{==:#{host},myhost} set -g status-style bg=red %endif 712.Ed 713.Sh COMMANDS 714This section describes the commands supported by 715.Nm . 716Most commands accept the optional 717.Fl t 718(and sometimes 719.Fl s ) 720argument with one of 721.Ar target-client , 722.Ar target-session , 723.Ar target-window , 724or 725.Ar target-pane . 726These specify the client, session, window or pane which a command should affect. 727.Pp 728.Ar target-client 729should be the name of the client, 730typically the 731.Xr pty 4 732file to which the client is connected, for example either of 733.Pa /dev/ttyp1 734or 735.Pa ttyp1 736for the client attached to 737.Pa /dev/ttyp1 . 738If no client is specified, 739.Nm 740attempts to work out the client currently in use; if that fails, an error is 741reported. 742Clients may be listed with the 743.Ic list-clients 744command. 745.Pp 746.Ar target-session 747is tried as, in order: 748.Bl -enum -offset Ds 749.It 750A session ID prefixed with a $. 751.It 752An exact name of a session (as listed by the 753.Ic list-sessions 754command). 755.It 756The start of a session name, for example 757.Ql mysess 758would match a session named 759.Ql mysession . 760.It 761An 762.Xr fnmatch 3 763pattern which is matched against the session name. 764.El 765.Pp 766If the session name is prefixed with an 767.Ql = , 768only an exact match is accepted (so 769.Ql =mysess 770will only match exactly 771.Ql mysess , 772not 773.Ql mysession ) . 774.Pp 775If a single session is found, it is used as the target session; multiple matches 776produce an error. 777If a session is omitted, the current session is used if available; if no 778current session is available, the most recently used is chosen. 779.Pp 780.Ar target-window 781(or 782.Ar src-window 783or 784.Ar dst-window ) 785specifies a window in the form 786.Em session Ns \&: Ns Em window . 787.Em session 788follows the same rules as for 789.Ar target-session , 790and 791.Em window 792is looked for in order as: 793.Bl -enum -offset Ds 794.It 795A special token, listed below. 796.It 797A window index, for example 798.Ql mysession:1 799is window 1 in session 800.Ql mysession . 801.It 802A window ID, such as @1. 803.It 804An exact window name, such as 805.Ql mysession:mywindow . 806.It 807The start of a window name, such as 808.Ql mysession:mywin . 809.It 810As an 811.Xr fnmatch 3 812pattern matched against the window name. 813.El 814.Pp 815Like sessions, a 816.Ql = 817prefix will do an exact match only. 818An empty window name specifies the next unused index if appropriate (for 819example the 820.Ic new-window 821and 822.Ic link-window 823commands) 824otherwise the current window in 825.Em session 826is chosen. 827.Pp 828The following special tokens are available to indicate particular windows. 829Each has a single-character alternative form. 830.Bl -column "XXXXXXXXXX" "X" 831.It Sy "Token" Ta Sy "" Ta Sy "Meaning" 832.It Li "{start}" Ta "^" Ta "The lowest-numbered window" 833.It Li "{end}" Ta "$" Ta "The highest-numbered window" 834.It Li "{last}" Ta "!" Ta "The last (previously current) window" 835.It Li "{next}" Ta "+" Ta "The next window by number" 836.It Li "{previous}" Ta "-" Ta "The previous window by number" 837.El 838.Pp 839.Ar target-pane 840(or 841.Ar src-pane 842or 843.Ar dst-pane ) 844may be a pane ID or takes a similar form to 845.Ar target-window 846but with the optional addition of a period followed by a pane index or pane ID, 847for example: 848.Ql mysession:mywindow.1 . 849If the pane index is omitted, the currently active pane in the specified 850window is used. 851The following special tokens are available for the pane index: 852.Bl -column "XXXXXXXXXXXXXX" "X" 853.It Sy "Token" Ta Sy "" Ta Sy "Meaning" 854.It Li "{last}" Ta "!" Ta "The last (previously active) pane" 855.It Li "{next}" Ta "+" Ta "The next pane by number" 856.It Li "{previous}" Ta "-" Ta "The previous pane by number" 857.It Li "{top}" Ta "" Ta "The top pane" 858.It Li "{bottom}" Ta "" Ta "The bottom pane" 859.It Li "{left}" Ta "" Ta "The leftmost pane" 860.It Li "{right}" Ta "" Ta "The rightmost pane" 861.It Li "{top-left}" Ta "" Ta "The top-left pane" 862.It Li "{top-right}" Ta "" Ta "The top-right pane" 863.It Li "{bottom-left}" Ta "" Ta "The bottom-left pane" 864.It Li "{bottom-right}" Ta "" Ta "The bottom-right pane" 865.It Li "{up-of}" Ta "" Ta "The pane above the active pane" 866.It Li "{down-of}" Ta "" Ta "The pane below the active pane" 867.It Li "{left-of}" Ta "" Ta "The pane to the left of the active pane" 868.It Li "{right-of}" Ta "" Ta "The pane to the right of the active pane" 869.El 870.Pp 871The tokens 872.Ql + 873and 874.Ql - 875may be followed by an offset, for example: 876.Bd -literal -offset indent 877select-window -t:+2 878.Ed 879.Pp 880In addition, 881.Em target-session , 882.Em target-window 883or 884.Em target-pane 885may consist entirely of the token 886.Ql {mouse} 887(alternative form 888.Ql = ) 889to specify the session, window or pane where the most recent mouse event occurred 890(see the 891.Sx MOUSE SUPPORT 892section) 893or 894.Ql {marked} 895(alternative form 896.Ql ~ ) 897to specify the marked pane (see 898.Ic select-pane 899.Fl m ) . 900.Pp 901Sessions, window and panes are each numbered with a unique ID; session IDs are 902prefixed with a 903.Ql $ , 904windows with a 905.Ql @ , 906and panes with a 907.Ql % . 908These are unique and are unchanged for the life of the session, window or pane 909in the 910.Nm 911server. 912The pane ID is passed to the child process of the pane in the 913.Ev TMUX_PANE 914environment variable. 915IDs may be displayed using the 916.Ql session_id , 917.Ql window_id , 918or 919.Ql pane_id 920formats (see the 921.Sx FORMATS 922section) and the 923.Ic display-message , 924.Ic list-sessions , 925.Ic list-windows 926or 927.Ic list-panes 928commands. 929.Pp 930.Ar shell-command 931arguments are 932.Xr sh 1 933commands. 934This may be a single argument passed to the shell, for example: 935.Bd -literal -offset indent 936new-window 'vi ~/.tmux.conf' 937.Ed 938.Pp 939Will run: 940.Bd -literal -offset indent 941/bin/sh -c 'vi ~/.tmux.conf' 942.Ed 943.Pp 944Additionally, the 945.Ic new-window , 946.Ic new-session , 947.Ic split-window , 948.Ic respawn-window 949and 950.Ic respawn-pane 951commands allow 952.Ar shell-command 953to be given as multiple arguments and executed directly (without 954.Ql sh -c ) . 955This can avoid issues with shell quoting. 956For example: 957.Bd -literal -offset indent 958$ tmux new-window vi ~/.tmux.conf 959.Ed 960.Pp 961Will run 962.Xr vi 1 963directly without invoking the shell. 964.Pp 965.Ar command 966.Op Ar arguments 967refers to a 968.Nm 969command, either passed with the command and arguments separately, for example: 970.Bd -literal -offset indent 971bind-key F1 set-option status off 972.Ed 973.Pp 974Or passed as a single string argument in 975.Pa .tmux.conf , 976for example: 977.Bd -literal -offset indent 978bind-key F1 { set-option status off } 979.Ed 980.Pp 981Example 982.Nm 983commands include: 984.Bd -literal -offset indent 985refresh-client -t/dev/ttyp2 986 987rename-session -tfirst newname 988 989set-option -wt:0 monitor-activity on 990 991new-window ; split-window -d 992 993bind-key R source-file ~/.tmux.conf \e; \e 994 display-message "source-file done" 995.Ed 996.Pp 997Or from 998.Xr sh 1 : 999.Bd -literal -offset indent 1000$ tmux kill-window -t :1 1001 1002$ tmux new-window \e; split-window -d 1003 1004$ tmux new-session -d 'vi ~/.tmux.conf' \e; split-window -d \e; attach 1005.Ed 1006.Sh CLIENTS AND SESSIONS 1007The 1008.Nm 1009server manages clients, sessions, windows and panes. 1010Clients are attached to sessions to interact with them, either 1011when they are created with the 1012.Ic new-session 1013command, or later with the 1014.Ic attach-session 1015command. 1016Each session has one or more windows 1017.Em linked 1018into it. 1019Windows may be linked to multiple sessions and are made up of one or 1020more panes, 1021each of which contains a pseudo terminal. 1022Commands for creating, linking and otherwise manipulating windows 1023are covered 1024in the 1025.Sx WINDOWS AND PANES 1026section. 1027.Pp 1028The following commands are available to manage clients and sessions: 1029.Bl -tag -width Ds 1030.It Xo Ic attach-session 1031.Op Fl dErx 1032.Op Fl c Ar working-directory 1033.Op Fl f Ar flags 1034.Op Fl t Ar target-session 1035.Xc 1036.D1 (alias: Ic attach ) 1037If run from outside 1038.Nm , 1039create a new client in the current terminal and attach it to 1040.Ar target-session . 1041If used from inside, switch the current client. 1042If 1043.Fl d 1044is specified, any other clients attached to the session are detached. 1045If 1046.Fl x 1047is given, send 1048.Dv SIGHUP 1049to the parent process of the client as well as 1050detaching the client, typically causing it to exit. 1051.Fl f 1052sets a comma-separated list of client flags. 1053The flags are: 1054.Bl -tag -width Ds 1055.It active-pane 1056the client has an independent active pane 1057.It ignore-size 1058the client does not affect the size of other clients 1059.It no-output 1060the client does not receive pane output in control mode 1061.It pause-after=seconds 1062output is paused once the pane is 1063.Ar seconds 1064behind in control mode 1065.It read-only 1066the client is read-only 1067.It wait-exit 1068wait for an empty line input before exiting in control mode 1069.El 1070.Pp 1071A leading 1072.Ql \&! 1073turns a flag off if the client is already attached. 1074.Fl r 1075is an alias for 1076.Fl f 1077.Ar read-only,ignore-size . 1078When a client is read-only, only keys bound to the 1079.Ic detach-client 1080or 1081.Ic switch-client 1082commands have any effect. 1083A client with the 1084.Ar active-pane 1085flag allows the active pane to be selected independently of the window's active 1086pane used by clients without the flag. 1087This only affects the cursor position and commands issued from the client; 1088other features such as hooks and styles continue to use the window's active 1089pane. 1090.Pp 1091If no server is started, 1092.Ic attach-session 1093will attempt to start it; this will fail unless sessions are created in the 1094configuration file. 1095.Pp 1096The 1097.Ar target-session 1098rules for 1099.Ic attach-session 1100are slightly adjusted: if 1101.Nm 1102needs to select the most recently used session, it will prefer the most 1103recently used 1104.Em unattached 1105session. 1106.Pp 1107.Fl c 1108will set the session working directory (used for new windows) to 1109.Ar working-directory . 1110.Pp 1111If 1112.Fl E 1113is used, the 1114.Ic update-environment 1115option will not be applied. 1116.It Xo Ic detach-client 1117.Op Fl aP 1118.Op Fl E Ar shell-command 1119.Op Fl s Ar target-session 1120.Op Fl t Ar target-client 1121.Xc 1122.D1 (alias: Ic detach ) 1123Detach the current client if bound to a key, the client specified with 1124.Fl t , 1125or all clients currently attached to the session specified by 1126.Fl s . 1127The 1128.Fl a 1129option kills all but the client given with 1130.Fl t . 1131If 1132.Fl P 1133is given, send 1134.Dv SIGHUP 1135to the parent process of the client, typically causing it 1136to exit. 1137With 1138.Fl E , 1139run 1140.Ar shell-command 1141to replace the client. 1142.It Ic has-session Op Fl t Ar target-session 1143.D1 (alias: Ic has ) 1144Report an error and exit with 1 if the specified session does not exist. 1145If it does exist, exit with 0. 1146.It Ic kill-server 1147Kill the 1148.Nm 1149server and clients and destroy all sessions. 1150.It Xo Ic kill-session 1151.Op Fl aC 1152.Op Fl t Ar target-session 1153.Xc 1154Destroy the given session, closing any windows linked to it and no other 1155sessions, and detaching all clients attached to it. 1156If 1157.Fl a 1158is given, all sessions but the specified one is killed. 1159The 1160.Fl C 1161flag clears alerts (bell, activity, or silence) in all windows linked to the 1162session. 1163.It Xo Ic list-clients 1164.Op Fl F Ar format 1165.Op Fl t Ar target-session 1166.Xc 1167.D1 (alias: Ic lsc ) 1168List all clients attached to the server. 1169For the meaning of the 1170.Fl F 1171flag, see the 1172.Sx FORMATS 1173section. 1174If 1175.Ar target-session 1176is specified, list only clients connected to that session. 1177.It Xo Ic list-commands 1178.Op Fl F Ar format 1179.Op Ar command 1180.Xc 1181.D1 (alias: Ic lscm ) 1182List the syntax of 1183.Ar command 1184or - if omitted - of all commands supported by 1185.Nm . 1186.It Xo Ic list-sessions 1187.Op Fl F Ar format 1188.Op Fl f Ar filter 1189.Xc 1190.D1 (alias: Ic ls ) 1191List all sessions managed by the server. 1192.Fl F 1193specifies the format of each line and 1194.Fl f 1195a filter. 1196Only sessions for which the filter is true are shown. 1197See the 1198.Sx FORMATS 1199section. 1200.It Ic lock-client Op Fl t Ar target-client 1201.D1 (alias: Ic lockc ) 1202Lock 1203.Ar target-client , 1204see the 1205.Ic lock-server 1206command. 1207.It Ic lock-session Op Fl t Ar target-session 1208.D1 (alias: Ic locks ) 1209Lock all clients attached to 1210.Ar target-session . 1211.It Xo Ic new-session 1212.Op Fl AdDEPX 1213.Op Fl c Ar start-directory 1214.Op Fl e Ar environment 1215.Op Fl f Ar flags 1216.Op Fl F Ar format 1217.Op Fl n Ar window-name 1218.Op Fl s Ar session-name 1219.Op Fl t Ar group-name 1220.Op Fl x Ar width 1221.Op Fl y Ar height 1222.Op Ar shell-command 1223.Xc 1224.D1 (alias: Ic new ) 1225Create a new session with name 1226.Ar session-name . 1227.Pp 1228The new session is attached to the current terminal unless 1229.Fl d 1230is given. 1231.Ar window-name 1232and 1233.Ar shell-command 1234are the name of and shell command to execute in the initial window. 1235With 1236.Fl d , 1237the initial size comes from the global 1238.Ic default-size 1239option; 1240.Fl x 1241and 1242.Fl y 1243can be used to specify a different size. 1244.Ql - 1245uses the size of the current client if any. 1246If 1247.Fl x 1248or 1249.Fl y 1250is given, the 1251.Ic default-size 1252option is set for the session. 1253.Fl f 1254sets a comma-separated list of client flags (see 1255.Ic attach-session ) . 1256.Pp 1257If run from a terminal, any 1258.Xr termios 4 1259special characters are saved and used for new windows in the new session. 1260.Pp 1261The 1262.Fl A 1263flag makes 1264.Ic new-session 1265behave like 1266.Ic attach-session 1267if 1268.Ar session-name 1269already exists; in this case, 1270.Fl D 1271behaves like 1272.Fl d 1273to 1274.Ic attach-session , 1275and 1276.Fl X 1277behaves like 1278.Fl x 1279to 1280.Ic attach-session . 1281.Pp 1282If 1283.Fl t 1284is given, it specifies a 1285.Ic session group . 1286Sessions in the same group share the same set of windows - new windows are 1287linked to all sessions in the group and any windows closed removed from all 1288sessions. 1289The current and previous window and any session options remain independent and 1290any session in a group may be killed without affecting the others. 1291The 1292.Ar group-name 1293argument may be: 1294.Bl -enum -width Ds 1295.It 1296the name of an existing group, in which case the new session is added to that 1297group; 1298.It 1299the name of an existing session - the new session is added to the same group 1300as that session, creating a new group if necessary; 1301.It 1302the name for a new group containing only the new session. 1303.El 1304.Pp 1305.Fl n 1306and 1307.Ar shell-command 1308are invalid if 1309.Fl t 1310is used. 1311.Pp 1312The 1313.Fl P 1314option prints information about the new session after it has been created. 1315By default, it uses the format 1316.Ql #{session_name}:\& 1317but a different format may be specified with 1318.Fl F . 1319.Pp 1320If 1321.Fl E 1322is used, the 1323.Ic update-environment 1324option will not be applied. 1325.Fl e 1326takes the form 1327.Ql VARIABLE=value 1328and sets an environment variable for the newly created session; it may be 1329specified multiple times. 1330.It Xo Ic refresh-client 1331.Op Fl cDlLRSU 1332.Op Fl A Ar pane:state 1333.Op Fl B Ar name:what:format 1334.Op Fl C Ar XxY 1335.Op Fl f Ar flags 1336.Op Fl t Ar target-client 1337.Op Ar adjustment 1338.Xc 1339.D1 (alias: Ic refresh ) 1340Refresh the current client if bound to a key, or a single client if one is given 1341with 1342.Fl t . 1343If 1344.Fl S 1345is specified, only update the client's status line. 1346.Pp 1347The 1348.Fl U , 1349.Fl D , 1350.Fl L 1351.Fl R , 1352and 1353.Fl c 1354flags allow the visible portion of a window which is larger than the client 1355to be changed. 1356.Fl U 1357moves the visible part up by 1358.Ar adjustment 1359rows and 1360.Fl D 1361down, 1362.Fl L 1363left by 1364.Ar adjustment 1365columns and 1366.Fl R 1367right. 1368.Fl c 1369returns to tracking the cursor automatically. 1370If 1371.Ar adjustment 1372is omitted, 1 is used. 1373Note that the visible position is a property of the client not of the 1374window, changing the current window in the attached session will reset 1375it. 1376.Pp 1377.Fl C 1378sets the width and height of a control mode client. 1379.Fl A 1380allows a control mode client to trigger actions on a pane. 1381The argument is a pane ID (with leading 1382.Ql % ) , 1383a colon, then one of 1384.Ql on , 1385.Ql off , 1386.Ql continue 1387or 1388.Ql pause . 1389If 1390.Ql off , 1391.Nm 1392will not send output from the pane to the client and if all clients have turned 1393the pane off, will stop reading from the pane. 1394If 1395.Ql continue , 1396.Nm 1397will return to sending output to the pane if it was paused (manually or with the 1398.Ar pause-after 1399flag). 1400If 1401.Ql pause , 1402.Nm 1403will pause the pane. 1404.Fl A 1405may be given multiple times for different panes. 1406.Pp 1407.Fl B 1408sets a subscription to a format for a control mode client. 1409The argument is split into three items by colons: 1410.Ar name 1411is a name for the subscription; 1412.Ar what 1413is a type of item to subscribe to; 1414.Ar format 1415is the format. 1416After a subscription is added, changes to the format are reported with the 1417.Ic %subscription-changed 1418notification, at most once a second. 1419If only the name is given, the subscription is removed. 1420.Ar what 1421may be empty to check the format only for the attached session, or one of: 1422a pane ID such as 1423.Ql %0 ; 1424.Ql %* 1425for all panes in the attached session; 1426a window ID such as 1427.Ql @0 ; 1428or 1429.Ql @* 1430for all windows in the attached session. 1431.Pp 1432.Fl f 1433sets a comma-separated list of client flags, see 1434.Ic attach-session . 1435.Pp 1436.Fl l 1437requests the clipboard from the client using the 1438.Xr xterm 1 1439escape sequence and stores it in a new paste buffer. 1440.Pp 1441.Fl L , 1442.Fl R , 1443.Fl U 1444and 1445.Fl D 1446move the visible portion of the window left, right, up or down 1447by 1448.Ar adjustment , 1449if the window is larger than the client. 1450.Fl c 1451resets so that the position follows the cursor. 1452See the 1453.Ic window-size 1454option. 1455.It Xo Ic rename-session 1456.Op Fl t Ar target-session 1457.Ar new-name 1458.Xc 1459.D1 (alias: Ic rename ) 1460Rename the session to 1461.Ar new-name . 1462.It Xo Ic show-messages 1463.Op Fl JT 1464.Op Fl t Ar target-client 1465.Xc 1466.D1 (alias: Ic showmsgs ) 1467Show server messages or information. 1468Messages are stored, up to a maximum of the limit set by the 1469.Ar message-limit 1470server option. 1471.Fl J 1472and 1473.Fl T 1474show debugging information about jobs and terminals. 1475.It Xo Ic source-file 1476.Op Fl Fnqv 1477.Ar path 1478.Ar ... 1479.Xc 1480.D1 (alias: Ic source ) 1481Execute commands from one or more files specified by 1482.Ar path 1483(which may be 1484.Xr glob 7 1485patterns). 1486If 1487.Fl F 1488is present, then 1489.Ar path 1490is expanded as a format. 1491If 1492.Fl q 1493is given, no error will be returned if 1494.Ar path 1495does not exist. 1496With 1497.Fl n , 1498the file is parsed but no commands are executed. 1499.Fl v 1500shows the parsed commands and line numbers if possible. 1501.It Ic start-server 1502.D1 (alias: Ic start ) 1503Start the 1504.Nm 1505server, if not already running, without creating any sessions. 1506.Pp 1507Note that as by default the 1508.Nm 1509server will exit with no sessions, this is only useful if a session is created in 1510.Pa ~/.tmux.conf , 1511.Ic exit-empty 1512is turned off, or another command is run as part of the same command sequence. 1513For example: 1514.Bd -literal -offset indent 1515$ tmux start \\; show -g 1516.Ed 1517.It Xo Ic suspend-client 1518.Op Fl t Ar target-client 1519.Xc 1520.D1 (alias: Ic suspendc ) 1521Suspend a client by sending 1522.Dv SIGTSTP 1523(tty stop). 1524.It Xo Ic switch-client 1525.Op Fl ElnprZ 1526.Op Fl c Ar target-client 1527.Op Fl t Ar target-session 1528.Op Fl T Ar key-table 1529.Xc 1530.D1 (alias: Ic switchc ) 1531Switch the current session for client 1532.Ar target-client 1533to 1534.Ar target-session . 1535As a special case, 1536.Fl t 1537may refer to a pane (a target that contains 1538.Ql \&: , 1539.Ql \&. 1540or 1541.Ql % ) , 1542to change session, window and pane. 1543In that case, 1544.Fl Z 1545keeps the window zoomed if it was zoomed. 1546If 1547.Fl l , 1548.Fl n 1549or 1550.Fl p 1551is used, the client is moved to the last, next or previous session 1552respectively. 1553.Fl r 1554toggles the client 1555.Ic read-only 1556and 1557.Ic ignore-size 1558flags (see the 1559.Ic attach-session 1560command). 1561.Pp 1562If 1563.Fl E 1564is used, 1565.Ic update-environment 1566option will not be applied. 1567.Pp 1568.Fl T 1569sets the client's key table; the next key from the client will be interpreted 1570from 1571.Ar key-table . 1572This may be used to configure multiple prefix keys, or to bind commands to 1573sequences of keys. 1574For example, to make typing 1575.Ql abc 1576run the 1577.Ic list-keys 1578command: 1579.Bd -literal -offset indent 1580bind-key -Ttable2 c list-keys 1581bind-key -Ttable1 b switch-client -Ttable2 1582bind-key -Troot a switch-client -Ttable1 1583.Ed 1584.El 1585.Sh WINDOWS AND PANES 1586Each window displayed by 1587.Nm 1588may be split into one or more 1589.Em panes ; 1590each pane takes up a certain area of the display and is a separate terminal. 1591A window may be split into panes using the 1592.Ic split-window 1593command. 1594Windows may be split horizontally (with the 1595.Fl h 1596flag) or vertically. 1597Panes may be resized with the 1598.Ic resize-pane 1599command (bound to 1600.Ql C-Up , 1601.Ql C-Down 1602.Ql C-Left 1603and 1604.Ql C-Right 1605by default), the current pane may be changed with the 1606.Ic select-pane 1607command and the 1608.Ic rotate-window 1609and 1610.Ic swap-pane 1611commands may be used to swap panes without changing their position. 1612Panes are numbered beginning from zero in the order they are created. 1613.Pp 1614By default, a 1615.Nm 1616pane permits direct access to the terminal contained in the pane. 1617A pane may also be put into one of several modes: 1618.Bl -dash -offset indent 1619.It 1620Copy mode, which permits a section of a window or its 1621history to be copied to a 1622.Em paste buffer 1623for later insertion into another window. 1624This mode is entered with the 1625.Ic copy-mode 1626command, bound to 1627.Ql \&[ 1628by default. 1629Copied text can be pasted with the 1630.Ic paste-buffer 1631command, bound to 1632.Ql \&] . 1633.It 1634View mode, which is like copy mode but is entered when a command that produces 1635output, such as 1636.Ic list-keys , 1637is executed from a key binding. 1638.It 1639Choose mode, which allows an item to be chosen from a list. 1640This may be a client, a session or window or pane, or a buffer. 1641This mode is entered with the 1642.Ic choose-buffer , 1643.Ic choose-client 1644and 1645.Ic choose-tree 1646commands. 1647.El 1648.Pp 1649In copy mode an indicator is displayed in the top-right corner of the pane with 1650the current position and the number of lines in the history. 1651.Pp 1652Commands are sent to copy mode using the 1653.Fl X 1654flag to the 1655.Ic send-keys 1656command. 1657When a key is pressed, copy mode automatically uses one of two key tables, 1658depending on the 1659.Ic mode-keys 1660option: 1661.Ic copy-mode 1662for emacs, or 1663.Ic copy-mode-vi 1664for vi. 1665Key tables may be viewed with the 1666.Ic list-keys 1667command. 1668.Pp 1669The following commands are supported in copy mode: 1670.Bl -column "CommandXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent 1671.It Sy "Command" Ta Sy "vi" Ta Sy "emacs" 1672.It Li "append-selection" Ta "" Ta "" 1673.It Li "append-selection-and-cancel" Ta "A" Ta "" 1674.It Li "back-to-indentation" Ta "^" Ta "M-m" 1675.It Li "begin-selection" Ta "Space" Ta "C-Space" 1676.It Li "bottom-line" Ta "L" Ta "" 1677.It Li "cancel" Ta "q" Ta "Escape" 1678.It Li "clear-selection" Ta "Escape" Ta "C-g" 1679.It Li "copy-end-of-line [<prefix>]" Ta "D" Ta "C-k" 1680.It Li "copy-line [<prefix>]" Ta "" Ta "" 1681.It Li "copy-pipe [<command>] [<prefix>]" Ta "" Ta "" 1682.It Li "copy-pipe-no-clear [<command>] [<prefix>]" Ta "" Ta "" 1683.It Li "copy-pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta "" 1684.It Li "copy-selection [<prefix>]" Ta "" Ta "" 1685.It Li "copy-selection-no-clear [<prefix>]" Ta "" Ta "" 1686.It Li "copy-selection-and-cancel [<prefix>]" Ta "Enter" Ta "M-w" 1687.It Li "cursor-down" Ta "j" Ta "Down" 1688.It Li "cursor-down-and-cancel" Ta "" Ta "" 1689.It Li "cursor-left" Ta "h" Ta "Left" 1690.It Li "cursor-right" Ta "l" Ta "Right" 1691.It Li "cursor-up" Ta "k" Ta "Up" 1692.It Li "end-of-line" Ta "$" Ta "C-e" 1693.It Li "goto-line <line>" Ta ":" Ta "g" 1694.It Li "halfpage-down" Ta "C-d" Ta "M-Down" 1695.It Li "halfpage-down-and-cancel" Ta "" Ta "" 1696.It Li "halfpage-up" Ta "C-u" Ta "M-Up" 1697.It Li "history-bottom" Ta "G" Ta "M->" 1698.It Li "history-top" Ta "g" Ta "M-<" 1699.It Li "jump-again" Ta ";" Ta ";" 1700.It Li "jump-backward <to>" Ta "F" Ta "F" 1701.It Li "jump-forward <to>" Ta "f" Ta "f" 1702.It Li "jump-reverse" Ta "," Ta "," 1703.It Li "jump-to-backward <to>" Ta "T" Ta "" 1704.It Li "jump-to-forward <to>" Ta "t" Ta "" 1705.It Li "jump-to-mark" Ta "M-x" Ta "M-x" 1706.It Li "middle-line" Ta "M" Ta "M-r" 1707.It Li "next-matching-bracket" Ta "%" Ta "M-C-f" 1708.It Li "next-paragraph" Ta "}" Ta "M-}" 1709.It Li "next-space" Ta "W" Ta "" 1710.It Li "next-space-end" Ta "E" Ta "" 1711.It Li "next-word" Ta "w" Ta "" 1712.It Li "next-word-end" Ta "e" Ta "M-f" 1713.It Li "other-end" Ta "o" Ta "" 1714.It Li "page-down" Ta "C-f" Ta "PageDown" 1715.It Li "page-down-and-cancel" Ta "" Ta "" 1716.It Li "page-up" Ta "C-b" Ta "PageUp" 1717.It Li "pipe [<command>] [<prefix>]" Ta "" Ta "" 1718.It Li "pipe-no-clear [<command>] [<prefix>]" Ta "" Ta "" 1719.It Li "pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta "" 1720.It Li "previous-matching-bracket" Ta "" Ta "M-C-b" 1721.It Li "previous-paragraph" Ta "{" Ta "M-{" 1722.It Li "previous-space" Ta "B" Ta "" 1723.It Li "previous-word" Ta "b" Ta "M-b" 1724.It Li "rectangle-on" Ta "" Ta "" 1725.It Li "rectangle-off" Ta "" Ta "" 1726.It Li "rectangle-toggle" Ta "v" Ta "R" 1727.It Li "refresh-from-pane" Ta "r" Ta "r" 1728.It Li "scroll-down" Ta "C-e" Ta "C-Down" 1729.It Li "scroll-down-and-cancel" Ta "" Ta "" 1730.It Li "scroll-up" Ta "C-y" Ta "C-Up" 1731.It Li "search-again" Ta "n" Ta "n" 1732.It Li "search-backward <for>" Ta "?" Ta "" 1733.It Li "search-backward-incremental <for>" Ta "" Ta "C-r" 1734.It Li "search-backward-text <for>" Ta "" Ta "" 1735.It Li "search-forward <for>" Ta "/" Ta "" 1736.It Li "search-forward-incremental <for>" Ta "" Ta "C-s" 1737.It Li "search-forward-text <for>" Ta "" Ta "" 1738.It Li "search-reverse" Ta "N" Ta "N" 1739.It Li "select-line" Ta "V" Ta "" 1740.It Li "select-word" Ta "" Ta "" 1741.It Li "set-mark" Ta "X" Ta "X" 1742.It Li "start-of-line" Ta "0" Ta "C-a" 1743.It Li "stop-selection" Ta "" Ta "" 1744.It Li "top-line" Ta "H" Ta "M-R" 1745.El 1746.Pp 1747The search commands come in several varieties: 1748.Ql search-forward 1749and 1750.Ql search-backward 1751search for a regular expression; 1752the 1753.Ql -text 1754variants search for a plain text string rather than a regular expression; 1755.Ql -incremental 1756perform an incremental search and expect to be used with the 1757.Fl i 1758flag to the 1759.Ic command-prompt 1760command. 1761.Ql search-again 1762repeats the last search and 1763.Ql search-reverse 1764does the same but reverses the direction (forward becomes backward and backward 1765becomes forward). 1766.Pp 1767Copy commands may take an optional buffer prefix argument which is used 1768to generate the buffer name (the default is 1769.Ql buffer 1770so buffers are named 1771.Ql buffer0 , 1772.Ql buffer1 1773and so on). 1774Pipe commands take a command argument which is the command to which the 1775selected text is piped. 1776.Ql copy-pipe 1777variants also copy the selection. 1778The 1779.Ql -and-cancel 1780variants of some commands exit copy mode after they have completed (for copy 1781commands) or when the cursor reaches the bottom (for scrolling commands). 1782.Ql -no-clear 1783variants do not clear the selection. 1784.Pp 1785The next and previous word keys use space and the 1786.Ql - , 1787.Ql _ 1788and 1789.Ql @ 1790characters as word delimiters by default, but this can be adjusted by 1791setting the 1792.Em word-separators 1793session option. 1794Next word moves to the start of the next word, next word end to the end of the 1795next word and previous word to the start of the previous word. 1796The three next and previous space keys work similarly but use a space alone as 1797the word separator. 1798.Pp 1799The jump commands enable quick movement within a line. 1800For instance, typing 1801.Ql f 1802followed by 1803.Ql / 1804will move the cursor to the next 1805.Ql / 1806character on the current line. 1807A 1808.Ql \&; 1809will then jump to the next occurrence. 1810.Pp 1811Commands in copy mode may be prefaced by an optional repeat count. 1812With vi key bindings, a prefix is entered using the number keys; with 1813emacs, the Alt (meta) key and a number begins prefix entry. 1814.Pp 1815The synopsis for the 1816.Ic copy-mode 1817command is: 1818.Bl -tag -width Ds 1819.It Xo Ic copy-mode 1820.Op Fl eHMqu 1821.Op Fl s Ar src-pane 1822.Op Fl t Ar target-pane 1823.Xc 1824Enter copy mode. 1825The 1826.Fl u 1827option scrolls one page up. 1828.Fl M 1829begins a mouse drag (only valid if bound to a mouse key binding, see 1830.Sx MOUSE SUPPORT ) . 1831.Fl H 1832hides the position indicator in the top right. 1833.Fl q 1834cancels copy mode and any other modes. 1835.Fl s 1836copies from 1837.Ar src-pane 1838instead of 1839.Ar target-pane . 1840.Pp 1841.Fl e 1842specifies that scrolling to the bottom of the history (to the visible screen) 1843should exit copy mode. 1844While in copy mode, pressing a key other than those used for scrolling will 1845disable this behaviour. 1846This is intended to allow fast scrolling through a pane's history, for 1847example with: 1848.Bd -literal -offset indent 1849bind PageUp copy-mode -eu 1850.Ed 1851.El 1852.Pp 1853A number of preset arrangements of panes are available, these are called layouts. 1854These may be selected with the 1855.Ic select-layout 1856command or cycled with 1857.Ic next-layout 1858(bound to 1859.Ql Space 1860by default); once a layout is chosen, panes within it may be moved and resized 1861as normal. 1862.Pp 1863The following layouts are supported: 1864.Bl -tag -width Ds 1865.It Ic even-horizontal 1866Panes are spread out evenly from left to right across the window. 1867.It Ic even-vertical 1868Panes are spread evenly from top to bottom. 1869.It Ic main-horizontal 1870A large (main) pane is shown at the top of the window and the remaining panes 1871are spread from left to right in the leftover space at the bottom. 1872Use the 1873.Em main-pane-height 1874window option to specify the height of the top pane. 1875.It Ic main-vertical 1876Similar to 1877.Ic main-horizontal 1878but the large pane is placed on the left and the others spread from top to 1879bottom along the right. 1880See the 1881.Em main-pane-width 1882window option. 1883.It Ic tiled 1884Panes are spread out as evenly as possible over the window in both rows and 1885columns. 1886.El 1887.Pp 1888In addition, 1889.Ic select-layout 1890may be used to apply a previously used layout - the 1891.Ic list-windows 1892command displays the layout of each window in a form suitable for use with 1893.Ic select-layout . 1894For example: 1895.Bd -literal -offset indent 1896$ tmux list-windows 18970: ksh [159x48] 1898 layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0} 1899$ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0} 1900.Ed 1901.Pp 1902.Nm 1903automatically adjusts the size of the layout for the current window size. 1904Note that a layout cannot be applied to a window with more panes than that 1905from which the layout was originally defined. 1906.Pp 1907Commands related to windows and panes are as follows: 1908.Bl -tag -width Ds 1909.It Xo Ic break-pane 1910.Op Fl abdP 1911.Op Fl F Ar format 1912.Op Fl n Ar window-name 1913.Op Fl s Ar src-pane 1914.Op Fl t Ar dst-window 1915.Xc 1916.D1 (alias: Ic breakp ) 1917Break 1918.Ar src-pane 1919off from its containing window to make it the only pane in 1920.Ar dst-window . 1921With 1922.Fl a 1923or 1924.Fl b , 1925the window is moved to the next index after or before (existing windows are 1926moved if necessary). 1927If 1928.Fl d 1929is given, the new window does not become the current window. 1930The 1931.Fl P 1932option prints information about the new window after it has been created. 1933By default, it uses the format 1934.Ql #{session_name}:#{window_index}.#{pane_index} 1935but a different format may be specified with 1936.Fl F . 1937.It Xo Ic capture-pane 1938.Op Fl aepPqCJN 1939.Op Fl b Ar buffer-name 1940.Op Fl E Ar end-line 1941.Op Fl S Ar start-line 1942.Op Fl t Ar target-pane 1943.Xc 1944.D1 (alias: Ic capturep ) 1945Capture the contents of a pane. 1946If 1947.Fl p 1948is given, the output goes to stdout, otherwise to the buffer specified with 1949.Fl b 1950or a new buffer if omitted. 1951If 1952.Fl a 1953is given, the alternate screen is used, and the history is not accessible. 1954If no alternate screen exists, an error will be returned unless 1955.Fl q 1956is given. 1957If 1958.Fl e 1959is given, the output includes escape sequences for text and background 1960attributes. 1961.Fl C 1962also escapes non-printable characters as octal \exxx. 1963.Fl N 1964preserves trailing spaces at each line's end and 1965.Fl J 1966preserves trailing spaces and joins any wrapped lines. 1967.Fl P 1968captures only any output that the pane has received that is the beginning of an 1969as-yet incomplete escape sequence. 1970.Pp 1971.Fl S 1972and 1973.Fl E 1974specify the starting and ending line numbers, zero is the first line of the 1975visible pane and negative numbers are lines in the history. 1976.Ql - 1977to 1978.Fl S 1979is the start of the history and to 1980.Fl E 1981the end of the visible pane. 1982The default is to capture only the visible contents of the pane. 1983.It Xo 1984.Ic choose-client 1985.Op Fl NrZ 1986.Op Fl F Ar format 1987.Op Fl f Ar filter 1988.Op Fl O Ar sort-order 1989.Op Fl t Ar target-pane 1990.Op Ar template 1991.Xc 1992Put a pane into client mode, allowing a client to be selected interactively from 1993a list. 1994.Fl Z 1995zooms the pane. 1996The following keys may be used in client mode: 1997.Bl -column "Key" "Function" -offset indent 1998.It Sy "Key" Ta Sy "Function" 1999.It Li "Enter" Ta "Choose selected client" 2000.It Li "Up" Ta "Select previous client" 2001.It Li "Down" Ta "Select next client" 2002.It Li "C-s" Ta "Search by name" 2003.It Li "n" Ta "Repeat last search" 2004.It Li "t" Ta "Toggle if client is tagged" 2005.It Li "T" Ta "Tag no clients" 2006.It Li "C-t" Ta "Tag all clients" 2007.It Li "d" Ta "Detach selected client" 2008.It Li "D" Ta "Detach tagged clients" 2009.It Li "x" Ta "Detach and HUP selected client" 2010.It Li "X" Ta "Detach and HUP tagged clients" 2011.It Li "z" Ta "Suspend selected client" 2012.It Li "Z" Ta "Suspend tagged clients" 2013.It Li "f" Ta "Enter a format to filter items" 2014.It Li "O" Ta "Change sort field" 2015.It Li "r" Ta "Reverse sort order" 2016.It Li "v" Ta "Toggle preview" 2017.It Li "q" Ta "Exit mode" 2018.El 2019.Pp 2020After a client is chosen, 2021.Ql %% 2022is replaced by the client name in 2023.Ar template 2024and the result executed as a command. 2025If 2026.Ar template 2027is not given, "detach-client -t '%%'" is used. 2028.Pp 2029.Fl O 2030specifies the initial sort field: one of 2031.Ql name , 2032.Ql size , 2033.Ql creation , 2034or 2035.Ql activity . 2036.Fl r 2037reverses the sort order. 2038.Fl f 2039specifies an initial filter: the filter is a format - if it evaluates to zero, 2040the item in the list is not shown, otherwise it is shown. 2041If a filter would lead to an empty list, it is ignored. 2042.Fl F 2043specifies the format for each item in the list. 2044.Fl N 2045starts without the preview. 2046This command works only if at least one client is attached. 2047.It Xo 2048.Ic choose-tree 2049.Op Fl GNrswZ 2050.Op Fl F Ar format 2051.Op Fl f Ar filter 2052.Op Fl O Ar sort-order 2053.Op Fl t Ar target-pane 2054.Op Ar template 2055.Xc 2056Put a pane into tree mode, where a session, window or pane may be chosen 2057interactively from a list. 2058.Fl s 2059starts with sessions collapsed and 2060.Fl w 2061with windows collapsed. 2062.Fl Z 2063zooms the pane. 2064The following keys may be used in tree mode: 2065.Bl -column "Key" "Function" -offset indent 2066.It Sy "Key" Ta Sy "Function" 2067.It Li "Enter" Ta "Choose selected item" 2068.It Li "Up" Ta "Select previous item" 2069.It Li "Down" Ta "Select next item" 2070.It Li "+" Ta "Expand selected item" 2071.It Li "-" Ta "Collapse selected item" 2072.It Li "M-+" Ta "Expand all items" 2073.It Li "M--" Ta "Collapse all items" 2074.It Li "x" Ta "Kill selected item" 2075.It Li "X" Ta "Kill tagged items" 2076.It Li "<" Ta "Scroll list of previews left" 2077.It Li ">" Ta "Scroll list of previews right" 2078.It Li "C-s" Ta "Search by name" 2079.It Li "m" Ta "Set the marked pane" 2080.It Li "M" Ta "Clear the marked pane" 2081.It Li "n" Ta "Repeat last search" 2082.It Li "t" Ta "Toggle if item is tagged" 2083.It Li "T" Ta "Tag no items" 2084.It Li "C-t" Ta "Tag all items" 2085.It Li "\&:" Ta "Run a command for each tagged item" 2086.It Li "f" Ta "Enter a format to filter items" 2087.It Li "H" Ta "Jump to the starting pane" 2088.It Li "O" Ta "Change sort field" 2089.It Li "r" Ta "Reverse sort order" 2090.It Li "v" Ta "Toggle preview" 2091.It Li "q" Ta "Exit mode" 2092.El 2093.Pp 2094After a session, window or pane is chosen, 2095.Ql %% 2096is replaced by the target in 2097.Ar template 2098and the result executed as a command. 2099If 2100.Ar template 2101is not given, "switch-client -t '%%'" is used. 2102.Pp 2103.Fl O 2104specifies the initial sort field: one of 2105.Ql index , 2106.Ql name , 2107or 2108.Ql time . 2109.Fl r 2110reverses the sort order. 2111.Fl f 2112specifies an initial filter: the filter is a format - if it evaluates to zero, 2113the item in the list is not shown, otherwise it is shown. 2114If a filter would lead to an empty list, it is ignored. 2115.Fl F 2116specifies the format for each item in the tree. 2117.Fl N 2118starts without the preview. 2119.Fl G 2120includes all sessions in any session groups in the tree rather than only the 2121first. 2122This command works only if at least one client is attached. 2123.It Xo 2124.Ic customize-mode 2125.Op Fl NZ 2126.Op Fl F Ar format 2127.Op Fl f Ar filter 2128.Op Fl t Ar target-pane 2129.Op Ar template 2130.Xc 2131Put a pane into customize mode, where options and key bindings may be browsed 2132and modified from a list. 2133Option values in the list are shown for the active pane in the current window. 2134.Fl Z 2135zooms the pane. 2136The following keys may be used in customize mode: 2137.Bl -column "Key" "Function" -offset indent 2138.It Sy "Key" Ta Sy "Function" 2139.It Li "Enter" Ta "Set pane, window, session or global option value" 2140.It Li "Up" Ta "Select previous item" 2141.It Li "Down" Ta "Select next item" 2142.It Li "+" Ta "Expand selected item" 2143.It Li "-" Ta "Collapse selected item" 2144.It Li "M-+" Ta "Expand all items" 2145.It Li "M--" Ta "Collapse all items" 2146.It Li "s" Ta "Set option value or key attribute" 2147.It Li "S" Ta "Set global option value" 2148.It Li "w" Ta "Set window option value, if option is for pane and window" 2149.It Li "d" Ta "Set an option or key to the default" 2150.It Li "D" Ta "Set tagged options and tagged keys to the default" 2151.It Li "u" Ta "Unset an option (set to default value if global) or unbind a key" 2152.It Li "U" Ta "Unset tagged options and unbind tagged keys" 2153.It Li "C-s" Ta "Search by name" 2154.It Li "n" Ta "Repeat last search" 2155.It Li "t" Ta "Toggle if item is tagged" 2156.It Li "T" Ta "Tag no items" 2157.It Li "C-t" Ta "Tag all items" 2158.It Li "f" Ta "Enter a format to filter items" 2159.It Li "v" Ta "Toggle option information" 2160.It Li "q" Ta "Exit mode" 2161.El 2162.Pp 2163.Fl f 2164specifies an initial filter: the filter is a format - if it evaluates to zero, 2165the item in the list is not shown, otherwise it is shown. 2166If a filter would lead to an empty list, it is ignored. 2167.Fl F 2168specifies the format for each item in the tree. 2169.Fl N 2170starts without the option information. 2171This command works only if at least one client is attached. 2172.It Xo 2173.Ic display-panes 2174.Op Fl bN 2175.Op Fl d Ar duration 2176.Op Fl t Ar target-client 2177.Op Ar template 2178.Xc 2179.D1 (alias: Ic displayp ) 2180Display a visible indicator of each pane shown by 2181.Ar target-client . 2182See the 2183.Ic display-panes-colour 2184and 2185.Ic display-panes-active-colour 2186session options. 2187The indicator is closed when a key is pressed (unless 2188.Fl N 2189is given) or 2190.Ar duration 2191milliseconds have passed. 2192If 2193.Fl d 2194is not given, 2195.Ic display-panes-time 2196is used. 2197A duration of zero means the indicator stays until a key is pressed. 2198While the indicator is on screen, a pane may be chosen with the 2199.Ql 0 2200to 2201.Ql 9 2202keys, which will cause 2203.Ar template 2204to be executed as a command with 2205.Ql %% 2206substituted by the pane ID. 2207The default 2208.Ar template 2209is "select-pane -t '%%'". 2210With 2211.Fl b , 2212other commands are not blocked from running until the indicator is closed. 2213.It Xo Ic find-window 2214.Op Fl iCNrTZ 2215.Op Fl t Ar target-pane 2216.Ar match-string 2217.Xc 2218.D1 (alias: Ic findw ) 2219Search for a 2220.Xr fnmatch 3 2221pattern or, with 2222.Fl r , 2223regular expression 2224.Ar match-string 2225in window names, titles, and visible content (but not history). 2226The flags control matching behavior: 2227.Fl C 2228matches only visible window contents, 2229.Fl N 2230matches only the window name and 2231.Fl T 2232matches only the window title. 2233.Fl i 2234makes the search ignore case. 2235The default is 2236.Fl CNT . 2237.Fl Z 2238zooms the pane. 2239.Pp 2240This command works only if at least one client is attached. 2241.It Xo Ic join-pane 2242.Op Fl bdfhv 2243.Op Fl l Ar size 2244.Op Fl s Ar src-pane 2245.Op Fl t Ar dst-pane 2246.Xc 2247.D1 (alias: Ic joinp ) 2248Like 2249.Ic split-window , 2250but instead of splitting 2251.Ar dst-pane 2252and creating a new pane, split it and move 2253.Ar src-pane 2254into the space. 2255This can be used to reverse 2256.Ic break-pane . 2257The 2258.Fl b 2259option causes 2260.Ar src-pane 2261to be joined to left of or above 2262.Ar dst-pane . 2263.Pp 2264If 2265.Fl s 2266is omitted and a marked pane is present (see 2267.Ic select-pane 2268.Fl m ) , 2269the marked pane is used rather than the current pane. 2270.It Xo Ic kill-pane 2271.Op Fl a 2272.Op Fl t Ar target-pane 2273.Xc 2274.D1 (alias: Ic killp ) 2275Destroy the given pane. 2276If no panes remain in the containing window, it is also destroyed. 2277The 2278.Fl a 2279option kills all but the pane given with 2280.Fl t . 2281.It Xo Ic kill-window 2282.Op Fl a 2283.Op Fl t Ar target-window 2284.Xc 2285.D1 (alias: Ic killw ) 2286Kill the current window or the window at 2287.Ar target-window , 2288removing it from any sessions to which it is linked. 2289The 2290.Fl a 2291option kills all but the window given with 2292.Fl t . 2293.It Xo Ic last-pane 2294.Op Fl deZ 2295.Op Fl t Ar target-window 2296.Xc 2297.D1 (alias: Ic lastp ) 2298Select the last (previously selected) pane. 2299.Fl Z 2300keeps the window zoomed if it was zoomed. 2301.Fl e 2302enables or 2303.Fl d 2304disables input to the pane. 2305.It Ic last-window Op Fl t Ar target-session 2306.D1 (alias: Ic last ) 2307Select the last (previously selected) window. 2308If no 2309.Ar target-session 2310is specified, select the last window of the current session. 2311.It Xo Ic link-window 2312.Op Fl abdk 2313.Op Fl s Ar src-window 2314.Op Fl t Ar dst-window 2315.Xc 2316.D1 (alias: Ic linkw ) 2317Link the window at 2318.Ar src-window 2319to the specified 2320.Ar dst-window . 2321If 2322.Ar dst-window 2323is specified and no such window exists, the 2324.Ar src-window 2325is linked there. 2326With 2327.Fl a 2328or 2329.Fl b 2330the window is moved to the next index after or before 2331.Ar dst-window 2332(existing windows are moved if necessary). 2333If 2334.Fl k 2335is given and 2336.Ar dst-window 2337exists, it is killed, otherwise an error is generated. 2338If 2339.Fl d 2340is given, the newly linked window is not selected. 2341.It Xo Ic list-panes 2342.Op Fl as 2343.Op Fl F Ar format 2344.Op Fl f Ar filter 2345.Op Fl t Ar target 2346.Xc 2347.D1 (alias: Ic lsp ) 2348If 2349.Fl a 2350is given, 2351.Ar target 2352is ignored and all panes on the server are listed. 2353If 2354.Fl s 2355is given, 2356.Ar target 2357is a session (or the current session). 2358If neither is given, 2359.Ar target 2360is a window (or the current window). 2361.Fl F 2362specifies the format of each line and 2363.Fl f 2364a filter. 2365Only panes for which the filter is true are shown. 2366See the 2367.Sx FORMATS 2368section. 2369.It Xo Ic list-windows 2370.Op Fl a 2371.Op Fl F Ar format 2372.Op Fl f Ar filter 2373.Op Fl t Ar target-session 2374.Xc 2375.D1 (alias: Ic lsw ) 2376If 2377.Fl a 2378is given, list all windows on the server. 2379Otherwise, list windows in the current session or in 2380.Ar target-session . 2381.Fl F 2382specifies the format of each line and 2383.Fl f 2384a filter. 2385Only windows for which the filter is true are shown. 2386See the 2387.Sx FORMATS 2388section. 2389.It Xo Ic move-pane 2390.Op Fl bdfhv 2391.Op Fl l Ar size 2392.Op Fl s Ar src-pane 2393.Op Fl t Ar dst-pane 2394.Xc 2395.D1 (alias: Ic movep ) 2396Does the same as 2397.Ic join-pane . 2398.It Xo Ic move-window 2399.Op Fl abrdk 2400.Op Fl s Ar src-window 2401.Op Fl t Ar dst-window 2402.Xc 2403.D1 (alias: Ic movew ) 2404This is similar to 2405.Ic link-window , 2406except the window at 2407.Ar src-window 2408is moved to 2409.Ar dst-window . 2410With 2411.Fl r , 2412all windows in the session are renumbered in sequential order, respecting 2413the 2414.Ic base-index 2415option. 2416.It Xo Ic new-window 2417.Op Fl abdkPS 2418.Op Fl c Ar start-directory 2419.Op Fl e Ar environment 2420.Op Fl F Ar format 2421.Op Fl n Ar window-name 2422.Op Fl t Ar target-window 2423.Op Ar shell-command 2424.Xc 2425.D1 (alias: Ic neww ) 2426Create a new window. 2427With 2428.Fl a 2429or 2430.Fl b , 2431the new window is inserted at the next index after or before the specified 2432.Ar target-window , 2433moving windows up if necessary; 2434otherwise 2435.Ar target-window 2436is the new window location. 2437.Pp 2438If 2439.Fl d 2440is given, the session does not make the new window the current window. 2441.Ar target-window 2442represents the window to be created; if the target already exists an error is 2443shown, unless the 2444.Fl k 2445flag is used, in which case it is destroyed. 2446If 2447.Fl S 2448is given and a window named 2449.Ar window-name 2450already exists, it is selected (unless 2451.Fl d 2452is also given in which case the command does nothing). 2453.Pp 2454.Ar shell-command 2455is the command to execute. 2456If 2457.Ar shell-command 2458is not specified, the value of the 2459.Ic default-command 2460option is used. 2461.Fl c 2462specifies the working directory in which the new window is created. 2463.Pp 2464When the shell command completes, the window closes. 2465See the 2466.Ic remain-on-exit 2467option to change this behaviour. 2468.Pp 2469.Fl e 2470takes the form 2471.Ql VARIABLE=value 2472and sets an environment variable for the newly created window; it may be 2473specified multiple times. 2474.Pp 2475The 2476.Ev TERM 2477environment variable must be set to 2478.Ql screen 2479or 2480.Ql tmux 2481for all programs running 2482.Em inside 2483.Nm . 2484New windows will automatically have 2485.Ql TERM=screen 2486added to their environment, but care must be taken not to reset this in shell 2487start-up files or by the 2488.Fl e 2489option. 2490.Pp 2491The 2492.Fl P 2493option prints information about the new window after it has been created. 2494By default, it uses the format 2495.Ql #{session_name}:#{window_index} 2496but a different format may be specified with 2497.Fl F . 2498.It Ic next-layout Op Fl t Ar target-window 2499.D1 (alias: Ic nextl ) 2500Move a window to the next layout and rearrange the panes to fit. 2501.It Xo Ic next-window 2502.Op Fl a 2503.Op Fl t Ar target-session 2504.Xc 2505.D1 (alias: Ic next ) 2506Move to the next window in the session. 2507If 2508.Fl a 2509is used, move to the next window with an alert. 2510.It Xo Ic pipe-pane 2511.Op Fl IOo 2512.Op Fl t Ar target-pane 2513.Op Ar shell-command 2514.Xc 2515.D1 (alias: Ic pipep ) 2516Pipe output sent by the program in 2517.Ar target-pane 2518to a shell command or vice versa. 2519A pane may only be connected to one command at a time, any existing pipe is 2520closed before 2521.Ar shell-command 2522is executed. 2523The 2524.Ar shell-command 2525string may contain the special character sequences supported by the 2526.Ic status-left 2527option. 2528If no 2529.Ar shell-command 2530is given, the current pipe (if any) is closed. 2531.Pp 2532.Fl I 2533and 2534.Fl O 2535specify which of the 2536.Ar shell-command 2537output streams are connected to the pane: 2538with 2539.Fl I 2540stdout is connected (so anything 2541.Ar shell-command 2542prints is written to the pane as if it were typed); 2543with 2544.Fl O 2545stdin is connected (so any output in the pane is piped to 2546.Ar shell-command ) . 2547Both may be used together and if neither are specified, 2548.Fl O 2549is used. 2550.Pp 2551The 2552.Fl o 2553option only opens a new pipe if no previous pipe exists, allowing a pipe to 2554be toggled with a single key, for example: 2555.Bd -literal -offset indent 2556bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P' 2557.Ed 2558.It Xo Ic previous-layout 2559.Op Fl t Ar target-window 2560.Xc 2561.D1 (alias: Ic prevl ) 2562Move to the previous layout in the session. 2563.It Xo Ic previous-window 2564.Op Fl a 2565.Op Fl t Ar target-session 2566.Xc 2567.D1 (alias: Ic prev ) 2568Move to the previous window in the session. 2569With 2570.Fl a , 2571move to the previous window with an alert. 2572.It Xo Ic rename-window 2573.Op Fl t Ar target-window 2574.Ar new-name 2575.Xc 2576.D1 (alias: Ic renamew ) 2577Rename the current window, or the window at 2578.Ar target-window 2579if specified, to 2580.Ar new-name . 2581.It Xo Ic resize-pane 2582.Op Fl DLMRTUZ 2583.Op Fl t Ar target-pane 2584.Op Fl x Ar width 2585.Op Fl y Ar height 2586.Op Ar adjustment 2587.Xc 2588.D1 (alias: Ic resizep ) 2589Resize a pane, up, down, left or right by 2590.Ar adjustment 2591with 2592.Fl U , 2593.Fl D , 2594.Fl L 2595or 2596.Fl R , 2597or 2598to an absolute size 2599with 2600.Fl x 2601or 2602.Fl y . 2603The 2604.Ar adjustment 2605is given in lines or columns (the default is 1); 2606.Fl x 2607and 2608.Fl y 2609may be a given as a number of lines or columns or followed by 2610.Ql % 2611for a percentage of the window size (for example 2612.Ql -x 10% ) . 2613With 2614.Fl Z , 2615the active pane is toggled between zoomed (occupying the whole of the window) 2616and unzoomed (its normal position in the layout). 2617.Pp 2618.Fl M 2619begins mouse resizing (only valid if bound to a mouse key binding, see 2620.Sx MOUSE SUPPORT ) . 2621.Pp 2622.Fl T 2623trims all lines below the current cursor position and moves lines out of the 2624history to replace them. 2625.It Xo Ic resize-window 2626.Op Fl aADLRU 2627.Op Fl t Ar target-window 2628.Op Fl x Ar width 2629.Op Fl y Ar height 2630.Op Ar adjustment 2631.Xc 2632.D1 (alias: Ic resizew ) 2633Resize a window, up, down, left or right by 2634.Ar adjustment 2635with 2636.Fl U , 2637.Fl D , 2638.Fl L 2639or 2640.Fl R , 2641or 2642to an absolute size 2643with 2644.Fl x 2645or 2646.Fl y . 2647The 2648.Ar adjustment 2649is given in lines or cells (the default is 1). 2650.Fl A 2651sets the size of the largest session containing the window; 2652.Fl a 2653the size of the smallest. 2654This command will automatically set 2655.Ic window-size 2656to manual in the window options. 2657.It Xo Ic respawn-pane 2658.Op Fl k 2659.Op Fl c Ar start-directory 2660.Op Fl e Ar environment 2661.Op Fl t Ar target-pane 2662.Op Ar shell-command 2663.Xc 2664.D1 (alias: Ic respawnp ) 2665Reactivate a pane in which the command has exited (see the 2666.Ic remain-on-exit 2667window option). 2668If 2669.Ar shell-command 2670is not given, the command used when the pane was created or last respawned is 2671executed. 2672The pane must be already inactive, unless 2673.Fl k 2674is given, in which case any existing command is killed. 2675.Fl c 2676specifies a new working directory for the pane. 2677The 2678.Fl e 2679option has the same meaning as for the 2680.Ic new-window 2681command. 2682.It Xo Ic respawn-window 2683.Op Fl k 2684.Op Fl c Ar start-directory 2685.Op Fl e Ar environment 2686.Op Fl t Ar target-window 2687.Op Ar shell-command 2688.Xc 2689.D1 (alias: Ic respawnw ) 2690Reactivate a window in which the command has exited (see the 2691.Ic remain-on-exit 2692window option). 2693If 2694.Ar shell-command 2695is not given, the command used when the window was created or last respawned is 2696executed. 2697The window must be already inactive, unless 2698.Fl k 2699is given, in which case any existing command is killed. 2700.Fl c 2701specifies a new working directory for the window. 2702The 2703.Fl e 2704option has the same meaning as for the 2705.Ic new-window 2706command. 2707.It Xo Ic rotate-window 2708.Op Fl DUZ 2709.Op Fl t Ar target-window 2710.Xc 2711.D1 (alias: Ic rotatew ) 2712Rotate the positions of the panes within a window, either upward (numerically 2713lower) with 2714.Fl U 2715or downward (numerically higher). 2716.Fl Z 2717keeps the window zoomed if it was zoomed. 2718.It Xo Ic select-layout 2719.Op Fl Enop 2720.Op Fl t Ar target-pane 2721.Op Ar layout-name 2722.Xc 2723.D1 (alias: Ic selectl ) 2724Choose a specific layout for a window. 2725If 2726.Ar layout-name 2727is not given, the last preset layout used (if any) is reapplied. 2728.Fl n 2729and 2730.Fl p 2731are equivalent to the 2732.Ic next-layout 2733and 2734.Ic previous-layout 2735commands. 2736.Fl o 2737applies the last set layout if possible (undoes the most recent layout change). 2738.Fl E 2739spreads the current pane and any panes next to it out evenly. 2740.It Xo Ic select-pane 2741.Op Fl DdeLlMmRUZ 2742.Op Fl T Ar title 2743.Op Fl t Ar target-pane 2744.Xc 2745.D1 (alias: Ic selectp ) 2746Make pane 2747.Ar target-pane 2748the active pane in its window. 2749If one of 2750.Fl D , 2751.Fl L , 2752.Fl R , 2753or 2754.Fl U 2755is used, respectively the pane below, to the left, to the right, or above the 2756target pane is used. 2757.Fl Z 2758keeps the window zoomed if it was zoomed. 2759.Fl l 2760is the same as using the 2761.Ic last-pane 2762command. 2763.Fl e 2764enables or 2765.Fl d 2766disables input to the pane. 2767.Fl T 2768sets the pane title. 2769.Pp 2770.Fl m 2771and 2772.Fl M 2773are used to set and clear the 2774.Em marked pane . 2775There is one marked pane at a time, setting a new marked pane clears the last. 2776The marked pane is the default target for 2777.Fl s 2778to 2779.Ic join-pane , 2780.Ic move-pane , 2781.Ic swap-pane 2782and 2783.Ic swap-window . 2784.It Xo Ic select-window 2785.Op Fl lnpT 2786.Op Fl t Ar target-window 2787.Xc 2788.D1 (alias: Ic selectw ) 2789Select the window at 2790.Ar target-window . 2791.Fl l , 2792.Fl n 2793and 2794.Fl p 2795are equivalent to the 2796.Ic last-window , 2797.Ic next-window 2798and 2799.Ic previous-window 2800commands. 2801If 2802.Fl T 2803is given and the selected window is already the current window, 2804the command behaves like 2805.Ic last-window . 2806.It Xo Ic split-window 2807.Op Fl bdfhIvP 2808.Op Fl c Ar start-directory 2809.Op Fl e Ar environment 2810.Op Fl l Ar size 2811.Op Fl t Ar target-pane 2812.Op Ar shell-command 2813.Op Fl F Ar format 2814.Xc 2815.D1 (alias: Ic splitw ) 2816Create a new pane by splitting 2817.Ar target-pane : 2818.Fl h 2819does a horizontal split and 2820.Fl v 2821a vertical split; if neither is specified, 2822.Fl v 2823is assumed. 2824The 2825.Fl l 2826option specifies the size of the new pane in lines (for vertical split) or in 2827columns (for horizontal split); 2828.Ar size 2829may be followed by 2830.Ql % 2831to specify a percentage of the available space. 2832The 2833.Fl b 2834option causes the new pane to be created to the left of or above 2835.Ar target-pane . 2836The 2837.Fl f 2838option creates a new pane spanning the full window height (with 2839.Fl h ) 2840or full window width (with 2841.Fl v ) , 2842instead of splitting the active pane. 2843.Pp 2844An empty 2845.Ar shell-command 2846('') will create a pane with no command running in it. 2847Output can be sent to such a pane with the 2848.Ic display-message 2849command. 2850The 2851.Fl I 2852flag (if 2853.Ar shell-command 2854is not specified or empty) 2855will create an empty pane and forward any output from stdin to it. 2856For example: 2857.Bd -literal -offset indent 2858$ make 2>&1|tmux splitw -dI & 2859.Ed 2860.Pp 2861All other options have the same meaning as for the 2862.Ic new-window 2863command. 2864.It Xo Ic swap-pane 2865.Op Fl dDUZ 2866.Op Fl s Ar src-pane 2867.Op Fl t Ar dst-pane 2868.Xc 2869.D1 (alias: Ic swapp ) 2870Swap two panes. 2871If 2872.Fl U 2873is used and no source pane is specified with 2874.Fl s , 2875.Ar dst-pane 2876is swapped with the previous pane (before it numerically); 2877.Fl D 2878swaps with the next pane (after it numerically). 2879.Fl d 2880instructs 2881.Nm 2882not to change the active pane and 2883.Fl Z 2884keeps the window zoomed if it was zoomed. 2885.Pp 2886If 2887.Fl s 2888is omitted and a marked pane is present (see 2889.Ic select-pane 2890.Fl m ) , 2891the marked pane is used rather than the current pane. 2892.It Xo Ic swap-window 2893.Op Fl d 2894.Op Fl s Ar src-window 2895.Op Fl t Ar dst-window 2896.Xc 2897.D1 (alias: Ic swapw ) 2898This is similar to 2899.Ic link-window , 2900except the source and destination windows are swapped. 2901It is an error if no window exists at 2902.Ar src-window . 2903If 2904.Fl d 2905is given, the new window does not become the current window. 2906.Pp 2907If 2908.Fl s 2909is omitted and a marked pane is present (see 2910.Ic select-pane 2911.Fl m ) , 2912the window containing the marked pane is used rather than the current window. 2913.It Xo Ic unlink-window 2914.Op Fl k 2915.Op Fl t Ar target-window 2916.Xc 2917.D1 (alias: Ic unlinkw ) 2918Unlink 2919.Ar target-window . 2920Unless 2921.Fl k 2922is given, a window may be unlinked only if it is linked to multiple sessions - 2923windows may not be linked to no sessions; 2924if 2925.Fl k 2926is specified and the window is linked to only one session, it is unlinked and 2927destroyed. 2928.El 2929.Sh KEY BINDINGS 2930.Nm 2931allows a command to be bound to most keys, with or without a prefix key. 2932When specifying keys, most represent themselves (for example 2933.Ql A 2934to 2935.Ql Z ) . 2936Ctrl keys may be prefixed with 2937.Ql C- 2938or 2939.Ql ^ , 2940and Alt (meta) with 2941.Ql M- . 2942In addition, the following special key names are accepted: 2943.Em Up , 2944.Em Down , 2945.Em Left , 2946.Em Right , 2947.Em BSpace , 2948.Em BTab , 2949.Em DC 2950(Delete), 2951.Em End , 2952.Em Enter , 2953.Em Escape , 2954.Em F1 2955to 2956.Em F12 , 2957.Em Home , 2958.Em IC 2959(Insert), 2960.Em NPage/PageDown/PgDn , 2961.Em PPage/PageUp/PgUp , 2962.Em Space , 2963and 2964.Em Tab . 2965Note that to bind the 2966.Ql \&" 2967or 2968.Ql ' 2969keys, quotation marks are necessary, for example: 2970.Bd -literal -offset indent 2971bind-key '"' split-window 2972bind-key "'" new-window 2973.Ed 2974.Pp 2975A command bound to the 2976.Em Any 2977key will execute for all keys which do not have a more specific binding. 2978.Pp 2979Commands related to key bindings are as follows: 2980.Bl -tag -width Ds 2981.It Xo Ic bind-key 2982.Op Fl nr 2983.Op Fl N Ar note 2984.Op Fl T Ar key-table 2985.Ar key command Op Ar arguments 2986.Xc 2987.D1 (alias: Ic bind ) 2988Bind key 2989.Ar key 2990to 2991.Ar command . 2992Keys are bound in a key table. 2993By default (without -T), the key is bound in 2994the 2995.Em prefix 2996key table. 2997This table is used for keys pressed after the prefix key (for example, 2998by default 2999.Ql c 3000is bound to 3001.Ic new-window 3002in the 3003.Em prefix 3004table, so 3005.Ql C-b c 3006creates a new window). 3007The 3008.Em root 3009table is used for keys pressed without the prefix key: binding 3010.Ql c 3011to 3012.Ic new-window 3013in the 3014.Em root 3015table (not recommended) means a plain 3016.Ql c 3017will create a new window. 3018.Fl n 3019is an alias 3020for 3021.Fl T Ar root . 3022Keys may also be bound in custom key tables and the 3023.Ic switch-client 3024.Fl T 3025command used to switch to them from a key binding. 3026The 3027.Fl r 3028flag indicates this key may repeat, see the 3029.Ic repeat-time 3030option. 3031.Fl N 3032attaches a note to the key (shown with 3033.Ic list-keys 3034.Fl N ) . 3035.Pp 3036To view the default bindings and possible commands, see the 3037.Ic list-keys 3038command. 3039.It Xo Ic list-keys 3040.Op Fl 1aN 3041.Op Fl P Ar prefix-string Fl T Ar key-table 3042.Op Ar key 3043.Xc 3044.D1 (alias: Ic lsk ) 3045List key bindings. 3046There are two forms: the default lists keys as 3047.Ic bind-key 3048commands; 3049.Fl N 3050lists only keys with attached notes and shows only the key and note for each 3051key. 3052.Pp 3053With the default form, all key tables are listed by default. 3054.Fl T 3055lists only keys in 3056.Ar key-table . 3057.Pp 3058With the 3059.Fl N 3060form, only keys in the 3061.Em root 3062and 3063.Em prefix 3064key tables are listed by default; 3065.Fl T 3066also lists only keys in 3067.Ar key-table . 3068.Fl P 3069specifies a prefix to print before each key and 3070.Fl 1 3071lists only the first matching key. 3072.Fl a 3073lists the command for keys that do not have a note rather than skipping them. 3074.It Xo Ic send-keys 3075.Op Fl FHlMRX 3076.Op Fl N Ar repeat-count 3077.Op Fl t Ar target-pane 3078.Ar key Ar ... 3079.Xc 3080.D1 (alias: Ic send ) 3081Send a key or keys to a window. 3082Each argument 3083.Ar key 3084is the name of the key (such as 3085.Ql C-a 3086or 3087.Ql NPage ) 3088to send; if the string is not recognised as a key, it is sent as a series of 3089characters. 3090All arguments are sent sequentially from first to last. 3091.Pp 3092The 3093.Fl l 3094flag disables key name lookup and processes the keys as literal UTF-8 3095characters. 3096The 3097.Fl H 3098flag expects each key to be a hexadecimal number for an ASCII character. 3099.Pp 3100The 3101.Fl R 3102flag causes the terminal state to be reset. 3103.Pp 3104.Fl M 3105passes through a mouse event (only valid if bound to a mouse key binding, see 3106.Sx MOUSE SUPPORT ) . 3107.Pp 3108.Fl X 3109is used to send a command into copy mode - see 3110the 3111.Sx WINDOWS AND PANES 3112section. 3113.Fl N 3114specifies a repeat count and 3115.Fl F 3116expands formats in arguments where appropriate. 3117.It Xo Ic send-prefix 3118.Op Fl 2 3119.Op Fl t Ar target-pane 3120.Xc 3121Send the prefix key, or with 3122.Fl 2 3123the secondary prefix key, to a window as if it was pressed. 3124.It Xo Ic unbind-key 3125.Op Fl anq 3126.Op Fl T Ar key-table 3127.Ar key 3128.Xc 3129.D1 (alias: Ic unbind ) 3130Unbind the command bound to 3131.Ar key . 3132.Fl n 3133and 3134.Fl T 3135are the same as for 3136.Ic bind-key . 3137If 3138.Fl a 3139is present, all key bindings are removed. 3140The 3141.Fl q 3142option prevents errors being returned. 3143.El 3144.Sh OPTIONS 3145The appearance and behaviour of 3146.Nm 3147may be modified by changing the value of various options. 3148There are four types of option: 3149.Em server options , 3150.Em session options 3151.Em window options 3152and 3153.Em pane options . 3154.Pp 3155The 3156.Nm 3157server has a set of global server options which do not apply to any particular 3158window or session or pane. 3159These are altered with the 3160.Ic set-option 3161.Fl s 3162command, or displayed with the 3163.Ic show-options 3164.Fl s 3165command. 3166.Pp 3167In addition, each individual session may have a set of session options, and 3168there is a separate set of global session options. 3169Sessions which do not have a particular option configured inherit the value 3170from the global session options. 3171Session options are set or unset with the 3172.Ic set-option 3173command and may be listed with the 3174.Ic show-options 3175command. 3176The available server and session options are listed under the 3177.Ic set-option 3178command. 3179.Pp 3180Similarly, a set of window options is attached to each window and a set of pane 3181options to each pane. 3182Pane options inherit from window options. 3183This means any pane option may be set as a window option to apply the option to 3184all panes in the window without the option set, for example these commands will 3185set the background colour to red for all panes except pane 0: 3186.Bd -literal -offset indent 3187set -w window-style bg=red 3188set -pt:.0 window-style bg=blue 3189.Ed 3190.Pp 3191There is also a set of global window options from which any unset window or 3192pane options are inherited. 3193Window and pane options are altered with 3194.Ic set-option 3195.Fl w 3196and 3197.Fl p 3198commands and displayed with 3199.Ic show-option 3200.Fl w 3201and 3202.Fl p . 3203.Pp 3204.Nm 3205also supports user options which are prefixed with a 3206.Ql \&@ . 3207User options may have any name, so long as they are prefixed with 3208.Ql \&@ , 3209and be set to any string. 3210For example: 3211.Bd -literal -offset indent 3212$ tmux set -wq @foo "abc123" 3213$ tmux show -wv @foo 3214abc123 3215.Ed 3216.Pp 3217Commands which set options are as follows: 3218.Bl -tag -width Ds 3219.It Xo Ic set-option 3220.Op Fl aFgopqsuUw 3221.Op Fl t Ar target-pane 3222.Ar option Ar value 3223.Xc 3224.D1 (alias: Ic set ) 3225Set a pane option with 3226.Fl p , 3227a window option with 3228.Fl w , 3229a server option with 3230.Fl s , 3231otherwise a session option. 3232If the option is not a user option, 3233.Fl w 3234or 3235.Fl s 3236may be unnecessary - 3237.Nm 3238will infer the type from the option name, assuming 3239.Fl w 3240for pane options. 3241If 3242.Fl g 3243is given, the global session or window option is set. 3244.Pp 3245.Fl F 3246expands formats in the option value. 3247The 3248.Fl u 3249flag unsets an option, so a session inherits the option from the global 3250options (or with 3251.Fl g , 3252restores a global option to the default). 3253.Fl U 3254unsets an option (like 3255.Fl u ) 3256but if the option is a pane option also unsets the option on any panes in the 3257window. 3258.Ar value 3259depends on the option and may be a number, a string, or a flag (on, off, or 3260omitted to toggle). 3261.Pp 3262The 3263.Fl o 3264flag prevents setting an option that is already set and the 3265.Fl q 3266flag suppresses errors about unknown or ambiguous options. 3267.Pp 3268With 3269.Fl a , 3270and if the option expects a string or a style, 3271.Ar value 3272is appended to the existing setting. 3273For example: 3274.Bd -literal -offset indent 3275set -g status-left "foo" 3276set -ag status-left "bar" 3277.Ed 3278.Pp 3279Will result in 3280.Ql foobar . 3281And: 3282.Bd -literal -offset indent 3283set -g status-style "bg=red" 3284set -ag status-style "fg=blue" 3285.Ed 3286.Pp 3287Will result in a red background 3288.Em and 3289blue foreground. 3290Without 3291.Fl a , 3292the result would be the default background and a blue foreground. 3293.It Xo Ic show-options 3294.Op Fl AgHpqsvw 3295.Op Fl t Ar target-pane 3296.Op Ar option 3297.Xc 3298.D1 (alias: Ic show ) 3299Show the pane options (or a single option if 3300.Ar option 3301is provided) with 3302.Fl p , 3303the window options with 3304.Fl w , 3305the server options with 3306.Fl s , 3307otherwise the session options. 3308If the option is not a user option, 3309.Fl w 3310or 3311.Fl s 3312may be unnecessary - 3313.Nm 3314will infer the type from the option name, assuming 3315.Fl w 3316for pane options. 3317Global session or window options are listed if 3318.Fl g 3319is used. 3320.Fl v 3321shows only the option value, not the name. 3322If 3323.Fl q 3324is set, no error will be returned if 3325.Ar option 3326is unset. 3327.Fl H 3328includes hooks (omitted by default). 3329.Fl A 3330includes options inherited from a parent set of options, such options are 3331marked with an asterisk. 3332.El 3333.Pp 3334Available server options are: 3335.Bl -tag -width Ds 3336.It Ic backspace Ar key 3337Set the key sent by 3338.Nm 3339for backspace. 3340.It Ic buffer-limit Ar number 3341Set the number of buffers; as new buffers are added to the top of the stack, 3342old ones are removed from the bottom if necessary to maintain this maximum 3343length. 3344.It Xo Ic command-alias[] 3345.Ar name=value 3346.Xc 3347This is an array of custom aliases for commands. 3348If an unknown command matches 3349.Ar name , 3350it is replaced with 3351.Ar value . 3352For example, after: 3353.Pp 3354.Dl set -s command-alias[100] zoom='resize-pane -Z' 3355.Pp 3356Using: 3357.Pp 3358.Dl zoom -t:.1 3359.Pp 3360Is equivalent to: 3361.Pp 3362.Dl resize-pane -Z -t:.1 3363.Pp 3364Note that aliases are expanded when a command is parsed rather than when it is 3365executed, so binding an alias with 3366.Ic bind-key 3367will bind the expanded form. 3368.It Ic default-terminal Ar terminal 3369Set the default terminal for new windows created in this session - the 3370default value of the 3371.Ev TERM 3372environment variable. 3373For 3374.Nm 3375to work correctly, this 3376.Em must 3377be set to 3378.Ql screen , 3379.Ql tmux 3380or a derivative of them. 3381.It Ic copy-command Ar shell-command 3382Give the command to pipe to if the 3383.Ic copy-pipe 3384copy mode command is used without arguments. 3385.It Ic escape-time Ar time 3386Set the time in milliseconds for which 3387.Nm 3388waits after an escape is input to determine if it is part of a function or meta 3389key sequences. 3390The default is 500 milliseconds. 3391.It Ic editor Ar shell-command 3392Set the command used when 3393.Nm 3394runs an editor. 3395.It Xo Ic exit-empty 3396.Op Ic on | off 3397.Xc 3398If enabled (the default), the server will exit when there are no active 3399sessions. 3400.It Xo Ic exit-unattached 3401.Op Ic on | off 3402.Xc 3403If enabled, the server will exit when there are no attached clients. 3404.It Xo Ic extended-keys 3405.Op Ic on | off 3406.Xc 3407When enabled, extended keys are requested from the terminal and if supported 3408are recognised by 3409.Nm . 3410.It Xo Ic focus-events 3411.Op Ic on | off 3412.Xc 3413When enabled, focus events are requested from the terminal if supported and 3414passed through to applications running in 3415.Nm . 3416Attached clients should be detached and attached again after changing this 3417option. 3418.It Ic history-file Ar path 3419If not empty, a file to which 3420.Nm 3421will write command prompt history on exit and load it from on start. 3422.It Ic message-limit Ar number 3423Set the number of error or information messages to save in the message log for 3424each client. 3425The default is 100. 3426.It Xo Ic set-clipboard 3427.Op Ic on | external | off 3428.Xc 3429Attempt to set the terminal clipboard content using the 3430.Xr xterm 1 3431escape sequence, if there is an 3432.Em \&Ms 3433entry in the 3434.Xr terminfo 5 3435description (see the 3436.Sx TERMINFO EXTENSIONS 3437section). 3438.Pp 3439If set to 3440.Ic on , 3441.Nm 3442will both accept the escape sequence to create a buffer and attempt to set 3443the terminal clipboard. 3444If set to 3445.Ic external , 3446.Nm 3447will attempt to set the terminal clipboard but ignore attempts 3448by applications to set 3449.Nm 3450buffers. 3451If 3452.Ic off , 3453.Nm 3454will neither accept the clipboard escape sequence nor attempt to set the 3455clipboard. 3456.Pp 3457Note that this feature needs to be enabled in 3458.Xr xterm 1 3459by setting the resource: 3460.Bd -literal -offset indent 3461disallowedWindowOps: 20,21,SetXprop 3462.Ed 3463.Pp 3464Or changing this property from the 3465.Xr xterm 1 3466interactive menu when required. 3467.It Ic terminal-features[] Ar string 3468Set terminal features for terminal types read from 3469.Xr terminfo 5 . 3470.Nm 3471has a set of named terminal features. 3472Each will apply appropriate changes to the 3473.Xr terminfo 5 3474entry in use. 3475.Pp 3476.Nm 3477can detect features for a few common terminals; this option can be used to 3478easily tell tmux about features supported by terminals it cannot detect. 3479The 3480.Ic terminal-overrides 3481option allows individual 3482.Xr terminfo 5 3483capabilities to be set instead, 3484.Ic terminal-features 3485is intended for classes of functionality supported in a standard way but not 3486reported by 3487.Xr terminfo 5 . 3488Care must be taken only to configure this with features the terminal actually 3489support. 3490.Pp 3491This is an array option where each entry is a colon-separated string made up 3492of a terminal type pattern (matched using 3493.Xr fnmatch 3 ) 3494followed by a list of terminal features. 3495The available features are: 3496.Bl -tag -width Ds 3497.It 256 3498Supports 256 colours with the SGR escape sequences. 3499.It clipboard 3500Allows setting the system clipboard. 3501.It ccolour 3502Allows setting the cursor colour. 3503.It cstyle 3504Allows setting the cursor style. 3505.It extkeys 3506Supports extended keys. 3507.It focus 3508Supports focus reporting. 3509.It margins 3510Supports DECSLRM margins. 3511.It overline 3512Supports the overline SGR attribute. 3513.It rectfill 3514Supports the DECFRA rectangle fill escape sequence. 3515.It RGB 3516Supports RGB colour with the SGR escape sequences. 3517.It strikethrough 3518Supports the strikethrough SGR escape sequence. 3519.It sync 3520Supports synchronized updates. 3521.It title 3522Supports 3523.Xr xterm 1 3524title setting. 3525.It usstyle 3526Allows underscore style and colour to be set. 3527.El 3528.It Ic terminal-overrides[] Ar string 3529Allow terminal descriptions read using 3530.Xr terminfo 5 3531to be overridden. 3532Each entry is a colon-separated string made up of a terminal type pattern 3533(matched using 3534.Xr fnmatch 3 ) 3535and a set of 3536.Em name=value 3537entries. 3538.Pp 3539For example, to set the 3540.Ql clear 3541.Xr terminfo 5 3542entry to 3543.Ql \ee[H\ee[2J 3544for all terminal types matching 3545.Ql rxvt* : 3546.Pp 3547.Dl "rxvt*:clear=\ee[H\ee[2J" 3548.Pp 3549The terminal entry value is passed through 3550.Xr strunvis 3 3551before interpretation. 3552.It Ic user-keys[] Ar key 3553Set list of user-defined key escape sequences. 3554Each item is associated with a key named 3555.Ql User0 , 3556.Ql User1 , 3557and so on. 3558.Pp 3559For example: 3560.Bd -literal -offset indent 3561set -s user-keys[0] "\ee[5;30012~" 3562bind User0 resize-pane -L 3 3563.Ed 3564.El 3565.Pp 3566Available session options are: 3567.Bl -tag -width Ds 3568.It Xo Ic activity-action 3569.Op Ic any | none | current | other 3570.Xc 3571Set action on window activity when 3572.Ic monitor-activity 3573is on. 3574.Ic any 3575means activity in any window linked to a session causes a bell or message 3576(depending on 3577.Ic visual-activity ) 3578in the current window of that session, 3579.Ic none 3580means all activity is ignored (equivalent to 3581.Ic monitor-activity 3582being off), 3583.Ic current 3584means only activity in windows other than the current window are ignored and 3585.Ic other 3586means activity in the current window is ignored but not those in other windows. 3587.It Ic assume-paste-time Ar milliseconds 3588If keys are entered faster than one in 3589.Ar milliseconds , 3590they are assumed to have been pasted rather than typed and 3591.Nm 3592key bindings are not processed. 3593The default is one millisecond and zero disables. 3594.It Ic base-index Ar index 3595Set the base index from which an unused index should be searched when a new 3596window is created. 3597The default is zero. 3598.It Xo Ic bell-action 3599.Op Ic any | none | current | other 3600.Xc 3601Set action on a bell in a window when 3602.Ic monitor-bell 3603is on. 3604The values are the same as those for 3605.Ic activity-action . 3606.It Ic default-command Ar shell-command 3607Set the command used for new windows (if not specified when the window is 3608created) to 3609.Ar shell-command , 3610which may be any 3611.Xr sh 1 3612command. 3613The default is an empty string, which instructs 3614.Nm 3615to create a login shell using the value of the 3616.Ic default-shell 3617option. 3618.It Ic default-shell Ar path 3619Specify the default shell. 3620This is used as the login shell for new windows when the 3621.Ic default-command 3622option is set to empty, and must be the full path of the executable. 3623When started 3624.Nm 3625tries to set a default value from the first suitable of the 3626.Ev SHELL 3627environment variable, the shell returned by 3628.Xr getpwuid 3 , 3629or 3630.Pa /bin/sh . 3631This option should be configured when 3632.Nm 3633is used as a login shell. 3634.It Ic default-size Ar XxY 3635Set the default size of new windows when the 3636.Ic window-size 3637option is set to manual or when a session is created with 3638.Ic new-session 3639.Fl d . 3640The value is the width and height separated by an 3641.Ql x 3642character. 3643The default is 80x24. 3644.It Xo Ic destroy-unattached 3645.Op Ic on | off 3646.Xc 3647If enabled and the session is no longer attached to any clients, it is 3648destroyed. 3649.It Xo Ic detach-on-destroy 3650.Op Ic off | on | no-detached 3651.Xc 3652If on (the default), the client is detached when the session it is attached to 3653is destroyed. 3654If off, the client is switched to the most recently active of the remaining 3655sessions. 3656If 3657.Ic no-detached , 3658the client is detached only if there are no detached sessions; if detached 3659sessions exist, the client is switched to the most recently active. 3660.It Ic display-panes-active-colour Ar colour 3661Set the colour used by the 3662.Ic display-panes 3663command to show the indicator for the active pane. 3664.It Ic display-panes-colour Ar colour 3665Set the colour used by the 3666.Ic display-panes 3667command to show the indicators for inactive panes. 3668.It Ic display-panes-time Ar time 3669Set the time in milliseconds for which the indicators shown by the 3670.Ic display-panes 3671command appear. 3672.It Ic display-time Ar time 3673Set the amount of time for which status line messages and other on-screen 3674indicators are displayed. 3675If set to 0, messages and indicators are displayed until a key is pressed. 3676.Ar time 3677is in milliseconds. 3678.It Ic history-limit Ar lines 3679Set the maximum number of lines held in window history. 3680This setting applies only to new windows - existing window histories are not 3681resized and retain the limit at the point they were created. 3682.It Ic key-table Ar key-table 3683Set the default key table to 3684.Ar key-table 3685instead of 3686.Em root . 3687.It Ic lock-after-time Ar number 3688Lock the session (like the 3689.Ic lock-session 3690command) after 3691.Ar number 3692seconds of inactivity. 3693The default is not to lock (set to 0). 3694.It Ic lock-command Ar shell-command 3695Command to run when locking each client. 3696The default is to run 3697.Xr lock 1 3698with 3699.Fl np . 3700.It Ic message-command-style Ar style 3701Set status line message command style. 3702This is used for the command prompt with 3703.Xr vi 1 3704keys when in command mode. 3705For how to specify 3706.Ar style , 3707see the 3708.Sx STYLES 3709section. 3710.It Ic message-style Ar style 3711Set status line message style. 3712This is used for messages and for the command prompt. 3713For how to specify 3714.Ar style , 3715see the 3716.Sx STYLES 3717section. 3718.It Xo Ic mouse 3719.Op Ic on | off 3720.Xc 3721If on, 3722.Nm 3723captures the mouse and allows mouse events to be bound as key bindings. 3724See the 3725.Sx MOUSE SUPPORT 3726section for details. 3727.It Ic prefix Ar key 3728Set the key accepted as a prefix key. 3729In addition to the standard keys described under 3730.Sx KEY BINDINGS , 3731.Ic prefix 3732can be set to the special key 3733.Ql None 3734to set no prefix. 3735.It Ic prefix2 Ar key 3736Set a secondary key accepted as a prefix key. 3737Like 3738.Ic prefix , 3739.Ic prefix2 3740can be set to 3741.Ql None . 3742.It Xo Ic renumber-windows 3743.Op Ic on | off 3744.Xc 3745If on, when a window is closed in a session, automatically renumber the other 3746windows in numerical order. 3747This respects the 3748.Ic base-index 3749option if it has been set. 3750If off, do not renumber the windows. 3751.It Ic repeat-time Ar time 3752Allow multiple commands to be entered without pressing the prefix-key again 3753in the specified 3754.Ar time 3755milliseconds (the default is 500). 3756Whether a key repeats may be set when it is bound using the 3757.Fl r 3758flag to 3759.Ic bind-key . 3760Repeat is enabled for the default keys bound to the 3761.Ic resize-pane 3762command. 3763.It Xo Ic set-titles 3764.Op Ic on | off 3765.Xc 3766Attempt to set the client terminal title using the 3767.Em tsl 3768and 3769.Em fsl 3770.Xr terminfo 5 3771entries if they exist. 3772.Nm 3773automatically sets these to the \ee]0;...\e007 sequence if 3774the terminal appears to be 3775.Xr xterm 1 . 3776This option is off by default. 3777.It Ic set-titles-string Ar string 3778String used to set the client terminal title if 3779.Ic set-titles 3780is on. 3781Formats are expanded, see the 3782.Sx FORMATS 3783section. 3784.It Xo Ic silence-action 3785.Op Ic any | none | current | other 3786.Xc 3787Set action on window silence when 3788.Ic monitor-silence 3789is on. 3790The values are the same as those for 3791.Ic activity-action . 3792.It Xo Ic status 3793.Op Ic off | on | 2 | 3 | 4 | 5 3794.Xc 3795Show or hide the status line or specify its size. 3796Using 3797.Ic on 3798gives a status line one row in height; 3799.Ic 2 , 3800.Ic 3 , 3801.Ic 4 3802or 3803.Ic 5 3804more rows. 3805.It Ic status-format[] Ar format 3806Specify the format to be used for each line of the status line. 3807The default builds the top status line from the various individual status 3808options below. 3809.It Ic status-interval Ar interval 3810Update the status line every 3811.Ar interval 3812seconds. 3813By default, updates will occur every 15 seconds. 3814A setting of zero disables redrawing at interval. 3815.It Xo Ic status-justify 3816.Op Ic left | centre | right 3817.Xc 3818Set the position of the window list component of the status line: left, centre 3819or right justified. 3820.It Xo Ic status-keys 3821.Op Ic vi | emacs 3822.Xc 3823Use vi or emacs-style 3824key bindings in the status line, for example at the command prompt. 3825The default is emacs, unless the 3826.Ev VISUAL 3827or 3828.Ev EDITOR 3829environment variables are set and contain the string 3830.Ql vi . 3831.It Ic status-left Ar string 3832Display 3833.Ar string 3834(by default the session name) to the left of the status line. 3835.Ar string 3836will be passed through 3837.Xr strftime 3 . 3838Also see the 3839.Sx FORMATS 3840and 3841.Sx STYLES 3842sections. 3843.Pp 3844For details on how the names and titles can be set see the 3845.Sx "NAMES AND TITLES" 3846section. 3847.Pp 3848Examples are: 3849.Bd -literal -offset indent 3850#(sysctl vm.loadavg) 3851#[fg=yellow,bold]#(apm -l)%%#[default] [#S] 3852.Ed 3853.Pp 3854The default is 3855.Ql "[#S] " . 3856.It Ic status-left-length Ar length 3857Set the maximum 3858.Ar length 3859of the left component of the status line. 3860The default is 10. 3861.It Ic status-left-style Ar style 3862Set the style of the left part of the status line. 3863For how to specify 3864.Ar style , 3865see the 3866.Sx STYLES 3867section. 3868.It Xo Ic status-position 3869.Op Ic top | bottom 3870.Xc 3871Set the position of the status line. 3872.It Ic status-right Ar string 3873Display 3874.Ar string 3875to the right of the status line. 3876By default, the current pane title in double quotes, the date and the time 3877are shown. 3878As with 3879.Ic status-left , 3880.Ar string 3881will be passed to 3882.Xr strftime 3 3883and character pairs are replaced. 3884.It Ic status-right-length Ar length 3885Set the maximum 3886.Ar length 3887of the right component of the status line. 3888The default is 40. 3889.It Ic status-right-style Ar style 3890Set the style of the right part of the status line. 3891For how to specify 3892.Ar style , 3893see the 3894.Sx STYLES 3895section. 3896.It Ic status-style Ar style 3897Set status line style. 3898For how to specify 3899.Ar style , 3900see the 3901.Sx STYLES 3902section. 3903.It Ic update-environment[] Ar variable 3904Set list of environment variables to be copied into the session environment 3905when a new session is created or an existing session is attached. 3906Any variables that do not exist in the source environment are set to be 3907removed from the session environment (as if 3908.Fl r 3909was given to the 3910.Ic set-environment 3911command). 3912.It Xo Ic visual-activity 3913.Op Ic on | off | both 3914.Xc 3915If on, display a message instead of sending a bell when activity occurs in a 3916window for which the 3917.Ic monitor-activity 3918window option is enabled. 3919If set to both, a bell and a message are produced. 3920.It Xo Ic visual-bell 3921.Op Ic on | off | both 3922.Xc 3923If on, a message is shown on a bell in a window for which the 3924.Ic monitor-bell 3925window option is enabled instead of it being passed through to the 3926terminal (which normally makes a sound). 3927If set to both, a bell and a message are produced. 3928Also see the 3929.Ic bell-action 3930option. 3931.It Xo Ic visual-silence 3932.Op Ic on | off | both 3933.Xc 3934If 3935.Ic monitor-silence 3936is enabled, prints a message after the interval has expired on a given window 3937instead of sending a bell. 3938If set to both, a bell and a message are produced. 3939.It Ic word-separators Ar string 3940Sets the session's conception of what characters are considered word 3941separators, for the purposes of the next and previous word commands in 3942copy mode. 3943The default is 3944.Ql \ -_@ . 3945.El 3946.Pp 3947Available window options are: 3948.Pp 3949.Bl -tag -width Ds -compact 3950.It Xo Ic aggressive-resize 3951.Op Ic on | off 3952.Xc 3953Aggressively resize the chosen window. 3954This means that 3955.Nm 3956will resize the window to the size of the smallest or largest session 3957(see the 3958.Ic window-size 3959option) for which it is the current window, rather than the session to 3960which it is attached. 3961The window may resize when the current window is changed on another 3962session; this option is good for full-screen programs which support 3963.Dv SIGWINCH 3964and poor for interactive programs such as shells. 3965.Pp 3966.It Xo Ic automatic-rename 3967.Op Ic on | off 3968.Xc 3969Control automatic window renaming. 3970When this setting is enabled, 3971.Nm 3972will rename the window automatically using the format specified by 3973.Ic automatic-rename-format . 3974This flag is automatically disabled for an individual window when a name 3975is specified at creation with 3976.Ic new-window 3977or 3978.Ic new-session , 3979or later with 3980.Ic rename-window , 3981or with a terminal escape sequence. 3982It may be switched off globally with: 3983.Bd -literal -offset indent 3984set-option -wg automatic-rename off 3985.Ed 3986.Pp 3987.It Ic automatic-rename-format Ar format 3988The format (see 3989.Sx FORMATS ) 3990used when the 3991.Ic automatic-rename 3992option is enabled. 3993.Pp 3994.It Ic clock-mode-colour Ar colour 3995Set clock colour. 3996.Pp 3997.It Xo Ic clock-mode-style 3998.Op Ic 12 | 24 3999.Xc 4000Set clock hour format. 4001.Pp 4002.It Ic main-pane-height Ar height 4003.It Ic main-pane-width Ar width 4004Set the width or height of the main (left or top) pane in the 4005.Ic main-horizontal 4006or 4007.Ic main-vertical 4008layouts. 4009If suffixed by 4010.Ql % , 4011this is a percentage of the window size. 4012.Pp 4013.It Ic copy-mode-match-style Ar style 4014Set the style of search matches in copy mode. 4015For how to specify 4016.Ar style , 4017see the 4018.Sx STYLES 4019section. 4020.Pp 4021.It Ic copy-mode-mark-style Ar style 4022Set the style of the line containing the mark in copy mode. 4023For how to specify 4024.Ar style , 4025see the 4026.Sx STYLES 4027section. 4028.Pp 4029.It Ic copy-mode-current-match-style Ar style 4030Set the style of the current search match in copy mode. 4031For how to specify 4032.Ar style , 4033see the 4034.Sx STYLES 4035section. 4036.Pp 4037.It Xo Ic mode-keys 4038.Op Ic vi | emacs 4039.Xc 4040Use vi or emacs-style key bindings in copy mode. 4041The default is emacs, unless 4042.Ev VISUAL 4043or 4044.Ev EDITOR 4045contains 4046.Ql vi . 4047.Pp 4048.It Ic mode-style Ar style 4049Set window modes style. 4050For how to specify 4051.Ar style , 4052see the 4053.Sx STYLES 4054section. 4055.Pp 4056.It Xo Ic monitor-activity 4057.Op Ic on | off 4058.Xc 4059Monitor for activity in the window. 4060Windows with activity are highlighted in the status line. 4061.Pp 4062.It Xo Ic monitor-bell 4063.Op Ic on | off 4064.Xc 4065Monitor for a bell in the window. 4066Windows with a bell are highlighted in the status line. 4067.Pp 4068.It Xo Ic monitor-silence 4069.Op Ic interval 4070.Xc 4071Monitor for silence (no activity) in the window within 4072.Ic interval 4073seconds. 4074Windows that have been silent for the interval are highlighted in the 4075status line. 4076An interval of zero disables the monitoring. 4077.Pp 4078.It Ic other-pane-height Ar height 4079Set the height of the other panes (not the main pane) in the 4080.Ic main-horizontal 4081layout. 4082If this option is set to 0 (the default), it will have no effect. 4083If both the 4084.Ic main-pane-height 4085and 4086.Ic other-pane-height 4087options are set, the main pane will grow taller to make the other panes the 4088specified height, but will never shrink to do so. 4089If suffixed by 4090.Ql % , 4091this is a percentage of the window size. 4092.Pp 4093.It Ic other-pane-width Ar width 4094Like 4095.Ic other-pane-height , 4096but set the width of other panes in the 4097.Ic main-vertical 4098layout. 4099.Pp 4100.It Ic pane-active-border-style Ar style 4101Set the pane border style for the currently active pane. 4102For how to specify 4103.Ar style , 4104see the 4105.Sx STYLES 4106section. 4107Attributes are ignored. 4108.Pp 4109.It Ic pane-base-index Ar index 4110Like 4111.Ic base-index , 4112but set the starting index for pane numbers. 4113.Pp 4114.It Ic pane-border-format Ar format 4115Set the text shown in pane border status lines. 4116.Pp 4117.It Ic pane-border-lines Ar type 4118Set the type of characters used for drawing pane borders. 4119.Ar type 4120may be one of: 4121.Bl -tag -width Ds 4122.It single 4123single lines using ACS or UTF-8 characters 4124.It double 4125double lines using UTF-8 characters 4126.It heavy 4127heavy lines using UTF-8 characters 4128.It simple 4129simple ASCII characters 4130.It number 4131the pane number 4132.El 4133.Pp 4134.Ql double 4135and 4136.Ql heavy 4137will fall back to standard ACS line drawing when UTF-8 is not supported. 4138.Pp 4139.It Xo Ic pane-border-status 4140.Op Ic off | top | bottom 4141.Xc 4142Turn pane border status lines off or set their position. 4143.Pp 4144.It Ic pane-border-style Ar style 4145Set the pane border style for panes aside from the active pane. 4146For how to specify 4147.Ar style , 4148see the 4149.Sx STYLES 4150section. 4151Attributes are ignored. 4152.Pp 4153.It Ic window-status-activity-style Ar style 4154Set status line style for windows with an activity alert. 4155For how to specify 4156.Ar style , 4157see the 4158.Sx STYLES 4159section. 4160.Pp 4161.It Ic window-status-bell-style Ar style 4162Set status line style for windows with a bell alert. 4163For how to specify 4164.Ar style , 4165see the 4166.Sx STYLES 4167section. 4168.Pp 4169.It Ic window-status-current-format Ar string 4170Like 4171.Ar window-status-format , 4172but is the format used when the window is the current window. 4173.Pp 4174.It Ic window-status-current-style Ar style 4175Set status line style for the currently active window. 4176For how to specify 4177.Ar style , 4178see the 4179.Sx STYLES 4180section. 4181.Pp 4182.It Ic window-status-format Ar string 4183Set the format in which the window is displayed in the status line window list. 4184See the 4185.Sx FORMATS 4186and 4187.Sx STYLES 4188sections. 4189.Pp 4190.It Ic window-status-last-style Ar style 4191Set status line style for the last active window. 4192For how to specify 4193.Ar style , 4194see the 4195.Sx STYLES 4196section. 4197.Pp 4198.It Ic window-status-separator Ar string 4199Sets the separator drawn between windows in the status line. 4200The default is a single space character. 4201.Pp 4202.It Ic window-status-style Ar style 4203Set status line style for a single window. 4204For how to specify 4205.Ar style , 4206see the 4207.Sx STYLES 4208section. 4209.Pp 4210.It Xo Ic window-size 4211.Ar largest | Ar smallest | Ar manual | Ar latest 4212.Xc 4213Configure how 4214.Nm 4215determines the window size. 4216If set to 4217.Ar largest , 4218the size of the largest attached session is used; if 4219.Ar smallest , 4220the size of the smallest. 4221If 4222.Ar manual , 4223the size of a new window is set from the 4224.Ic default-size 4225option and windows are resized automatically. 4226With 4227.Ar latest , 4228.Nm 4229uses the size of the client that had the most recent activity. 4230See also the 4231.Ic resize-window 4232command and the 4233.Ic aggressive-resize 4234option. 4235.Pp 4236.It Xo Ic wrap-search 4237.Op Ic on | off 4238.Xc 4239If this option is set, searches will wrap around the end of the pane contents. 4240The default is on. 4241.El 4242.Pp 4243Available pane options are: 4244.Pp 4245.Bl -tag -width Ds -compact 4246.It Xo Ic allow-rename 4247.Op Ic on | off 4248.Xc 4249Allow programs in the pane to change the window name using a terminal escape 4250sequence (\eek...\ee\e\e). 4251.Pp 4252.It Xo Ic alternate-screen 4253.Op Ic on | off 4254.Xc 4255This option configures whether programs running inside the pane may use the 4256terminal alternate screen feature, which allows the 4257.Em smcup 4258and 4259.Em rmcup 4260.Xr terminfo 5 4261capabilities. 4262The alternate screen feature preserves the contents of the window when an 4263interactive application starts and restores it on exit, so that any output 4264visible before the application starts reappears unchanged after it exits. 4265.Pp 4266.It Xo Ic remain-on-exit 4267.Op Ic on | off | failed 4268.Xc 4269A pane with this flag set is not destroyed when the program running in it 4270exits. 4271If set to 4272.Ic failed , 4273then only when the program exit status is not zero. 4274The pane may be reactivated with the 4275.Ic respawn-pane 4276command. 4277.Pp 4278.It Xo Ic synchronize-panes 4279.Op Ic on | off 4280.Xc 4281Duplicate input to all other panes in the same window where this option is also 4282on (only for panes that are not in any mode). 4283.Pp 4284.It Ic window-active-style Ar style 4285Set the pane style when it is the active pane. 4286For how to specify 4287.Ar style , 4288see the 4289.Sx STYLES 4290section. 4291.Pp 4292.It Ic window-style Ar style 4293Set the pane style. 4294For how to specify 4295.Ar style , 4296see the 4297.Sx STYLES 4298section. 4299.El 4300.Sh HOOKS 4301.Nm 4302allows commands to run on various triggers, called 4303.Em hooks . 4304Most 4305.Nm 4306commands have an 4307.Em after 4308hook and there are a number of hooks not associated with commands. 4309.Pp 4310Hooks are stored as array options, members of the array are executed in 4311order when the hook is triggered. 4312Like options different hooks may be global or belong to a session, window or pane. 4313Hooks may be configured with the 4314.Ic set-hook 4315or 4316.Ic set-option 4317commands and displayed with 4318.Ic show-hooks 4319or 4320.Ic show-options 4321.Fl H . 4322The following two commands are equivalent: 4323.Bd -literal -offset indent. 4324set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red' 4325set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red' 4326.Ed 4327.Pp 4328Setting a hook without specifying an array index clears the hook and sets the 4329first member of the array. 4330.Pp 4331A command's after 4332hook is run after it completes, except when the command is run as part of a hook 4333itself. 4334They are named with an 4335.Ql after- 4336prefix. 4337For example, the following command adds a hook to select the even-vertical 4338layout after every 4339.Ic split-window : 4340.Bd -literal -offset indent 4341set-hook -g after-split-window "selectl even-vertical" 4342.Ed 4343.Pp 4344All the notifications listed in the 4345.Sx CONTROL MODE 4346section are hooks (without any arguments), except 4347.Ic %exit . 4348The following additional hooks are available: 4349.Bl -tag -width "XXXXXXXXXXXXXXXXXXXXXX" 4350.It alert-activity 4351Run when a window has activity. 4352See 4353.Ic monitor-activity . 4354.It alert-bell 4355Run when a window has received a bell. 4356See 4357.Ic monitor-bell . 4358.It alert-silence 4359Run when a window has been silent. 4360See 4361.Ic monitor-silence . 4362.It client-attached 4363Run when a client is attached. 4364.It client-detached 4365Run when a client is detached 4366.It client-resized 4367Run when a client is resized. 4368.It client-session-changed 4369Run when a client's attached session is changed. 4370.It pane-died 4371Run when the program running in a pane exits, but 4372.Ic remain-on-exit 4373is on so the pane has not closed. 4374.It pane-exited 4375Run when the program running in a pane exits. 4376.It pane-focus-in 4377Run when the focus enters a pane, if the 4378.Ic focus-events 4379option is on. 4380.It pane-focus-out 4381Run when the focus exits a pane, if the 4382.Ic focus-events 4383option is on. 4384.It pane-set-clipboard 4385Run when the terminal clipboard is set using the 4386.Xr xterm 1 4387escape sequence. 4388.It session-created 4389Run when a new session created. 4390.It session-closed 4391Run when a session closed. 4392.It session-renamed 4393Run when a session is renamed. 4394.It window-linked 4395Run when a window is linked into a session. 4396.It window-renamed 4397Run when a window is renamed. 4398.It window-unlinked 4399Run when a window is unlinked from a session. 4400.El 4401.Pp 4402Hooks are managed with these commands: 4403.Bl -tag -width Ds 4404.It Xo Ic set-hook 4405.Op Fl agpRuw 4406.Op Fl t Ar target-pane 4407.Ar hook-name 4408.Ar command 4409.Xc 4410Without 4411.Fl R , 4412sets (or with 4413.Fl u 4414unsets) hook 4415.Ar hook-name 4416to 4417.Ar command . 4418The flags are the same as for 4419.Ic set-option . 4420.Pp 4421With 4422.Fl R , 4423run 4424.Ar hook-name 4425immediately. 4426.It Xo Ic show-hooks 4427.Op Fl gpw 4428.Op Fl t Ar target-pane 4429.Xc 4430Shows hooks. 4431The flags are the same as for 4432.Ic show-options . 4433.El 4434.Sh MOUSE SUPPORT 4435If the 4436.Ic mouse 4437option is on (the default is off), 4438.Nm 4439allows mouse events to be bound as keys. 4440The name of each key is made up of a mouse event (such as 4441.Ql MouseUp1 ) 4442and a location suffix, one of the following: 4443.Bl -column "XXXXXXXXXXXXX" -offset indent 4444.It Li "Pane" Ta "the contents of a pane" 4445.It Li "Border" Ta "a pane border" 4446.It Li "Status" Ta "the status line window list" 4447.It Li "StatusLeft" Ta "the left part of the status line" 4448.It Li "StatusRight" Ta "the right part of the status line" 4449.It Li "StatusDefault" Ta "any other part of the status line" 4450.El 4451.Pp 4452The following mouse events are available: 4453.Bl -column "MouseDown1" "MouseDrag1" "WheelDown" -offset indent 4454.It Li "WheelUp" Ta "WheelDown" Ta "" 4455.It Li "MouseDown1" Ta "MouseUp1" Ta "MouseDrag1" Ta "MouseDragEnd1" 4456.It Li "MouseDown2" Ta "MouseUp2" Ta "MouseDrag2" Ta "MouseDragEnd2" 4457.It Li "MouseDown3" Ta "MouseUp3" Ta "MouseDrag3" Ta "MouseDragEnd3" 4458.It Li "SecondClick1" Ta "SecondClick2" Ta "SecondClick3" 4459.It Li "DoubleClick1" Ta "DoubleClick2" Ta "DoubleClick3" 4460.It Li "TripleClick1" Ta "TripleClick2" Ta "TripleClick3" 4461.El 4462.Pp 4463The 4464.Ql SecondClick 4465events are fired for the second click of a double click, even if there may be a 4466third click which will fire 4467.Ql TripleClick 4468instead of 4469.Ql DoubleClick . 4470.Pp 4471Each should be suffixed with a location, for example 4472.Ql MouseDown1Status . 4473.Pp 4474The special token 4475.Ql {mouse} 4476or 4477.Ql = 4478may be used as 4479.Ar target-window 4480or 4481.Ar target-pane 4482in commands bound to mouse key bindings. 4483It resolves to the window or pane over which the mouse event took place 4484(for example, the window in the status line over which button 1 was released for a 4485.Ql MouseUp1Status 4486binding, or the pane over which the wheel was scrolled for a 4487.Ql WheelDownPane 4488binding). 4489.Pp 4490The 4491.Ic send-keys 4492.Fl M 4493flag may be used to forward a mouse event to a pane. 4494.Pp 4495The default key bindings allow the mouse to be used to select and resize panes, 4496to copy text and to change window using the status line. 4497These take effect if the 4498.Ic mouse 4499option is turned on. 4500.Sh FORMATS 4501Certain commands accept the 4502.Fl F 4503flag with a 4504.Ar format 4505argument. 4506This is a string which controls the output format of the command. 4507Format variables are enclosed in 4508.Ql #{ 4509and 4510.Ql } , 4511for example 4512.Ql #{session_name} . 4513The possible variables are listed in the table below, or the name of a 4514.Nm 4515option may be used for an option's value. 4516Some variables have a shorter alias such as 4517.Ql #S ; 4518.Ql ## 4519is replaced by a single 4520.Ql # , 4521.Ql #, 4522by a 4523.Ql \&, 4524and 4525.Ql #} 4526by a 4527.Ql } . 4528.Pp 4529Conditionals are available by prefixing with 4530.Ql \&? 4531and separating two alternatives with a comma; 4532if the specified variable exists and is not zero, the first alternative 4533is chosen, otherwise the second is used. 4534For example 4535.Ql #{?session_attached,attached,not attached} 4536will include the string 4537.Ql attached 4538if the session is attached and the string 4539.Ql not attached 4540if it is unattached, or 4541.Ql #{?automatic-rename,yes,no} 4542will include 4543.Ql yes 4544if 4545.Ic automatic-rename 4546is enabled, or 4547.Ql no 4548if not. 4549Conditionals can be nested arbitrarily. 4550Inside a conditional, 4551.Ql \&, 4552and 4553.Ql } 4554must be escaped as 4555.Ql #, 4556and 4557.Ql #} , 4558unless they are part of a 4559.Ql #{...} 4560replacement. 4561For example: 4562.Bd -literal -offset indent 4563#{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W . 4564.Ed 4565.Pp 4566String comparisons may be expressed by prefixing two comma-separated 4567alternatives by 4568.Ql == , 4569.Ql != , 4570.Ql < , 4571.Ql > , 4572.Ql <= 4573or 4574.Ql >= 4575and a colon. 4576For example 4577.Ql #{==:#{host},myhost} 4578will be replaced by 4579.Ql 1 4580if running on 4581.Ql myhost , 4582otherwise by 4583.Ql 0 . 4584.Ql || 4585and 4586.Ql && 4587evaluate to true if either or both of two comma-separated alternatives are 4588true, for example 4589.Ql #{||:#{pane_in_mode},#{alternate_on}} . 4590.Pp 4591An 4592.Ql m 4593specifies an 4594.Xr fnmatch 3 4595or regular expression comparison. 4596The first argument is the pattern and the second the string to compare. 4597An optional argument specifies flags: 4598.Ql r 4599means the pattern is a regular expression instead of the default 4600.Xr fnmatch 3 4601pattern, and 4602.Ql i 4603means to ignore case. 4604For example: 4605.Ql #{m:*foo*,#{host}} 4606or 4607.Ql #{m/ri:^A,MYVAR} . 4608A 4609.Ql C 4610performs a search for an 4611.Xr fnmatch 3 4612pattern or regular expression in the pane content and evaluates to zero if not 4613found, or a line number if found. 4614Like 4615.Ql m , 4616an 4617.Ql r 4618flag means search for a regular expression and 4619.Ql i 4620ignores case. 4621For example: 4622.Ql #{C/r:^Start} 4623.Pp 4624Numeric operators may be performed by prefixing two comma-separated alternatives with an 4625.Ql e 4626and an operator. 4627An optional 4628.Ql f 4629flag may be given after the operator to use floating point numbers, otherwise integers are used. 4630This may be followed by a number giving the number of decimal places to use for the result. 4631The available operators are: 4632addition 4633.Ql + , 4634subtraction 4635.Ql - , 4636multiplication 4637.Ql * , 4638division 4639.Ql / , 4640modulus 4641.Ql m 4642or 4643.Ql % 4644(note that 4645.Ql % 4646must be escaped as 4647.Ql %% 4648in formats which are also expanded by 4649.Xr strftime 3 ) 4650and numeric comparison operators 4651.Ql == , 4652.Ql != , 4653.Ql < , 4654.Ql <= , 4655.Ql > 4656and 4657.Ql >= . 4658For example, 4659.Ql #{e|*|f|4:5.5,3} 4660multiplies 5.5 by 3 for a result with four decimal places and 4661.Ql #{e|%%:7,3} 4662returns the modulus of 7 and 3. 4663.Pp 4664A limit may be placed on the length of the resultant string by prefixing it 4665by an 4666.Ql = , 4667a number and a colon. 4668Positive numbers count from the start of the string and negative from the end, 4669so 4670.Ql #{=5:pane_title} 4671will include at most the first five characters of the pane title, or 4672.Ql #{=-5:pane_title} 4673the last five characters. 4674A suffix or prefix may be given as a second argument - if provided then it is 4675appended or prepended to the string if the length has been trimmed, for example 4676.Ql #{=/5/...:pane_title} 4677will append 4678.Ql ... 4679if the pane title is more than five characters. 4680Similarly, 4681.Ql p 4682pads the string to a given width, for example 4683.Ql #{p10:pane_title} 4684will result in a width of at least 10 characters. 4685A positive width pads on the left, a negative on the right. 4686.Ql n 4687expands to the length of the variable and 4688.Ql w 4689to its width when displayed, for example 4690.Ql #{n:window_name} . 4691.Pp 4692Prefixing a time variable with 4693.Ql t:\& 4694will convert it to a string, so if 4695.Ql #{window_activity} 4696gives 4697.Ql 1445765102 , 4698.Ql #{t:window_activity} 4699gives 4700.Ql Sun Oct 25 09:25:02 2015 . 4701Adding 4702.Ql p ( 4703.Ql `t/p` ) 4704will use shorter but less accurate time format for times in the past. 4705A custom format may be given using an 4706.Ql f 4707suffix (note that 4708.Ql % 4709must be escaped as 4710.Ql %% 4711if the format is separately being passed through 4712.Xr strftime 3 , 4713for example in the 4714.Ic status-left 4715option): 4716.Ql #{t/f/%%H#:%%M:window_activity} , 4717see 4718.Xr strftime 3 . 4719.Pp 4720The 4721.Ql b:\& 4722and 4723.Ql d:\& 4724prefixes are 4725.Xr basename 3 4726and 4727.Xr dirname 3 4728of the variable respectively. 4729.Ql q:\& 4730will escape 4731.Xr sh 1 4732special characters or with a 4733.Ql h 4734suffix, escape hash characters (so 4735.Ql # 4736becomes 4737.Ql ## ) . 4738.Ql E:\& 4739will expand the format twice, for example 4740.Ql #{E:status-left} 4741is the result of expanding the content of the 4742.Ic status-left 4743option rather than the option itself. 4744.Ql T:\& 4745is like 4746.Ql E:\& 4747but also expands 4748.Xr strftime 3 4749specifiers. 4750.Ql S:\& , 4751.Ql W:\& 4752or 4753.Ql P:\& 4754will loop over each session, window or pane and insert the format once 4755for each. 4756For windows and panes, two comma-separated formats may be given: 4757the second is used for the current window or active pane. 4758For example, to get a list of windows formatted like the status line: 4759.Bd -literal -offset indent 4760#{W:#{E:window-status-format} ,#{E:window-status-current-format} } 4761.Ed 4762.Pp 4763.Ql N:\& 4764checks if a window (without any suffix or with the 4765.Ql w 4766suffix) or a session (with the 4767.Ql s 4768suffix) name exists, for example 4769.Ql `N/w:foo` 4770is replaced with 1 if a window named 4771.Ql foo 4772exists. 4773.Pp 4774A prefix of the form 4775.Ql s/foo/bar/:\& 4776will substitute 4777.Ql foo 4778with 4779.Ql bar 4780throughout. 4781The first argument may be an extended regular expression and a final argument may be 4782.Ql i 4783to ignore case, for example 4784.Ql s/a(.)/\e1x/i:\& 4785would change 4786.Ql abABab 4787into 4788.Ql bxBxbx . 4789.Pp 4790In addition, the last line of a shell command's output may be inserted using 4791.Ql #() . 4792For example, 4793.Ql #(uptime) 4794will insert the system's uptime. 4795When constructing formats, 4796.Nm 4797does not wait for 4798.Ql #() 4799commands to finish; instead, the previous result from running the same command is used, 4800or a placeholder if the command has not been run before. 4801If the command hasn't exited, the most recent line of output will be used, but the status 4802line will not be updated more than once a second. 4803Commands are executed with the 4804.Nm 4805global environment set (see the 4806.Sx GLOBAL AND SESSION ENVIRONMENT 4807section). 4808.Pp 4809An 4810.Ql l 4811specifies that a string should be interpreted literally and not expanded. 4812For example 4813.Ql #{l:#{?pane_in_mode,yes,no}} 4814will be replaced by 4815.Ql #{?pane_in_mode,yes,no} . 4816.Pp 4817The following variables are available, where appropriate: 4818.Bl -column "XXXXXXXXXXXXXXXXXXX" "XXXXX" 4819.It Sy "Variable name" Ta Sy "Alias" Ta Sy "Replaced with" 4820.It Li "active_window_index" Ta "" Ta "Index of active window in session" 4821.It Li "alternate_on" Ta "" Ta "1 if pane is in alternate screen" 4822.It Li "alternate_saved_x" Ta "" Ta "Saved cursor X in alternate screen" 4823.It Li "alternate_saved_y" Ta "" Ta "Saved cursor Y in alternate screen" 4824.It Li "buffer_created" Ta "" Ta "Time buffer created" 4825.It Li "buffer_name" Ta "" Ta "Name of buffer" 4826.It Li "buffer_sample" Ta "" Ta "Sample of start of buffer" 4827.It Li "buffer_size" Ta "" Ta "Size of the specified buffer in bytes" 4828.It Li "client_activity" Ta "" Ta "Time client last had activity" 4829.It Li "client_cell_height" Ta "" Ta "Height of each client cell in pixels" 4830.It Li "client_cell_width" Ta "" Ta "Width of each client cell in pixels" 4831.It Li "client_control_mode" Ta "" Ta "1 if client is in control mode" 4832.It Li "client_created" Ta "" Ta "Time client created" 4833.It Li "client_discarded" Ta "" Ta "Bytes discarded when client behind" 4834.It Li "client_flags" Ta "" Ta "List of client flags" 4835.It Li "client_height" Ta "" Ta "Height of client" 4836.It Li "client_key_table" Ta "" Ta "Current key table" 4837.It Li "client_last_session" Ta "" Ta "Name of the client's last session" 4838.It Li "client_name" Ta "" Ta "Name of client" 4839.It Li "client_pid" Ta "" Ta "PID of client process" 4840.It Li "client_prefix" Ta "" Ta "1 if prefix key has been pressed" 4841.It Li "client_readonly" Ta "" Ta "1 if client is readonly" 4842.It Li "client_session" Ta "" Ta "Name of the client's session" 4843.It Li "client_termfeatures" Ta "" Ta "Terminal features of client, if any" 4844.It Li "client_termname" Ta "" Ta "Terminal name of client" 4845.It Li "client_termtype" Ta "" Ta "Terminal type of client, if available" 4846.It Li "client_tty" Ta "" Ta "Pseudo terminal of client" 4847.It Li "client_utf8" Ta "" Ta "1 if client supports UTF-8" 4848.It Li "client_width" Ta "" Ta "Width of client" 4849.It Li "client_written" Ta "" Ta "Bytes written to client" 4850.It Li "command" Ta "" Ta "Name of command in use, if any" 4851.It Li "command_list_alias" Ta "" Ta "Command alias if listing commands" 4852.It Li "command_list_name" Ta "" Ta "Command name if listing commands" 4853.It Li "command_list_usage" Ta "" Ta "Command usage if listing commands" 4854.It Li "config_files" Ta "" Ta "List of configuration files loaded" 4855.It Li "copy_cursor_line" Ta "" Ta "Line the cursor is on in copy mode" 4856.It Li "copy_cursor_word" Ta "" Ta "Word under cursor in copy mode" 4857.It Li "copy_cursor_x" Ta "" Ta "Cursor X position in copy mode" 4858.It Li "copy_cursor_y" Ta "" Ta "Cursor Y position in copy mode" 4859.It Li "cursor_character" Ta "" Ta "Character at cursor in pane" 4860.It Li "cursor_flag" Ta "" Ta "Pane cursor flag" 4861.It Li "cursor_x" Ta "" Ta "Cursor X position in pane" 4862.It Li "cursor_y" Ta "" Ta "Cursor Y position in pane" 4863.It Li "history_bytes" Ta "" Ta "Number of bytes in window history" 4864.It Li "history_limit" Ta "" Ta "Maximum window history lines" 4865.It Li "history_size" Ta "" Ta "Size of history in lines" 4866.It Li "hook" Ta "" Ta "Name of running hook, if any" 4867.It Li "hook_pane" Ta "" Ta "ID of pane where hook was run, if any" 4868.It Li "hook_session" Ta "" Ta "ID of session where hook was run, if any" 4869.It Li "hook_session_name" Ta "" Ta "Name of session where hook was run, if any" 4870.It Li "hook_window" Ta "" Ta "ID of window where hook was run, if any" 4871.It Li "hook_window_name" Ta "" Ta "Name of window where hook was run, if any" 4872.It Li "host" Ta "#H" Ta "Hostname of local host" 4873.It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)" 4874.It Li "insert_flag" Ta "" Ta "Pane insert flag" 4875.It Li "keypad_cursor_flag" Ta "" Ta "Pane keypad cursor flag" 4876.It Li "keypad_flag" Ta "" Ta "Pane keypad flag" 4877.It Li "last_window_index" Ta "" Ta "Index of last window in session" 4878.It Li "line" Ta "" Ta "Line number in the list" 4879.It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag" 4880.It Li "mouse_any_flag" Ta "" Ta "Pane mouse any flag" 4881.It Li "mouse_button_flag" Ta "" Ta "Pane mouse button flag" 4882.It Li "mouse_line" Ta "" Ta "Line under mouse, if any" 4883.It Li "mouse_sgr_flag" Ta "" Ta "Pane mouse SGR flag" 4884.It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag" 4885.It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag" 4886.It Li "mouse_word" Ta "" Ta "Word under mouse, if any" 4887.It Li "mouse_x" Ta "" Ta "Mouse X position, if any" 4888.It Li "mouse_y" Ta "" Ta "Mouse Y position, if any" 4889.It Li "origin_flag" Ta "" Ta "Pane origin flag" 4890.It Li "pane_active" Ta "" Ta "1 if active pane" 4891.It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window" 4892.It Li "pane_at_left" Ta "" Ta "1 if pane is at the left of window" 4893.It Li "pane_at_right" Ta "" Ta "1 if pane is at the right of window" 4894.It Li "pane_at_top" Ta "" Ta "1 if pane is at the top of window" 4895.It Li "pane_bg" Ta "" Ta "Pane background colour" 4896.It Li "pane_bottom" Ta "" Ta "Bottom of pane" 4897.It Li "pane_current_command" Ta "" Ta "Current command if available" 4898.It Li "pane_current_path" Ta "" Ta "Current path if available" 4899.It Li "pane_dead" Ta "" Ta "1 if pane is dead" 4900.It Li "pane_dead_status" Ta "" Ta "Exit status of process in dead pane" 4901.It Li "pane_fg" Ta "" Ta "Pane foreground colour" 4902.It Li "pane_format" Ta "" Ta "1 if format is for a pane" 4903.It Li "pane_height" Ta "" Ta "Height of pane" 4904.It Li "pane_id" Ta "#D" Ta "Unique pane ID" 4905.It Li "pane_in_mode" Ta "" Ta "1 if pane is in a mode" 4906.It Li "pane_index" Ta "#P" Ta "Index of pane" 4907.It Li "pane_input_off" Ta "" Ta "1 if input to pane is disabled" 4908.It Li "pane_last" Ta "" Ta "1 if last pane" 4909.It Li "pane_left" Ta "" Ta "Left of pane" 4910.It Li "pane_marked" Ta "" Ta "1 if this is the marked pane" 4911.It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set" 4912.It Li "pane_mode" Ta "" Ta "Name of pane mode, if any" 4913.It Li "pane_path" Ta "" Ta "Path of pane (can be set by application)" 4914.It Li "pane_pid" Ta "" Ta "PID of first process in pane" 4915.It Li "pane_pipe" Ta "" Ta "1 if pane is being piped" 4916.It Li "pane_right" Ta "" Ta "Right of pane" 4917.It Li "pane_search_string" Ta "" Ta "Last search string in copy mode" 4918.It Li "pane_start_command" Ta "" Ta "Command pane started with" 4919.It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized" 4920.It Li "pane_tabs" Ta "" Ta "Pane tab positions" 4921.It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)" 4922.It Li "pane_top" Ta "" Ta "Top of pane" 4923.It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane" 4924.It Li "pane_width" Ta "" Ta "Width of pane" 4925.It Li "pid" Ta "" Ta "Server PID" 4926.It Li "popup_key" Ta "" Ta "Key pressed in popup" 4927.It Li "popup_mouse_x" Ta "" Ta "Mouse X position in popup" 4928.It Li "popup_mouse_y" Ta "" Ta "Mouse Y position in popup" 4929.It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated" 4930.It Li "scroll_position" Ta "" Ta "Scroll position in copy mode" 4931.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane" 4932.It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane" 4933.It Li "search_match" Ta "" Ta "Search match if any" 4934.It Li "search_present" Ta "" Ta "1 if search started in copy mode" 4935.It Li "selection_active" Ta "" Ta "1 if selection started and changes with the cursor in copy mode" 4936.It Li "selection_end_x" Ta "" Ta "X position of the end of the selection" 4937.It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection" 4938.It Li "selection_present" Ta "" Ta "1 if selection started in copy mode" 4939.It Li "selection_start_x" Ta "" Ta "X position of the start of the selection" 4940.It Li "selection_start_y" Ta "" Ta "Y position of the start of the selection" 4941.It Li "session_activity" Ta "" Ta "Time of session last activity" 4942.It Li "session_alerts" Ta "" Ta "List of window indexes with alerts" 4943.It Li "session_attached" Ta "" Ta "Number of clients session is attached to" 4944.It Li "session_attached_list" Ta "" Ta "List of clients session is attached to" 4945.It Li "session_created" Ta "" Ta "Time session created" 4946.It Li "session_format" Ta "" Ta "1 if format is for a session" 4947.It Li "session_group" Ta "" Ta "Name of session group" 4948.It Li "session_group_attached" Ta "" Ta "Number of clients sessions in group are attached to" 4949.It Li "session_group_attached_list" Ta "" Ta "List of clients sessions in group are attached to" 4950.It Li "session_group_list" Ta "" Ta "List of sessions in group" 4951.It Li "session_group_many_attached" Ta "" Ta "1 if multiple clients attached to sessions in group" 4952.It Li "session_group_size" Ta "" Ta "Size of session group" 4953.It Li "session_grouped" Ta "" Ta "1 if session in a group" 4954.It Li "session_id" Ta "" Ta "Unique session ID" 4955.It Li "session_last_attached" Ta "" Ta "Time session last attached" 4956.It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached" 4957.It Li "session_marked" Ta "" Ta "1 if this session contains the marked pane" 4958.It Li "session_name" Ta "#S" Ta "Name of session" 4959.It Li "session_path" Ta "" Ta "Working directory of session" 4960.It Li "session_stack" Ta "" Ta "Window indexes in most recent order" 4961.It Li "session_windows" Ta "" Ta "Number of windows in session" 4962.It Li "socket_path" Ta "" Ta "Server socket path" 4963.It Li "start_time" Ta "" Ta "Server start time" 4964.It Li "version" Ta "" Ta "Server version" 4965.It Li "window_active" Ta "" Ta "1 if window active" 4966.It Li "window_active_clients" Ta "" Ta "Number of clients viewing this window" 4967.It Li "window_active_clients_list" Ta "" Ta "List of clients viewing this window" 4968.It Li "window_active_sessions" Ta "" Ta "Number of sessions on which this window is active" 4969.It Li "window_active_sessions_list" Ta "" Ta "List of sessions on which this window is active" 4970.It Li "window_activity" Ta "" Ta "Time of window last activity" 4971.It Li "window_activity_flag" Ta "" Ta "1 if window has activity" 4972.It Li "window_bell_flag" Ta "" Ta "1 if window has bell" 4973.It Li "window_bigger" Ta "" Ta "1 if window is larger than client" 4974.It Li "window_cell_height" Ta "" Ta "Height of each cell in pixels" 4975.It Li "window_cell_width" Ta "" Ta "Width of each cell in pixels" 4976.It Li "window_end_flag" Ta "" Ta "1 if window has the highest index" 4977.It Li "window_flags" Ta "#F" Ta "Window flags with # escaped as ##" 4978.It Li "window_raw_flags" Ta "" Ta "Window flags with nothing escaped" 4979.It Li "window_format" Ta "" Ta "1 if format is for a window" 4980.It Li "window_height" Ta "" Ta "Height of window" 4981.It Li "window_id" Ta "" Ta "Unique window ID" 4982.It Li "window_index" Ta "#I" Ta "Index of window" 4983.It Li "window_last_flag" Ta "" Ta "1 if window is the last used" 4984.It Li "window_layout" Ta "" Ta "Window layout description, ignoring zoomed window panes" 4985.It Li "window_linked" Ta "" Ta "1 if window is linked across sessions" 4986.It Li "window_linked_sessions" Ta "" Ta "Number of sessions this window is linked to" 4987.It Li "window_linked_sessions_list" Ta "" Ta "List of sessions this window is linked to" 4988.It Li "window_marked_flag" Ta "" Ta "1 if window contains the marked pane" 4989.It Li "window_name" Ta "#W" Ta "Name of window" 4990.It Li "window_offset_x" Ta "" Ta "X offset into window if larger than client" 4991.It Li "window_offset_y" Ta "" Ta "Y offset into window if larger than client" 4992.It Li "window_panes" Ta "" Ta "Number of panes in window" 4993.It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert" 4994.It Li "window_stack_index" Ta "" Ta "Index in session most recent stack" 4995.It Li "window_start_flag" Ta "" Ta "1 if window has the lowest index" 4996.It Li "window_visible_layout" Ta "" Ta "Window layout description, respecting zoomed window panes" 4997.It Li "window_width" Ta "" Ta "Width of window" 4998.It Li "window_zoomed_flag" Ta "" Ta "1 if window is zoomed" 4999.It Li "wrap_flag" Ta "" Ta "Pane wrap flag" 5000.El 5001.Sh STYLES 5002.Nm 5003offers various options to specify the colour and attributes of aspects of the 5004interface, for example 5005.Ic status-style 5006for the status line. 5007In addition, embedded styles may be specified in format options, such as 5008.Ic status-left , 5009by enclosing them in 5010.Ql #[ 5011and 5012.Ql \&] . 5013.Pp 5014A style may be the single term 5015.Ql default 5016to specify the default style (which may come from an option, for example 5017.Ic status-style 5018in the status line) or a space 5019or comma separated list of the following: 5020.Bl -tag -width Ds 5021.It Ic fg=colour 5022Set the foreground colour. 5023The colour is one of: 5024.Ic black , 5025.Ic red , 5026.Ic green , 5027.Ic yellow , 5028.Ic blue , 5029.Ic magenta , 5030.Ic cyan , 5031.Ic white ; 5032if supported the bright variants 5033.Ic brightred , 5034.Ic brightgreen , 5035.Ic brightyellow ; 5036.Ic colour0 5037to 5038.Ic colour255 5039from the 256-colour set; 5040.Ic default 5041for the default colour; 5042.Ic terminal 5043for the terminal default colour; or a hexadecimal RGB string such as 5044.Ql #ffffff . 5045.It Ic bg=colour 5046Set the background colour. 5047.It Ic none 5048Set no attributes (turn off any active attributes). 5049.It Xo Ic acs , 5050.Ic bright 5051(or 5052.Ic bold ) , 5053.Ic dim , 5054.Ic underscore , 5055.Ic blink , 5056.Ic reverse , 5057.Ic hidden , 5058.Ic italics , 5059.Ic overline , 5060.Ic strikethrough , 5061.Ic double-underscore , 5062.Ic curly-underscore , 5063.Ic dotted-underscore , 5064.Ic dashed-underscore 5065.Xc 5066Set an attribute. 5067Any of the attributes may be prefixed with 5068.Ql no 5069to unset. 5070.Ic acs 5071is the terminal alternate character set. 5072.It Xo Ic align=left 5073(or 5074.Ic noalign ) , 5075.Ic align=centre , 5076.Ic align=right 5077.Xc 5078Align text to the left, centre or right of the available space if appropriate. 5079.It Ic fill=colour 5080Fill the available space with a background colour if appropriate. 5081.It Xo Ic list=on , 5082.Ic list=focus , 5083.Ic list=left-marker , 5084.Ic list=right-marker , 5085.Ic nolist 5086.Xc 5087Mark the position of the various window list components in the 5088.Ic status-format 5089option: 5090.Ic list=on 5091marks the start of the list; 5092.Ic list=focus 5093is the part of the list that should be kept in focus if the entire list won't fit 5094in the available space (typically the current window); 5095.Ic list=left-marker 5096and 5097.Ic list=right-marker 5098mark the text to be used to mark that text has been trimmed from the left or 5099right of the list if there is not enough space. 5100.It Xo Ic push-default , 5101.Ic pop-default 5102.Xc 5103Store the current colours and attributes as the default or reset to the previous 5104default. 5105A 5106.Ic push-default 5107affects any subsequent use of the 5108.Ic default 5109term until a 5110.Ic pop-default . 5111Only one default may be pushed (each 5112.Ic push-default 5113replaces the previous saved default). 5114.It Xo Ic range=left , 5115.Ic range=right , 5116.Ic range=window|X , 5117.Ic norange 5118.Xc 5119Mark a range in the 5120.Ic status-format 5121option. 5122.Ic range=left 5123and 5124.Ic range=right 5125are the text used for the 5126.Ql StatusLeft 5127and 5128.Ql StatusRight 5129mouse keys. 5130.Ic range=window|X 5131is the range for a window passed to the 5132.Ql Status 5133mouse key, where 5134.Ql X 5135is a window index. 5136.El 5137.Pp 5138Examples are: 5139.Bd -literal -offset indent 5140fg=yellow bold underscore blink 5141bg=black,fg=default,noreverse 5142.Ed 5143.Sh NAMES AND TITLES 5144.Nm 5145distinguishes between names and titles. 5146Windows and sessions have names, which may be used to specify them in targets 5147and are displayed in the status line and various lists: the name is the 5148.Nm 5149identifier for a window or session. 5150Only panes have titles. 5151A pane's title is typically set by the program running inside the pane using 5152an escape sequence (like it would set the 5153.Xr xterm 1 5154window title in 5155.Xr X 7 ) . 5156Windows themselves do not have titles - a window's title is the title of its 5157active pane. 5158.Nm 5159itself may set the title of the terminal in which the client is running, see 5160the 5161.Ic set-titles 5162option. 5163.Pp 5164A session's name is set with the 5165.Ic new-session 5166and 5167.Ic rename-session 5168commands. 5169A window's name is set with one of: 5170.Bl -enum -width Ds 5171.It 5172A command argument (such as 5173.Fl n 5174for 5175.Ic new-window 5176or 5177.Ic new-session ) . 5178.It 5179An escape sequence (if the 5180.Ic allow-rename 5181option is turned on): 5182.Bd -literal -offset indent 5183$ printf '\e033kWINDOW_NAME\e033\e\e' 5184.Ed 5185.It 5186Automatic renaming, which sets the name to the active command in the window's 5187active pane. 5188See the 5189.Ic automatic-rename 5190option. 5191.El 5192.Pp 5193When a pane is first created, its title is the hostname. 5194A pane's title can be set via the title setting escape sequence, for example: 5195.Bd -literal -offset indent 5196$ printf '\e033]2;My Title\e033\e\e' 5197.Ed 5198.Pp 5199It can also be modified with the 5200.Ic select-pane 5201.Fl T 5202command. 5203.Sh GLOBAL AND SESSION ENVIRONMENT 5204When the server is started, 5205.Nm 5206copies the environment into the 5207.Em global environment ; 5208in addition, each session has a 5209.Em session environment . 5210When a window is created, the session and global environments are merged. 5211If a variable exists in both, the value from the session environment is used. 5212The result is the initial environment passed to the new process. 5213.Pp 5214The 5215.Ic update-environment 5216session option may be used to update the session environment from the client 5217when a new session is created or an old reattached. 5218.Nm 5219also initialises the 5220.Ev TMUX 5221variable with some internal information to allow commands to be executed 5222from inside, and the 5223.Ev TERM 5224variable with the correct terminal setting of 5225.Ql screen . 5226.Pp 5227Variables in both session and global environments may be marked as hidden. 5228Hidden variables are not passed into the environment of new processes and 5229instead can only be used by tmux itself (for example in formats, see the 5230.Sx FORMATS 5231section). 5232.Pp 5233Commands to alter and view the environment are: 5234.Bl -tag -width Ds 5235.It Xo Ic set-environment 5236.Op Fl Fhgru 5237.Op Fl t Ar target-session 5238.Ar name Op Ar value 5239.Xc 5240.D1 (alias: Ic setenv ) 5241Set or unset an environment variable. 5242If 5243.Fl g 5244is used, the change is made in the global environment; otherwise, it is applied 5245to the session environment for 5246.Ar target-session . 5247If 5248.Fl F 5249is present, then 5250.Ar value 5251is expanded as a format. 5252The 5253.Fl u 5254flag unsets a variable. 5255.Fl r 5256indicates the variable is to be removed from the environment before starting a 5257new process. 5258.Fl h 5259marks the variable as hidden. 5260.It Xo Ic show-environment 5261.Op Fl hgs 5262.Op Fl t Ar target-session 5263.Op Ar variable 5264.Xc 5265.D1 (alias: Ic showenv ) 5266Display the environment for 5267.Ar target-session 5268or the global environment with 5269.Fl g . 5270If 5271.Ar variable 5272is omitted, all variables are shown. 5273Variables removed from the environment are prefixed with 5274.Ql - . 5275If 5276.Fl s 5277is used, the output is formatted as a set of Bourne shell commands. 5278.Fl h 5279shows hidden variables (omitted by default). 5280.El 5281.Sh STATUS LINE 5282.Nm 5283includes an optional status line which is displayed in the bottom line of each 5284terminal. 5285.Pp 5286By default, the status line is enabled and one line in height (it may be 5287disabled or made multiple lines with the 5288.Ic status 5289session option) and contains, from left-to-right: the name of the current 5290session in square brackets; the window list; the title of the active pane 5291in double quotes; and the time and date. 5292.Pp 5293Each line of the status line is configured with the 5294.Ic status-format 5295option. 5296The default is made of three parts: configurable left and right sections (which 5297may contain dynamic content such as the time or output from a shell command, 5298see the 5299.Ic status-left , 5300.Ic status-left-length , 5301.Ic status-right , 5302and 5303.Ic status-right-length 5304options below), and a central window list. 5305By default, the window list shows the index, name and (if any) flag of the 5306windows present in the current session in ascending numerical order. 5307It may be customised with the 5308.Ar window-status-format 5309and 5310.Ar window-status-current-format 5311options. 5312The flag is one of the following symbols appended to the window name: 5313.Bl -column "Symbol" "Meaning" -offset indent 5314.It Sy "Symbol" Ta Sy "Meaning" 5315.It Li "*" Ta "Denotes the current window." 5316.It Li "-" Ta "Marks the last window (previously selected)." 5317.It Li "#" Ta "Window activity is monitored and activity has been detected." 5318.It Li "\&!" Ta "Window bells are monitored and a bell has occurred in the window." 5319.It Li "~" Ta "The window has been silent for the monitor-silence interval." 5320.It Li "M" Ta "The window contains the marked pane." 5321.It Li "Z" Ta "The window's active pane is zoomed." 5322.El 5323.Pp 5324The # symbol relates to the 5325.Ic monitor-activity 5326window option. 5327The window name is printed in inverted colours if an alert (bell, activity or 5328silence) is present. 5329.Pp 5330The colour and attributes of the status line may be configured, the entire 5331status line using the 5332.Ic status-style 5333session option and individual windows using the 5334.Ic window-status-style 5335window option. 5336.Pp 5337The status line is automatically refreshed at interval if it has changed, the 5338interval may be controlled with the 5339.Ic status-interval 5340session option. 5341.Pp 5342Commands related to the status line are as follows: 5343.Bl -tag -width Ds 5344.It Xo Ic command-prompt 5345.Op Fl 1ikNTW 5346.Op Fl I Ar inputs 5347.Op Fl p Ar prompts 5348.Op Fl t Ar target-client 5349.Op Ar template 5350.Xc 5351Open the command prompt in a client. 5352This may be used from inside 5353.Nm 5354to execute commands interactively. 5355.Pp 5356If 5357.Ar template 5358is specified, it is used as the command. 5359If present, 5360.Fl I 5361is a comma-separated list of the initial text for each prompt. 5362If 5363.Fl p 5364is given, 5365.Ar prompts 5366is a comma-separated list of prompts which are displayed in order; otherwise 5367a single prompt is displayed, constructed from 5368.Ar template 5369if it is present, or 5370.Ql \&: 5371if not. 5372.Pp 5373Before the command is executed, the first occurrence of the string 5374.Ql %% 5375and all occurrences of 5376.Ql %1 5377are replaced by the response to the first prompt, all 5378.Ql %2 5379are replaced with the response to the second prompt, and so on for further 5380prompts. 5381Up to nine prompt responses may be replaced 5382.Po 5383.Ql %1 5384to 5385.Ql %9 5386.Pc . 5387.Ql %%% 5388is like 5389.Ql %% 5390but any quotation marks are escaped. 5391.Pp 5392.Fl 1 5393makes the prompt only accept one key press, in this case the resulting input 5394is a single character. 5395.Fl k 5396is like 5397.Fl 1 5398but the key press is translated to a key name. 5399.Fl N 5400makes the prompt only accept numeric key presses. 5401.Fl i 5402executes the command every time the prompt input changes instead of when the 5403user exits the command prompt. 5404.Fl T 5405tells 5406.Nm 5407that the prompt is for a target which affects what completions are offered when 5408.Em Tab 5409is pressed; 5410.Fl W 5411is similar but indicates the prompt is for a window. 5412.Pp 5413The following keys have a special meaning in the command prompt, depending 5414on the value of the 5415.Ic status-keys 5416option: 5417.Bl -column "FunctionXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXX" "emacsX" -offset indent 5418.It Sy "Function" Ta Sy "vi" Ta Sy "emacs" 5419.It Li "Cancel command prompt" Ta "q" Ta "Escape" 5420.It Li "Delete from cursor to start of word" Ta "" Ta "C-w" 5421.It Li "Delete entire command" Ta "d" Ta "C-u" 5422.It Li "Delete from cursor to end" Ta "D" Ta "C-k" 5423.It Li "Execute command" Ta "Enter" Ta "Enter" 5424.It Li "Get next command from history" Ta "" Ta "Down" 5425.It Li "Get previous command from history" Ta "" Ta "Up" 5426.It Li "Insert top paste buffer" Ta "p" Ta "C-y" 5427.It Li "Look for completions" Ta "Tab" Ta "Tab" 5428.It Li "Move cursor left" Ta "h" Ta "Left" 5429.It Li "Move cursor right" Ta "l" Ta "Right" 5430.It Li "Move cursor to end" Ta "$" Ta "C-e" 5431.It Li "Move cursor to next word" Ta "w" Ta "M-f" 5432.It Li "Move cursor to previous word" Ta "b" Ta "M-b" 5433.It Li "Move cursor to start" Ta "0" Ta "C-a" 5434.It Li "Transpose characters" Ta "" Ta "C-t" 5435.El 5436.It Xo Ic confirm-before 5437.Op Fl p Ar prompt 5438.Op Fl t Ar target-client 5439.Ar command 5440.Xc 5441.D1 (alias: Ic confirm ) 5442Ask for confirmation before executing 5443.Ar command . 5444If 5445.Fl p 5446is given, 5447.Ar prompt 5448is the prompt to display; otherwise a prompt is constructed from 5449.Ar command . 5450It may contain the special character sequences supported by the 5451.Ic status-left 5452option. 5453.Pp 5454This command works only from inside 5455.Nm . 5456.It Xo Ic display-menu 5457.Op Fl O 5458.Op Fl c Ar target-client 5459.Op Fl t Ar target-pane 5460.Op Fl T Ar title 5461.Op Fl x Ar position 5462.Op Fl y Ar position 5463.Ar name 5464.Ar key 5465.Ar command 5466.Ar ... 5467.Xc 5468.D1 (alias: Ic menu ) 5469Display a menu on 5470.Ar target-client . 5471.Ar target-pane 5472gives the target for any commands run from the menu. 5473.Pp 5474A menu is passed as a series of arguments: first the menu item name, 5475second the key shortcut (or empty for none) and third the command 5476to run when the menu item is chosen. 5477The name and command are formats, see the 5478.Sx FORMATS 5479and 5480.Sx STYLES 5481sections. 5482If the name begins with a hyphen (-), then the item is disabled (shown dim) and 5483may not be chosen. 5484The name may be empty for a separator line, in which case both the key and 5485command should be omitted. 5486.Pp 5487.Fl T 5488is a format for the menu title (see 5489.Sx FORMATS ) . 5490.Pp 5491.Fl x 5492and 5493.Fl y 5494give the position of the menu. 5495Both may be a row or column number, or one of the following special values: 5496.Bl -column "XXXXX" "XXXX" -offset indent 5497.It Sy "Value" Ta Sy "Flag" Ta Sy "Meaning" 5498.It Li "C" Ta "Both" Ta "The centre of the terminal" 5499.It Li "R" Ta Fl x Ta "The right side of the terminal" 5500.It Li "P" Ta "Both" Ta "The bottom left of the pane" 5501.It Li "M" Ta "Both" Ta "The mouse position" 5502.It Li "W" Ta "Both" Ta "The window position on the status line" 5503.It Li "S" Ta Fl y Ta "The line above or below the status line" 5504.El 5505.Pp 5506Or a format, which is expanded including the following additional variables: 5507.Bl -column "XXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent 5508.It Sy "Variable name" Ta Sy "Replaced with" 5509.It Li "popup_centre_x" Ta "Centered in the client" 5510.It Li "popup_centre_y" Ta "Centered in the client" 5511.It Li "popup_height" Ta "Height of menu or popup" 5512.It Li "popup_mouse_bottom" Ta "Bottom of at the mouse" 5513.It Li "popup_mouse_centre_x" Ta "Horizontal centre at the mouse" 5514.It Li "popup_mouse_centre_y" Ta "Vertical centre at the mouse" 5515.It Li "popup_mouse_top" Ta "Top at the mouse" 5516.It Li "popup_mouse_x" Ta "Mouse X position" 5517.It Li "popup_mouse_y" Ta "Mouse Y position" 5518.It Li "popup_pane_bottom" Ta "Bottom of the pane" 5519.It Li "popup_pane_left" Ta "Left of the pane" 5520.It Li "popup_pane_right" Ta "Right of the pane" 5521.It Li "popup_pane_top" Ta "Top of the pane" 5522.It Li "popup_status_line_y" Ta "Above or below the status line" 5523.It Li "popup_width" Ta "Width of menu or popup" 5524.It Li "popup_window_status_line_x" Ta "At the window position in status line" 5525.It Li "popup_window_status_line_y" Ta "At the status line showing the window" 5526.El 5527.Pp 5528Each menu consists of items followed by a key shortcut shown in brackets. 5529If the menu is too large to fit on the terminal, it is not displayed. 5530Pressing the key shortcut chooses the corresponding item. 5531If the mouse is enabled and the menu is opened from a mouse key binding, 5532releasing the mouse button with an item selected chooses that item and 5533releasing the mouse button without an item selected closes the menu. 5534.Fl O 5535changes this behaviour so that the menu does not close when the mouse button is 5536released without an item selected the menu is not closed and a mouse button 5537must be clicked to choose an item. 5538.Pp 5539The following keys are also available: 5540.Bl -column "Key" "Function" -offset indent 5541.It Sy "Key" Ta Sy "Function" 5542.It Li "Enter" Ta "Choose selected item" 5543.It Li "Up" Ta "Select previous item" 5544.It Li "Down" Ta "Select next item" 5545.It Li "q" Ta "Exit menu" 5546.El 5547.It Xo Ic display-message 5548.Op Fl aIpv 5549.Op Fl c Ar target-client 5550.Op Fl d Ar delay 5551.Op Fl t Ar target-pane 5552.Op Ar message 5553.Xc 5554.D1 (alias: Ic display ) 5555Display a message. 5556If 5557.Fl p 5558is given, the output is printed to stdout, otherwise it is displayed in the 5559.Ar target-client 5560status line for up to 5561.Ar delay 5562milliseconds. 5563If 5564.Ar delay 5565is not given, the 5566.Ic message-time 5567option is used; a delay of zero waits for a key press. 5568The format of 5569.Ar message 5570is described in the 5571.Sx FORMATS 5572section; information is taken from 5573.Ar target-pane 5574if 5575.Fl t 5576is given, otherwise the active pane. 5577.Pp 5578.Fl v 5579prints verbose logging as the format is parsed and 5580.Fl a 5581lists the format variables and their values. 5582.Pp 5583.Fl I 5584forwards any input read from stdin to the empty pane given by 5585.Ar target-pane . 5586.It Xo Ic display-popup 5587.Op Fl CEK 5588.Op Fl c Ar target-client 5589.Op Fl d Ar start-directory 5590.Op Fl h Ar height 5591.Op Fl R Ar shell-command 5592.Op Fl t Ar target-pane 5593.Op Fl w Ar width 5594.Op Fl x Ar position 5595.Op Fl y Ar position 5596.Op Ar command Ar line Ar ... 5597.Xc 5598.D1 (alias: Ic popup ) 5599Display a popup on 5600.Ar target-client . 5601A popup is a rectangular box drawn over the top of any panes. 5602Panes are not updated while a popup is present. 5603The popup content may be given in two ways: 5604.Bl -enum -offset Ds 5605.It 5606A set of lines as arguments. 5607Each line is a format which is expanded using 5608.Ar target-pane 5609as the target. 5610If a line contains newlines it is split into multiple lines. 5611Lines may use styles, see the 5612.Sx STYLES 5613section. 5614.It 5615A shell command given by 5616.Fl R 5617which is run and any output shown in the pane. 5618.El 5619.Pp 5620The first argument, 5621.Ar command , 5622is a 5623.Nm 5624command which is run when a key is pressed. 5625The key is available in the 5626.Ql popup_key 5627format. 5628After 5629.Ar command 5630is run, the popup is closed. 5631It may be empty to discard any key presses. 5632If 5633.Fl K 5634is given together with 5635.Fl R , 5636key presses are instead passed to the 5637.Fl R 5638shell command. 5639.Fl E 5640closes the popup automatically when 5641.Ar shell-command 5642exits. 5643Two 5644.Fl E 5645closes the popup only if 5646.Ar shell-command 5647exited with success. 5648With 5649.Fl K , 5650.Ql Escape 5651and 5652.Ql C-c 5653close the popup unless 5654.Fl E 5655is also given. 5656.Pp 5657.Fl x 5658and 5659.Fl y 5660give the position of the popup, they have the same meaning as for the 5661.Ic display-menu 5662command. 5663.Fl w 5664and 5665.Fl h 5666give the width and height - both may be a percentage (followed by 5667.Ql % ) . 5668If omitted, without 5669.Fl R 5670they are calculated from the given lines and with 5671.Fl R 5672they use half the terminal size. 5673.Pp 5674The 5675.Fl C 5676flag closes any popup on the client. 5677.El 5678.Sh BUFFERS 5679.Nm 5680maintains a set of named 5681.Em paste buffers . 5682Each buffer may be either explicitly or automatically named. 5683Explicitly named buffers are named when created with the 5684.Ic set-buffer 5685or 5686.Ic load-buffer 5687commands, or by renaming an automatically named buffer with 5688.Ic set-buffer 5689.Fl n . 5690Automatically named buffers are given a name such as 5691.Ql buffer0001 , 5692.Ql buffer0002 5693and so on. 5694When the 5695.Ic buffer-limit 5696option is reached, the oldest automatically named buffer is deleted. 5697Explicitly named buffers are not subject to 5698.Ic buffer-limit 5699and may be deleted with the 5700.Ic delete-buffer 5701command. 5702.Pp 5703Buffers may be added using 5704.Ic copy-mode 5705or the 5706.Ic set-buffer 5707and 5708.Ic load-buffer 5709commands, and pasted into a window using the 5710.Ic paste-buffer 5711command. 5712If a buffer command is used and no buffer is specified, the most 5713recently added automatically named buffer is assumed. 5714.Pp 5715A configurable history buffer is also maintained for each window. 5716By default, up to 2000 lines are kept; this can be altered with the 5717.Ic history-limit 5718option (see the 5719.Ic set-option 5720command above). 5721.Pp 5722The buffer commands are as follows: 5723.Bl -tag -width Ds 5724.It Xo 5725.Ic choose-buffer 5726.Op Fl NZr 5727.Op Fl F Ar format 5728.Op Fl f Ar filter 5729.Op Fl O Ar sort-order 5730.Op Fl t Ar target-pane 5731.Op Ar template 5732.Xc 5733Put a pane into buffer mode, where a buffer may be chosen interactively from 5734a list. 5735.Fl Z 5736zooms the pane. 5737The following keys may be used in buffer mode: 5738.Bl -column "Key" "Function" -offset indent 5739.It Sy "Key" Ta Sy "Function" 5740.It Li "Enter" Ta "Paste selected buffer" 5741.It Li "Up" Ta "Select previous buffer" 5742.It Li "Down" Ta "Select next buffer" 5743.It Li "C-s" Ta "Search by name or content" 5744.It Li "n" Ta "Repeat last search" 5745.It Li "t" Ta "Toggle if buffer is tagged" 5746.It Li "T" Ta "Tag no buffers" 5747.It Li "C-t" Ta "Tag all buffers" 5748.It Li "p" Ta "Paste selected buffer" 5749.It Li "P" Ta "Paste tagged buffers" 5750.It Li "d" Ta "Delete selected buffer" 5751.It Li "D" Ta "Delete tagged buffers" 5752.It Li "e" Ta "Open the buffer in an editor" 5753.It Li "f" Ta "Enter a format to filter items" 5754.It Li "O" Ta "Change sort field" 5755.It Li "r" Ta "Reverse sort order" 5756.It Li "v" Ta "Toggle preview" 5757.It Li "q" Ta "Exit mode" 5758.El 5759.Pp 5760After a buffer is chosen, 5761.Ql %% 5762is replaced by the buffer name in 5763.Ar template 5764and the result executed as a command. 5765If 5766.Ar template 5767is not given, "paste-buffer -b '%%'" is used. 5768.Pp 5769.Fl O 5770specifies the initial sort field: one of 5771.Ql time , 5772.Ql name 5773or 5774.Ql size . 5775.Fl r 5776reverses the sort order. 5777.Fl f 5778specifies an initial filter: the filter is a format - if it evaluates to zero, 5779the item in the list is not shown, otherwise it is shown. 5780If a filter would lead to an empty list, it is ignored. 5781.Fl F 5782specifies the format for each item in the list. 5783.Fl N 5784starts without the preview. 5785This command works only if at least one client is attached. 5786.It Ic clear-history Op Fl t Ar target-pane 5787.D1 (alias: Ic clearhist ) 5788Remove and free the history for the specified pane. 5789.It Ic delete-buffer Op Fl b Ar buffer-name 5790.D1 (alias: Ic deleteb ) 5791Delete the buffer named 5792.Ar buffer-name , 5793or the most recently added automatically named buffer if not specified. 5794.It Xo Ic list-buffers 5795.Op Fl F Ar format 5796.Op Fl f Ar filter 5797.Xc 5798.D1 (alias: Ic lsb ) 5799List the global buffers. 5800.Fl F 5801specifies the format of each line and 5802.Fl f 5803a filter. 5804Only buffers for which the filter is true are shown. 5805See the 5806.Sx FORMATS 5807section. 5808.It Xo Ic load-buffer 5809.Op Fl w 5810.Op Fl b Ar buffer-name 5811.Op Fl t Ar target-client 5812.Ar path 5813.Xc 5814.D1 (alias: Ic loadb ) 5815Load the contents of the specified paste buffer from 5816.Ar path . 5817If 5818.Fl w 5819is given, the buffer is also sent to the clipboard for 5820.Ar target-client 5821using the 5822.Xr xterm 1 5823escape sequence, if possible. 5824.It Xo Ic paste-buffer 5825.Op Fl dpr 5826.Op Fl b Ar buffer-name 5827.Op Fl s Ar separator 5828.Op Fl t Ar target-pane 5829.Xc 5830.D1 (alias: Ic pasteb ) 5831Insert the contents of a paste buffer into the specified pane. 5832If not specified, paste into the current one. 5833With 5834.Fl d , 5835also delete the paste buffer. 5836When output, any linefeed (LF) characters in the paste buffer are replaced with 5837a separator, by default carriage return (CR). 5838A custom separator may be specified using the 5839.Fl s 5840flag. 5841The 5842.Fl r 5843flag means to do no replacement (equivalent to a separator of LF). 5844If 5845.Fl p 5846is specified, paste bracket control codes are inserted around the 5847buffer if the application has requested bracketed paste mode. 5848.It Xo Ic save-buffer 5849.Op Fl a 5850.Op Fl b Ar buffer-name 5851.Ar path 5852.Xc 5853.D1 (alias: Ic saveb ) 5854Save the contents of the specified paste buffer to 5855.Ar path . 5856The 5857.Fl a 5858option appends to rather than overwriting the file. 5859.It Xo Ic set-buffer 5860.Op Fl aw 5861.Op Fl b Ar buffer-name 5862.Op Fl t Ar target-client 5863.Op Fl n Ar new-buffer-name 5864.Ar data 5865.Xc 5866.D1 (alias: Ic setb ) 5867Set the contents of the specified buffer to 5868.Ar data . 5869If 5870.Fl w 5871is given, the buffer is also sent to the clipboard for 5872.Ar target-client 5873using the 5874.Xr xterm 1 5875escape sequence, if possible. 5876The 5877.Fl a 5878option appends to rather than overwriting the buffer. 5879The 5880.Fl n 5881option renames the buffer to 5882.Ar new-buffer-name . 5883.It Xo Ic show-buffer 5884.Op Fl b Ar buffer-name 5885.Xc 5886.D1 (alias: Ic showb ) 5887Display the contents of the specified buffer. 5888.El 5889.Sh MISCELLANEOUS 5890Miscellaneous commands are as follows: 5891.Bl -tag -width Ds 5892.It Ic clock-mode Op Fl t Ar target-pane 5893Display a large clock. 5894.It Xo Ic if-shell 5895.Op Fl bF 5896.Op Fl t Ar target-pane 5897.Ar shell-command command 5898.Op Ar command 5899.Xc 5900.D1 (alias: Ic if ) 5901Execute the first 5902.Ar command 5903if 5904.Ar shell-command 5905returns success or the second 5906.Ar command 5907otherwise. 5908Before being executed, 5909.Ar shell-command 5910is expanded using the rules specified in the 5911.Sx FORMATS 5912section, including those relevant to 5913.Ar target-pane . 5914With 5915.Fl b , 5916.Ar shell-command 5917is run in the background. 5918.Pp 5919If 5920.Fl F 5921is given, 5922.Ar shell-command 5923is not executed but considered success if neither empty nor zero (after formats 5924are expanded). 5925.It Ic lock-server 5926.D1 (alias: Ic lock ) 5927Lock each client individually by running the command specified by the 5928.Ic lock-command 5929option. 5930.It Xo Ic run-shell 5931.Op Fl bC 5932.Op Fl d Ar delay 5933.Op Fl t Ar target-pane 5934.Op Ar shell-command 5935.Xc 5936.D1 (alias: Ic run ) 5937Execute 5938.Ar shell-command 5939or (with 5940.Fl C ) 5941a 5942.Nm 5943command in the background without creating a window. 5944Before being executed, 5945.Ar shell-command 5946is expanded using the rules specified in the 5947.Sx FORMATS 5948section. 5949With 5950.Fl b , 5951the command is run in the background. 5952.Fl d 5953waits for 5954.Ar delay 5955seconds before starting the command. 5956If 5957.Fl C 5958is not given, any output to stdout is displayed in view mode (in the pane 5959specified by 5960.Fl t 5961or the current pane if omitted) after the command finishes. 5962If the command fails, the exit status is also displayed. 5963.It Xo Ic wait-for 5964.Op Fl L | S | U 5965.Ar channel 5966.Xc 5967.D1 (alias: Ic wait ) 5968When used without options, prevents the client from exiting until woken using 5969.Ic wait-for 5970.Fl S 5971with the same channel. 5972When 5973.Fl L 5974is used, the channel is locked and any clients that try to lock the same 5975channel are made to wait until the channel is unlocked with 5976.Ic wait-for 5977.Fl U . 5978.El 5979.Sh EXIT MESSAGES 5980When a 5981.Nm 5982client detaches, it prints a message. 5983This may be one of: 5984.Bl -tag -width Ds 5985.It detached (from session ...) 5986The client was detached normally. 5987.It detached and SIGHUP 5988The client was detached and its parent sent the 5989.Dv SIGHUP 5990signal (for example with 5991.Ic detach-client 5992.Fl P ) . 5993.It lost tty 5994The client's 5995.Xr tty 4 5996or 5997.Xr pty 4 5998was unexpectedly destroyed. 5999.It terminated 6000The client was killed with 6001.Dv SIGTERM . 6002.It too far behind 6003The client is in control mode and became unable to keep up with the data from 6004.Nm . 6005.It exited 6006The server exited when it had no sessions. 6007.It server exited 6008The server exited when it received 6009.Dv SIGTERM . 6010.It server exited unexpectedly 6011The server crashed or otherwise exited without telling the client the reason. 6012.El 6013.Sh TERMINFO EXTENSIONS 6014.Nm 6015understands some unofficial extensions to 6016.Xr terminfo 5 . 6017It is not normally necessary to set these manually, instead the 6018.Ic terminal-features 6019option should be used. 6020.Bl -tag -width Ds 6021.It Em \&AX 6022An existing extension that tells 6023.Nm 6024the terminal supports default colours. 6025.It Em \&Bidi 6026Tell 6027.Nm 6028that the terminal supports the VTE bidirectional text extensions. 6029.It Em \&Cs , Cr 6030Set the cursor colour. 6031The first takes a single string argument and is used to set the colour; 6032the second takes no arguments and restores the default cursor colour. 6033If set, a sequence such as this may be used 6034to change the cursor colour from inside 6035.Nm : 6036.Bd -literal -offset indent 6037$ printf '\e033]12;red\e033\e\e' 6038.Ed 6039.It Em \&Cmg, \&Clmg, \&Dsmg , \&Enmg 6040Set, clear, disable or enable DECSLRM margins. 6041These are set automatically if the terminal reports it is 6042.Em VT420 6043compatible. 6044.It Em \&Dsbp , \&Enbp 6045Disable and enable bracketed paste. 6046These are set automatically if the 6047.Em XT 6048capability is present. 6049.It Em \&Dseks , \&Eneks 6050Disable and enable extended keys. 6051.It Em \&Dsfcs , \&Enfcs 6052Disable and enable focus reporting. 6053These are set automatically if the 6054.Em XT 6055capability is present. 6056.It Em \&Smol 6057Enable the overline attribute. 6058.It Em \&Smulx 6059Set a styled underscore. 6060The single parameter is one of: 0 for no underscore, 1 for normal 6061underscore, 2 for double underscore, 3 for curly underscore, 4 for dotted 6062underscore and 5 for dashed underscore. 6063.It Em \&Setulc , \&ol 6064Set the underscore colour or reset to the default. 6065The argument is (red * 65536) + (green * 256) + blue where each is between 0 6066and 255. 6067.It Em \&Ss , Se 6068Set or reset the cursor style. 6069If set, a sequence such as this may be used 6070to change the cursor to an underline: 6071.Bd -literal -offset indent 6072$ printf '\e033[4 q' 6073.Ed 6074.Pp 6075If 6076.Em Se 6077is not set, \&Ss with argument 0 will be used to reset the cursor style instead. 6078.It Em \&Sync 6079Start (parameter is 1) or end (parameter is 2) a synchronized update. 6080.It Em \&Tc 6081Indicate that the terminal supports the 6082.Ql direct colour 6083RGB escape sequence (for example, \ee[38;2;255;255;255m). 6084.Pp 6085If supported, this is used for the initialize colour escape sequence (which 6086may be enabled by adding the 6087.Ql initc 6088and 6089.Ql ccc 6090capabilities to the 6091.Nm 6092.Xr terminfo 5 6093entry). 6094.Pp 6095This is equivalent to the 6096.Em RGB 6097.Xr terminfo 5 6098capability. 6099.It Em \&Ms 6100Store the current buffer in the host terminal's selection (clipboard). 6101See the 6102.Em set-clipboard 6103option above and the 6104.Xr xterm 1 6105man page. 6106.It Em \&XT 6107This is an existing extension capability that tmux uses to mean that the 6108terminal supports the 6109.Xr xterm 1 6110title set sequences and to automatically set some of the capabilities above. 6111.El 6112.Sh CONTROL MODE 6113.Nm 6114offers a textual interface called 6115.Em control mode . 6116This allows applications to communicate with 6117.Nm 6118using a simple text-only protocol. 6119.Pp 6120In control mode, a client sends 6121.Nm 6122commands or command sequences terminated by newlines on standard input. 6123Each command will produce one block of output on standard output. 6124An output block consists of a 6125.Em %begin 6126line followed by the output (which may be empty). 6127The output block ends with a 6128.Em %end 6129or 6130.Em %error . 6131.Em %begin 6132and matching 6133.Em %end 6134or 6135.Em %error 6136have two arguments: an integer time (as seconds from epoch) and command number. 6137For example: 6138.Bd -literal -offset indent 6139%begin 1363006971 2 61400: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active) 6141%end 1363006971 2 6142.Ed 6143.Pp 6144The 6145.Ic refresh-client 6146.Fl C 6147command may be used to set the size of a client in control mode. 6148.Pp 6149In control mode, 6150.Nm 6151outputs notifications. 6152A notification will never occur inside an output block. 6153.Pp 6154The following notifications are defined: 6155.Bl -tag -width Ds 6156.It Ic %client-session-changed Ar client session-id name 6157The client is now attached to the session with ID 6158.Ar session-id , 6159which is named 6160.Ar name . 6161.It Ic %continue Ar pane-id 6162The pane has been continued after being paused (if the 6163.Ar pause-after 6164flag is set, see 6165.Ic refresh-client 6166.Fl A ) . 6167.It Ic %exit Op Ar reason 6168The 6169.Nm 6170client is exiting immediately, either because it is not attached to any session 6171or an error occurred. 6172If present, 6173.Ar reason 6174describes why the client exited. 6175.It Ic %extended-output Ar pane-id Ar age Ar ... \& : Ar value 6176New form of 6177.Ic %output 6178sent when the 6179.Ar pause-after 6180flag is set. 6181.Ar age 6182is the time in milliseconds for which tmux had buffered the output before it was sent. 6183Any subsequent arguments up until a single 6184.Ql \&: 6185are for future use and should be ignored. 6186.It Ic %layout-change Ar window-id Ar window-layout Ar window-visible-layout Ar window-flags 6187The layout of a window with ID 6188.Ar window-id 6189changed. 6190The new layout is 6191.Ar window-layout . 6192The window's visible layout is 6193.Ar window-visible-layout 6194and the window flags are 6195.Ar window-flags . 6196.It Ic %output Ar pane-id Ar value 6197A window pane produced output. 6198.Ar value 6199escapes non-printable characters and backslash as octal \\xxx. 6200.It Ic %pane-mode-changed Ar pane-id 6201The pane with ID 6202.Ar pane-id 6203has changed mode. 6204.It Ic %pause Ar pane-id 6205The pane has been paused (if the 6206.Ar pause-after 6207flag is set). 6208.It Ic %session-changed Ar session-id Ar name 6209The client is now attached to the session with ID 6210.Ar session-id , 6211which is named 6212.Ar name . 6213.It Ic %session-renamed Ar name 6214The current session was renamed to 6215.Ar name . 6216.It Ic %session-window-changed Ar session-id Ar window-id 6217The session with ID 6218.Ar session-id 6219changed its active window to the window with ID 6220.Ar window-id . 6221.It Ic %sessions-changed 6222A session was created or destroyed. 6223.It Xo Ic %subscription-changed 6224.Ar name 6225.Ar session-id 6226.Ar window-id 6227.Ar window-index 6228.Ar pane-id ... \& : 6229.Ar value 6230.Xc 6231The value of the format associated with subscription 6232.Ar name 6233has changed to 6234.Ar value . 6235See 6236.Ic refresh-client 6237.Fl B . 6238Any arguments after 6239.Ar pane-id 6240up until a single 6241.Ql \&: 6242are for future use and should be ignored. 6243.It Ic %unlinked-window-add Ar window-id 6244The window with ID 6245.Ar window-id 6246was created but is not linked to the current session. 6247.It Ic %window-add Ar window-id 6248The window with ID 6249.Ar window-id 6250was linked to the current session. 6251.It Ic %window-close Ar window-id 6252The window with ID 6253.Ar window-id 6254closed. 6255.It Ic %window-pane-changed Ar window-id Ar pane-id 6256The active pane in the window with ID 6257.Ar window-id 6258changed to the pane with ID 6259.Ar pane-id . 6260.It Ic %window-renamed Ar window-id Ar name 6261The window with ID 6262.Ar window-id 6263was renamed to 6264.Ar name . 6265.El 6266.Sh ENVIRONMENT 6267When 6268.Nm 6269is started, it inspects the following environment variables: 6270.Bl -tag -width LC_CTYPE 6271.It Ev EDITOR 6272If the command specified in this variable contains the string 6273.Ql vi 6274and 6275.Ev VISUAL 6276is unset, use vi-style key bindings. 6277Overridden by the 6278.Ic mode-keys 6279and 6280.Ic status-keys 6281options. 6282.It Ev HOME 6283The user's login directory. 6284If unset, the 6285.Xr passwd 5 6286database is consulted. 6287.It Ev LC_CTYPE 6288The character encoding 6289.Xr locale 1 . 6290It is used for two separate purposes. 6291For output to the terminal, UTF-8 is used if the 6292.Fl u 6293option is given or if 6294.Ev LC_CTYPE 6295contains 6296.Qq UTF-8 6297or 6298.Qq UTF8 . 6299Otherwise, only ASCII characters are written and non-ASCII characters 6300are replaced with underscores 6301.Pq Ql _ . 6302For input, 6303.Nm 6304always runs with a UTF-8 locale. 6305If en_US.UTF-8 is provided by the operating system it is used and 6306.Ev LC_CTYPE 6307is ignored for input. 6308Otherwise, 6309.Ev LC_CTYPE 6310tells 6311.Nm 6312what the UTF-8 locale is called on the current system. 6313If the locale specified by 6314.Ev LC_CTYPE 6315is not available or is not a UTF-8 locale, 6316.Nm 6317exits with an error message. 6318.It Ev LC_TIME 6319The date and time format 6320.Xr locale 1 . 6321It is used for locale-dependent 6322.Xr strftime 3 6323format specifiers. 6324.It Ev PWD 6325The current working directory to be set in the global environment. 6326This may be useful if it contains symbolic links. 6327If the value of the variable does not match the current working 6328directory, the variable is ignored and the result of 6329.Xr getcwd 3 6330is used instead. 6331.It Ev SHELL 6332The absolute path to the default shell for new windows. 6333See the 6334.Ic default-shell 6335option for details. 6336.It Ev TMUX_TMPDIR 6337The parent directory of the directory containing the server sockets. 6338See the 6339.Fl L 6340option for details. 6341.It Ev VISUAL 6342If the command specified in this variable contains the string 6343.Ql vi , 6344use vi-style key bindings. 6345Overridden by the 6346.Ic mode-keys 6347and 6348.Ic status-keys 6349options. 6350.El 6351.Sh FILES 6352.Bl -tag -width "/etc/tmux.confXXX" -compact 6353.It Pa ~/.tmux.conf 6354Default 6355.Nm 6356configuration file. 6357.It Pa /etc/tmux.conf 6358System-wide configuration file. 6359.El 6360.Sh EXAMPLES 6361To create a new 6362.Nm 6363session running 6364.Xr vi 1 : 6365.Pp 6366.Dl $ tmux new-session vi 6367.Pp 6368Most commands have a shorter form, known as an alias. 6369For new-session, this is 6370.Ic new : 6371.Pp 6372.Dl $ tmux new vi 6373.Pp 6374Alternatively, the shortest unambiguous form of a command is accepted. 6375If there are several options, they are listed: 6376.Bd -literal -offset indent 6377$ tmux n 6378ambiguous command: n, could be: new-session, new-window, next-window 6379.Ed 6380.Pp 6381Within an active session, a new window may be created by typing 6382.Ql C-b c 6383(Ctrl 6384followed by the 6385.Ql b 6386key 6387followed by the 6388.Ql c 6389key). 6390.Pp 6391Windows may be navigated with: 6392.Ql C-b 0 6393(to select window 0), 6394.Ql C-b 1 6395(to select window 1), and so on; 6396.Ql C-b n 6397to select the next window; and 6398.Ql C-b p 6399to select the previous window. 6400.Pp 6401A session may be detached using 6402.Ql C-b d 6403(or by an external event such as 6404.Xr ssh 1 6405disconnection) and reattached with: 6406.Pp 6407.Dl $ tmux attach-session 6408.Pp 6409Typing 6410.Ql C-b \&? 6411lists the current key bindings in the current window; up and down may be used 6412to navigate the list or 6413.Ql q 6414to exit from it. 6415.Pp 6416Commands to be run when the 6417.Nm 6418server is started may be placed in the 6419.Pa ~/.tmux.conf 6420configuration file. 6421Common examples include: 6422.Pp 6423Changing the default prefix key: 6424.Bd -literal -offset indent 6425set-option -g prefix C-a 6426unbind-key C-b 6427bind-key C-a send-prefix 6428.Ed 6429.Pp 6430Turning the status line off, or changing its colour: 6431.Bd -literal -offset indent 6432set-option -g status off 6433set-option -g status-style bg=blue 6434.Ed 6435.Pp 6436Setting other options, such as the default command, 6437or locking after 30 minutes of inactivity: 6438.Bd -literal -offset indent 6439set-option -g default-command "exec /bin/ksh" 6440set-option -g lock-after-time 1800 6441.Ed 6442.Pp 6443Creating new key bindings: 6444.Bd -literal -offset indent 6445bind-key b set-option status 6446bind-key / command-prompt "split-window 'exec man %%'" 6447bind-key S command-prompt "new-window -n %1 'ssh %1'" 6448.Ed 6449.Sh SEE ALSO 6450.Xr pty 4 6451.Sh AUTHORS 6452.An Nicholas Marriott Aq Mt nicholas.marriott@gmail.com 6453