1This is screen.info, produced by makeinfo version 4.5 from 2./screen.texinfo. 3 4INFO-DIR-SECTION General Commands 5START-INFO-DIR-ENTRY 6* Screen: (screen). Full-screen window manager. 7END-INFO-DIR-ENTRY 8 9 This file documents the `Screen' virtual terminal manager. 10 11 Copyright (c) 1993-2003 Free Software Foundation, Inc. 12 13 Permission is granted to make and distribute verbatim copies of this 14manual provided the copyright notice and this permission notice are 15preserved on all copies. 16 17 Permission is granted to copy and distribute modified versions of 18this manual under the conditions for verbatim copying, provided that 19the entire resulting derived work is distributed under the terms of a 20permission notice identical to this one. 21 22 Permission is granted to copy and distribute translations of this 23manual into another language, under the above conditions for modified 24versions, except that this permission notice may be stated in a 25translation approved by the Foundation. 26 27 28File: screen.info, Node: Input Translation, Next: Digraph, Prev: Control Sequences, Up: Virtual Terminal 29 30Input Translation 31================= 32 33 In order to do a full VT100 emulation `screen' has to detect that a 34sequence of characters in the input stream was generated by a keypress 35on the user's keyboard and insert the VT100 style escape sequence. 36`Screen' has a very flexible way of doing this by making it possible to 37map arbitrary commands on arbitrary sequences of characters. For 38standard VT100 emulation the command will always insert a string in the 39input buffer of the window (see also command `stuff', *note Paste::). 40Because the sequences generated by a keypress can change after a 41reattach from a different terminal type, it is possible to bind 42commands to the termcap name of the keys. `Screen' will insert the 43correct binding after each reattach. See *Note Bindkey:: for further 44details on the syntax and examples. 45 46 Here is the table of the default key bindings. (A) means that the 47command is executed if the keyboard is switched into application mode. 48 49 Key name Termcap name Command 50 ----------------------------------------------------- 51 Cursor up ku stuff \033[A 52 stuff \033OA (A) 53 Cursor down kd stuff \033[B 54 stuff \033OB (A) 55 Cursor right kr stuff \033[C 56 stuff \033OC (A) 57 Cursor left kl stuff \033[D 58 stuff \033OD (A) 59 Function key 0 k0 stuff \033[10~ 60 Function key 1 k1 stuff \033OP 61 Function key 2 k2 stuff \033OQ 62 Function key 3 k3 stuff \033OR 63 Function key 4 k4 stuff \033OS 64 Function key 5 k5 stuff \033[15~ 65 Function key 6 k6 stuff \033[17~ 66 Function key 7 k7 stuff \033[18~ 67 Function key 8 k8 stuff \033[19~ 68 Function key 9 k9 stuff \033[20~ 69 Function key 10 k; stuff \033[21~ 70 Function key 11 F1 stuff \033[23~ 71 Function key 12 F2 stuff \033[24~ 72 Home kh stuff \033[1~ 73 End kH stuff \033[4~ 74 Insert kI stuff \033[2~ 75 Delete kD stuff \033[3~ 76 Page up kP stuff \033[5~ 77 Page down kN stuff \033[6~ 78 Keypad 0 f0 stuff 0 79 stuff \033Op (A) 80 Keypad 1 f1 stuff 1 81 stuff \033Oq (A) 82 Keypad 2 f2 stuff 2 83 stuff \033Or (A) 84 Keypad 3 f3 stuff 3 85 stuff \033Os (A) 86 Keypad 4 f4 stuff 4 87 stuff \033Ot (A) 88 Keypad 5 f5 stuff 5 89 stuff \033Ou (A) 90 Keypad 6 f6 stuff 6 91 stuff \033Ov (A) 92 Keypad 7 f7 stuff 7 93 stuff \033Ow (A) 94 Keypad 8 f8 stuff 8 95 stuff \033Ox (A) 96 Keypad 9 f9 stuff 9 97 stuff \033Oy (A) 98 Keypad + f+ stuff + 99 stuff \033Ok (A) 100 Keypad - f- stuff - 101 stuff \033Om (A) 102 Keypad * f* stuff * 103 stuff \033Oj (A) 104 Keypad / f/ stuff / 105 stuff \033Oo (A) 106 Keypad = fq stuff = 107 stuff \033OX (A) 108 Keypad . f. stuff . 109 stuff \033On (A) 110 Keypad , f, stuff , 111 stuff \033Ol (A) 112 Keypad enter fe stuff \015 113 stuff \033OM (A) 114 115 116File: screen.info, Node: Digraph, Next: Bell, Prev: Input Translation, Up: Virtual Terminal 117 118Digraph 119======= 120 121 - Command: digraph [preset] 122 (none) 123 This command prompts the user for a digraph sequence. The next two 124 characters typed are looked up in a builtin table and the 125 resulting character is inserted in the input stream. For example, 126 if the user enters `a"', an a-umlaut will be inserted. If the 127 first character entered is a 0 (zero), `screen' will treat the 128 following characters (up to three) as an octal number instead. 129 The optional argument PRESET is treated as user input, thus one 130 can create an "umlaut" key. For example the command `bindkey ^K 131 digraph '"'' enables the user to generate an a-umlaut by typing 132 `CTRL-K a'. 133 134 135File: screen.info, Node: Bell, Next: Clear, Prev: Digraph, Up: Virtual Terminal 136 137Bell 138==== 139 140 - Command: bell_msg [message] 141 (none) 142 When a bell character is sent to a background window, `screen' 143 displays a notification in the message line. The notification 144 message can be re-defined by this command. Each occurrence of `%' 145 in MESSAGE is replaced by the number of the window to which a bell 146 has been sent, and each occurrence of `^G' is replaced by the 147 definition for bell in your termcap (usually an audible bell). 148 The default message is 149 150 'Bell in window %n' 151 152 An empty message can be supplied to the `bell_msg' command to 153 suppress output of a message line (`bell_msg ""'). Without 154 parameter, the current message is shown. 155 156 - Command: vbell [state] 157 (`C-a C-g') 158 Sets or toggles the visual bell setting for the current window. If 159 `vbell' is switched to `on', but your terminal does not support a 160 visual bell, the visual bell message is displayed in the status 161 line when the bell character is received. Visual bell support of 162 a terminal is defined by the termcap variable `vb'. *Note Visual 163 Bell: (termcap)Bell, for more information on visual bells. The 164 equivalent terminfo capability is `flash'. 165 166 Per default, `vbell' is `off', thus the audible bell is used. 167 168 - Command: vbell_msg [message] 169 (none) 170 Sets the visual bell message. MESSAGE is printed to the status 171 line if the window receives a bell character (^G), `vbell' is set 172 to `on' and the terminal does not support a visual bell. The 173 default message is `Wuff, Wuff!!'. Without parameter, the current 174 message is shown. 175 176 - Command: vbellwait sec 177 (none) 178 Define a delay in seconds after each display of `screen' 's visual 179 bell message. The default is 1 second. 180 181 182File: screen.info, Node: Clear, Next: Info, Prev: Bell, Up: Virtual Terminal 183 184Clear 185===== 186 187 - Command: clear 188 (`C-a C') 189 Clears the screen and saves its contents to the scrollback buffer. 190 191 192File: screen.info, Node: Info, Next: Redisplay, Prev: Clear, Up: Virtual Terminal 193 194Info 195==== 196 197 - Command: info 198 (`C-a i', `C-a C-i') 199 Uses the message line to display some information about the current 200 window: the cursor position in the form `(COLUMN,ROW)' starting 201 with `(1,1)', the terminal width and height plus the size of the 202 scrollback buffer in lines, like in `(80,24)+50', the current 203 state of window XON/XOFF flow control is shown like this (*note 204 Flow Control::): 205 +flow automatic flow control, currently on. 206 -flow automatic flow control, currently off. 207 +(+)flow flow control enabled. Agrees with automatic control. 208 -(+)flow flow control disabled. Disagrees with automatic control. 209 +(-)flow flow control enabled. Disagrees with automatic control. 210 -(-)flow flow control disabled. Agrees with automatic control. 211 212 The current line wrap setting (`+wrap' indicates enabled, `-wrap' 213 not) is also shown. The flags `ins', `org', `app', `log', `mon' 214 and `nored' are displayed when the window is in insert mode, 215 origin mode, application-keypad mode, has output logging, activity 216 monitoring or partial redraw enabled. 217 218 The currently active character set (`G0', `G1', `G2', or `G3'), 219 and in square brackets the terminal character sets that are 220 currently designated as `G0' through `G3'. If the window is in 221 UTF-8 mode, the string `UTF-8' is shown instead. Additional modes 222 depending on the type of the window are displayed at the end of 223 the status line (*note Window Types::). 224 225 If the state machine of the terminal emulator is in a non-default 226 state, the info line is started with a string identifying the 227 current state. 228 229 For system information use `time'. 230 231 - Command: dinfo 232 (none) 233 Show what screen thinks about your terminal. Useful if you want to 234 know why features like color or the alternate charset don't work. 235 236 237File: screen.info, Node: Redisplay, Next: Wrap, Prev: Info, Up: Virtual Terminal 238 239Redisplay 240========= 241 242 - Command: allpartial state 243 (none) 244 If set to on, only the current cursor line is refreshed on window 245 change. This affects all windows and is useful for slow terminal 246 lines. The previous setting of full/partial refresh for each 247 window is restored with `allpartial off'. This is a global flag 248 that immediately takes effect on all windows overriding the 249 `partial' settings. It does not change the default redraw behavior 250 of newly created windows. 251 252 - Command: altscreen state 253 (none) 254 If set to on, "alternate screen" support is enabled in virtual 255 terminals, just like in xterm. Initial setting is `off'. 256 257 - Command: partial state 258 (none) 259 Defines whether the display should be refreshed (as with 260 `redisplay') after switching to the current window. This command 261 only affects the current window. To immediately affect all 262 windows use the `allpartial' command. Default is `off', of 263 course. This default is fixed, as there is currently no 264 `defpartial' command. 265 266 - Command: redisplay 267 (`C-a l', `C-a C-l') 268 Redisplay the current window. Needed to get a full redisplay in 269 partial redraw mode. 270 271 272File: screen.info, Node: Wrap, Next: Reset, Prev: Redisplay, Up: Virtual Terminal 273 274Wrap 275==== 276 277 - Command: wrap state 278 (`C-a r', `C-a C-r') 279 Sets the line-wrap setting for the current window. When line-wrap 280 is on, the second consecutive printable character output at the 281 last column of a line will wrap to the start of the following 282 line. As an added feature, backspace (^H) will also wrap through 283 the left margin to the previous line. Default is `on'. 284 285 - Command: defwrap state 286 (none) 287 Same as the `wrap' command except that the default setting for new 288 windows is changed. Initially line-wrap is on and can be toggled 289 with the `wrap' command (`C-a r') or by means of "C-a : wrap 290 on|off". 291 292 293File: screen.info, Node: Reset, Next: Window Size, Prev: Wrap, Up: Virtual Terminal 294 295Reset 296===== 297 298 - Command: reset 299 (`C-a Z') 300 Reset the virtual terminal to its "power-on" values. Useful when 301 strange settings (like scroll regions or graphics character set) 302 are left over from an application. 303 304 305File: screen.info, Node: Window Size, Next: Character Processing, Prev: Reset, Up: Virtual Terminal 306 307Window Size 308=========== 309 310 - Command: width [`-w'|`-d'] [cols [lines]] 311 (`C-a W') 312 Toggle the window width between 80 and 132 columns, or set it to 313 COLS columns if an argument is specified. This requires a capable 314 terminal and the termcap entries `Z0' and `Z1'. See the `termcap' 315 command (*note Termcap::), for more information. You can also 316 specify a height if you want to change both values. The `-w' 317 option tells screen to leave the display size unchanged and just 318 set the window size, `-d' vice versa. 319 320 - Command: height [`-w'|`-d'] [lines [cols]] 321 (none) 322 Set the display height to a specified number of lines. When no 323 argument is given it toggles between 24 and 42 lines display. 324 325 326File: screen.info, Node: Character Processing, Prev: Window Size, Up: Virtual Terminal 327 328Character Processing 329==================== 330 331 - Command: c1 [state] 332 (none) 333 Change c1 code processing. `c1 on' tells screen to treat the input 334 characters between 128 and 159 as control functions. Such an 335 8-bit code is normally the same as ESC followed by the 336 corresponding 7-bit code. The default setting is to process c1 337 codes and can be changed with the `defc1' command. Users with 338 fonts that have usable characters in the c1 positions may want to 339 turn this off. 340 341 342 - Command: gr [state] 343 (none) 344 Turn GR charset switching on/off. Whenever screen sees an input 345 char with an 8th bit set, it will use the charset stored in the GR 346 slot and print the character with the 8th bit stripped. The 347 default (see also `defgr') is not to process GR switching because 348 otherwise the ISO88591 charset would not work. 349 350 - Command: bce [state] 351 (none) 352 Change background-color-erase setting. If `bce' is set to on, all 353 characters cleared by an erase/insert/scroll/clear operation will 354 be displayed in the current background color. Otherwise the 355 default background color is used. 356 357 - Command: encoding enc [denc] 358 (none) 359 Tell screen how to interpret the input/output. The first argument 360 sets the encoding of the current window. Each window can emulate 361 a different encoding. The optional second parameter overwrites the 362 encoding of the connected terminal. It should never be needed as 363 screen uses the locale setting to detect the encoding. There is 364 also a way to select a terminal encoding depending on the terminal 365 type by using the `KJ' termcap entry. *Note Special Capabilities::. 366 367 Supported encodings are `eucJP', `SJIS', `eucKR', `eucCN', `Big5', 368 `GBK', `KOI8-R', `CP1251', `UTF-8', `ISO8859-2', `ISO8859-3', 369 `ISO8859-4', `ISO8859-5', `ISO8859-6', `ISO8859-7', `ISO8859-8', 370 `ISO8859-9', `ISO8859-10', `ISO8859-15', `jis'. 371 372 See also `defencoding', which changes the default setting of a new 373 window. 374 375 - Command: charset set 376 (none) 377 Change the current character set slot designation and charset 378 mapping. The first four character of SET are treated as charset 379 designators while the fifth and sixth character must be in range 380 `0' to `3' and set the GL/GR charset mapping. On every position a 381 `.' may be used to indicate that the corresponding charset/mapping 382 should not be changed (SET is padded to six characters internally 383 by appending `.' chars). New windows have `BBBB02' as default 384 charset, unless a `encoding' command is active. 385 386 The current setting can be viewed with the *Note Info:: command. 387 388 - Command: utf8 [state [dstate]] 389 (none) 390 Change the encoding used in the current window. If utf8 is 391 enabled, the strings sent to the window will be UTF-8 encoded and 392 vice versa. Omitting the parameter toggles the setting. If a 393 second parameter is given, the display's encoding is also changed 394 (this should rather be done with screen's `-U' option). See also 395 `defutf8', which changes the default setting of a new window. 396 397 - Command: defc1 state 398 (none) 399 Same as the `c1' command except that the default setting for new 400 windows is changed. Initial setting is `on'. 401 402 - Command: defgr state 403 (none) 404 Same as the `gr' command except that the default setting for new 405 windows is changed. Initial setting is `off'. 406 407 - Command: defbce state 408 (none) 409 Same as the `bce' command except that the default setting for new 410 windows is changed. Initial setting is `off'. 411 412 - Command: defencoding enc 413 (none) 414 Same as the `encoding' command except that the default setting for 415 new windows is changed. Initial setting is the encoding taken from 416 the terminal. 417 418 - Command: defcharset [set] 419 Like the `charset' command except that the default setting for new 420 windows is changed. Shows current default if called without 421 argument. 422 423 - Command: defutf8 state 424 (none) 425 Same as the `utf8' command except that the default setting for new 426 windows is changed. Initial setting is `on' if screen was started 427 with `-U', otherwise `off'. 428 429 430File: screen.info, Node: Copy and Paste, Next: Subprocess Execution, Prev: Virtual Terminal, Up: Top 431 432Copy and Paste 433************** 434 435 For those confined to a hardware terminal, these commands provide a 436cut and paste facility more powerful than those provided by most 437windowing systems. 438 439* Menu: 440 441* Copy:: Copy from scrollback to buffer 442* Paste:: Paste from buffer into window 443* Registers:: Longer-term storage 444* Screen Exchange:: Sharing data between screen users 445* History:: Recalling previous input 446 447 448File: screen.info, Node: Copy, Next: Paste, Up: Copy and Paste 449 450Copying 451======= 452 453 - Command: copy 454 (`C-a [', `C-a C-[', `C-a <ESC>') 455 Enter copy/scrollback mode. This allows you to copy text from the 456 current window and its history into the paste buffer. In this mode 457 a `vi'-like full screen editor is active, with controls as 458 outlined below. 459 460* Menu: 461 462* Line Termination:: End copied lines with CR/LF 463* Scrollback:: Set the size of the scrollback buffer 464* Copy Mode Keys:: Remap keys in copy mode 465* Movement:: Move around in the scrollback buffer 466* Marking:: Select the text you want 467* Repeat count:: Repeat a command 468* Searching:: Find the text you want 469* Specials:: Other random keys 470 471 472File: screen.info, Node: Line Termination, Next: Scrollback, Up: Copy 473 474CR/LF 475----- 476 477 - Command: crlf [state] 478 (none) 479 This affects the copying of text regions with the `C-a [' command. 480 If it is set to `on', lines will be separated by the two character 481 sequence `CR'/`LF'. Otherwise only `LF' is used. `crlf' is off 482 by default. When no parameter is given, the state is toggled. 483 484 485File: screen.info, Node: Scrollback, Next: Copy Mode Keys, Prev: Line Termination, Up: Copy 486 487Scrollback 488---------- 489 490 - Command: defscrollback num 491 (none) 492 Same as the `scrollback' command except that the default setting 493 for new windows is changed. Defaults to 100. 494 495 - Command: scrollback num 496 (none) 497 Set the size of the scrollback buffer for the current window to 498 NUM lines. The default scrollback is 100 lines. Use `C-a i' to 499 view the current setting. 500 501 - Command: compacthist [state] 502 (none) 503 This tells screen whether to suppress trailing blank lines when 504 scrolling up text into the history buffer. Turn compacting `on' to 505 hold more useful lines in your scrollback buffer. 506 507 508File: screen.info, Node: Copy Mode Keys, Next: Movement, Prev: Scrollback, Up: Copy 509 510markkeys 511-------- 512 513 - Command: markkeys string 514 (none) 515 This is a method of changing the keymap used for copy/history 516 mode. The string is made up of OLDCHAR=NEWCHAR pairs which are 517 separated by `:'. Example: The command `markkeys h=^B:l=^F:$=^E' 518 would set some keys to be more familiar to `emacs' users. If your 519 terminal sends characters, that cause you to abort copy mode, then 520 this command may help by binding these characters to do nothing. 521 The no-op character is `a'nd is used like this: `markkeys @=L=H' 522 if you do not want to use the `H' or `L' commands any longer. As 523 shown in this example, multiple keys can be assigned to one 524 function in a single statement. 525 526 527File: screen.info, Node: Movement, Next: Marking, Prev: Copy Mode Keys, Up: Copy 528 529Movement Keys 530------------- 531 532`h', `j', `k', `l' move the cursor line by line or column by column. 533 534`0', `^' and `$' move to the leftmost column or to the first or last 535non-whitespace character on the line. 536 537`H', `M' and `L' move the cursor to the leftmost column of the top, 538center or bottom line of the window. 539 540`+' and `-' move the cursor to the leftmost column of the next or 541previous line. 542 543`G' moves to the specified absolute line (default: end of buffer). 544 545`|' moves to the specified absolute column. 546 547`w', `b', `e' move the cursor word by word. 548 549`B', `E' move the cursor WORD by WORD (as in vi). 550 551`C-u' and `C-d' scroll the display up/down by the specified amount of 552lines while preserving the cursor position. (Default: half screenfull). 553 554`C-b' and `C-f' move the cursor up/down a full screen. 555 556`g' moves to the beginning of the buffer. 557 558`%' jumps to the specified percentage of the buffer. 559 560 Note that Emacs-style movement keys can be specified by a .screenrc 561command. (`markkeys "h=^B:l=^F:$=^E"') There is no simple method for a 562full emacs-style keymap, however, as this involves multi-character 563codes. 564 565 566File: screen.info, Node: Marking, Next: Repeat count, Prev: Movement, Up: Copy 567 568Marking 569------- 570 571 The copy range is specified by setting two marks. The text between 572these marks will be highlighted. Press `space' to set the first or 573second mark respectively. 574 575`Y' and `y' can be used to mark one whole line or to mark from start of 576line. 577 578`W' marks exactly one word. 579 580 581File: screen.info, Node: Repeat count, Next: Searching, Prev: Marking, Up: Copy 582 583Repeat Count 584------------ 585 586 Any command in copy mode can be prefixed with a number (by pressing 587digits `0...9') which is taken as a repeat count. Example: `C-a C-[ H 58810 j 5 Y' will copy lines 11 to 15 into the paste buffer. 589 590 591File: screen.info, Node: Searching, Next: Specials, Prev: Repeat count, Up: Copy 592 593Searching 594--------- 595 596`/' `vi'-like search forward. 597 598`?' `vi'-like search backward. 599 600`C-a s' `emacs' style incremental search forward. 601 602`C-r' `emacs' style reverse i-search. 603 604 - Command: ignorecase [state] 605 (none) 606 Tell screen to ignore the case of characters in searches. Default 607 is `off'. 608 609 610File: screen.info, Node: Specials, Prev: Searching, Up: Copy 611 612Specials 613-------- 614 615 There are, however, some keys that act differently here from in 616`vi'. `Vi' does not allow to yank rectangular blocks of text, but 617`screen' does. Press 618 619`c' or `C' to set the left or right margin respectively. If no repeat 620count is given, both default to the current cursor position. 621Example: Try this on a rather full text screen: `C-a [ M 20 l SPACE c 62210 l 5 j C SPACE'. 623 624This moves one to the middle line of the screen, moves in 20 columns 625left, marks the beginning of the paste buffer, sets the left column, 626moves 5 columns down, sets the right column, and then marks the end of 627the paste buffer. Now try: 628`C-a [ M 20 l SPACE 10 l 5 j SPACE' 629 630and notice the difference in the amount of text copied. 631 632`J' joins lines. It toggles between 4 modes: lines separated by a 633newline character (012), lines glued seamless, lines separated by a 634single space or comma separated lines. Note that you can prepend the 635newline character with a carriage return character, by issuing a `set 636crlf on'. 637 638`v' is for all the `vi' users who use `:set numbers' - it toggles the 639left margin between column 9 and 1. 640 641`a' before the final space key turns on append mode. Thus the contents 642of the paste buffer will not be overwritten, but appended to. 643 644`A' turns on append mode and sets a (second) mark. 645 646`>' sets the (second) mark and writes the contents of the paste buffer 647to the screen-exchange file (`/tmp/screen-exchange' per default) once 648copy-mode is finished. *Note Screen Exchange::. 649This example demonstrates how to dump the whole scrollback buffer to 650that file: 651`C-a [ g SPACE G $ >'. 652 653`C-g' gives information about the current line and column. 654 655`x' exchanges the first mark and the current cursor position. You can 656use this to adjust an already placed mark. 657 658`@' does nothing. Absolutely nothing. Does not even exit copy mode. 659 660All keys not described here exit copy mode. 661 662 663File: screen.info, Node: Paste, Next: Registers, Prev: Copy, Up: Copy and Paste 664 665Paste 666===== 667 668 - Command: paste [registers [destination]] 669 (`C-a ]', `C-a C-]') 670 Write the (concatenated) contents of the specified registers to 671 the stdin stream of the current window. The register `.' is 672 treated as the paste buffer. If no parameter is specified the user 673 is prompted to enter a single register. The paste buffer can be 674 filled with the `copy', `history' and `readbuf' commands. Other 675 registers can be filled with the `register', `readreg' and `paste' 676 commands. If `paste' is called with a second argument, the 677 contents of the specified registers is pasted into the named 678 destination register rather than the window. If `.' is used as the 679 second argument, the display's paste buffer is the destination. 680 Note, that `paste' uses a wide variety of resources: Usually both, 681 a current window and a current display are required. But whenever 682 a second argument is specified no current window is needed. When 683 the source specification only contains registers (not the paste 684 buffer) then there need not be a current display (terminal 685 attached), as the registers are a global resource. The paste 686 buffer exists once for every user. 687 688 - Command: stuff string 689 (none) 690 Stuff the string STRING in the input buffer of the current window. 691 This is like the `paste' command, but with much less overhead. 692 You cannot paste large buffers with the `stuff' command. It is most 693 useful for key bindings. *Note Bindkey::. 694 695 - Command: pastefont [state] 696 Tell screen to include font information in the paste buffer. The 697 default is not to do so. This command is especially useful for 698 multi character fonts like kanji. 699 700 - Command: slowpaste msec 701 - Command: defslowpaste msec 702 (none) 703 Define the speed text is inserted in the current window by the 704 `paste' command. If the slowpaste value is nonzero text is written 705 character by character. `screen' will pause for MSEC milliseconds 706 after each write to allow the application to process the input. 707 only use `slowpaste' if your underlying system exposes flow 708 control problems while pasting large amounts of text. 709 `defslowpaste' specifies the default for new windows. 710 711 - Command: readreg [-e encoding] [register [filename]] 712 (none) 713 Does one of two things, dependent on number of arguments: with 714 zero or one arguments it it duplicates the paste buffer contents 715 into the register specified or entered at the prompt. With two 716 arguments it reads the contents of the named file into the 717 register, just as `readbuf' reads the screen-exchange file into 718 the paste buffer. You can tell screen the encoding of the file 719 via the `-e' option. The following example will paste the 720 system's password file into the screen window (using register p, 721 where a copy remains): 722 723 C-a : readreg p /etc/passwd 724 C-a : paste p 725 726 727File: screen.info, Node: Registers, Next: Screen Exchange, Prev: Paste, Up: Copy and Paste 728 729Registers 730========= 731 732 - Command: copy_reg [key] 733 (none) 734 Removed. Use `readreg' instead. 735 736 - Command: ins_reg [key] 737 (none) 738 Removed. Use `paste' instead. 739 740 - Command: process [key] 741 (none) 742 Stuff the contents of the specified register into the `screen' 743 input queue. If no argument is given you are prompted for a 744 register name. The text is parsed as if it had been typed in from 745 the user's keyboard. This command can be used to bind multiple 746 actions to a single key. 747 748 - Command: register [-e encoding] key string 749 (none) 750 Save the specified STRING to the register KEY. The encoding of 751 the string can be specified via the `-e' option. 752 753 754File: screen.info, Node: Screen Exchange, Next: History, Prev: Registers, Up: Copy and Paste 755 756Screen Exchange 757=============== 758 759 - Command: bufferfile [EXCHANGE-FILE] 760 (none) 761 Change the filename used for reading and writing with the paste 762 buffer. If the EXCHANGE-FILE parameter is omitted, `screen' 763 reverts to the default of `/tmp/screen-exchange'. The following 764 example will paste the system's password file into the screen 765 window (using the paste buffer, where a copy remains): 766 767 C-a : bufferfile /etc/passwd 768 C-a < C-a ] 769 C-a : bufferfile 770 771 - Command: readbuf [-e ENCODING] [FILENAME] 772 (`C-a <') 773 Reads the contents of the specified file into the paste buffer. 774 You can tell screen the encoding of the file via the `-e' option. 775 If no file is specified, the screen-exchange filename is used. 776 777 - Command: removebuf 778 (`C-a =') 779 Unlinks the screen-exchange file. 780 781 - Command: writebuf [-e ENCODING] [FILENAME] 782 (`C-a >') 783 Writes the contents of the paste buffer to the specified file, or 784 the public accessible screen-exchange file if no filename is given. 785 This is thought of as a primitive means of communication between 786 `screen' users on the same host. If an encoding is specified the 787 paste buffer is recoded on the fly to match the encoding. See also 788 `C-a <ESC>' (*note Copy::). 789 790 791File: screen.info, Node: History, Prev: Screen Exchange, Up: Copy and Paste 792 793History 794======= 795 796 - Command: history 797 (`C-a {') 798 Usually users work with a shell that allows easy access to previous 799 commands. For example, `csh' has the command `!!' to repeat the 800 last command executed. `screen' provides a primitive way of 801 recalling "the command that started ...": You just type the first 802 letter of that command, then hit `C-a {' and `screen' tries to 803 find a previous line that matches with the prompt character to the 804 left of the cursor. This line is pasted into this window's input 805 queue. Thus you have a crude command history (made up by the 806 visible window and its scrollback buffer). 807 808 809File: screen.info, Node: Subprocess Execution, Next: Key Binding, Prev: Copy and Paste, Up: Top 810 811Subprocess Execution 812******************** 813 814 Control Input or Output of a window by another filter process. Use 815with care! 816 817* Menu: 818 819* Exec:: The `exec' command syntax. 820* Using Exec:: Weird things that filters can do. 821 822 823File: screen.info, Node: Exec, Next: Using Exec, Up: Subprocess Execution 824 825Exec 826==== 827 828 - Command: exec [[FDPAT] NEWCOMMAND [ARGS ... ]] 829 (none) 830 Run a unix subprocess (specified by an executable path NEWCOMMAND 831 and its optional arguments) in the current window. The flow of 832 data between newcommands stdin/stdout/stderr, the process 833 originally started (let us call it "application-process") and 834 screen itself (window) is controlled by the filedescriptor pattern 835 FDPAT. This pattern is basically a three character sequence 836 representing stdin, stdout and stderr of newcommand. A dot (`.') 837 connects the file descriptor to screen. An exclamation mark (`!') 838 causes the file descriptor to be connected to the 839 application-process. A colon (`:') combines both. 840 User input will go to newcommand unless newcommand receives the 841 application-process' output (FDPATs first character is `!' or `:') 842 or a pipe symbol (`|') is added to the end of FDPAT. 843 Invoking `exec' without arguments shows name and arguments of the 844 currently running subprocess in this window. Only one subprocess 845 can be running per window. 846 When a subprocess is running the `kill' command will affect it 847 instead of the windows process. Only one subprocess a time can be 848 running in each window. 849 Refer to the postscript file `doc/fdpat.ps' for a confusing 850 illustration of all 21 possible combinations. Each drawing shows 851 the digits 2, 1, 0 representing the three file descriptors of 852 newcommand. The box marked `W' is usual pty that has the 853 application-process on its slave side. The box marked `P' is the 854 secondary pty that now has screen at its master side. 855 856 857File: screen.info, Node: Using Exec, Prev: Exec, Up: Subprocess Execution 858 859Using Exec 860========== 861 862Abbreviations: 863 864 * Whitespace between the word `exec' and FDPAT and the command name 865 can be omitted. 866 867 * Trailing dots and a FDPAT consisting only of dots can be omitted. 868 869 * A simple `|' is synonymous for the `!..|' pattern. 870 871 * The word `exec' can be omitted when the `|' abbreviation is used. 872 873 * The word `exec' can always be replaced by leading `!'. 874 875Examples: 876 877`!/bin/sh' 878`exec /bin/sh' 879`exec ... /bin/sh' 880 All of the above are equivalent. Creates another shell in the 881 same window, while the original shell is still running. Output of 882 both shells is displayed and user input is sent to the new 883 `/bin/sh'. 884 885`!!stty 19200' 886`exec!stty 19200' 887`exec !.. stty 19200' 888 All of the above are equivalent. Set the speed of the window's 889 tty. If your stty command operates on stdout, then add another 890 `!'. This is a useful command, when a screen window is directly 891 connected to a serial line that needs to be configured. 892 893`|less' 894`exec !..| less' 895 Both are equivalent. This adds a pager to the window output. The 896 special character `|' is needed to give the user control over the 897 pager although it gets its input from the window's process. This 898 works, because `less' listens on stderr (a behavior that `screen' 899 would not expect without the `|') when its stdin is not a tty. 900 `Less' versions newer than 177 fail miserably here; good old `pg' 901 still works. 902 903`!:sed -n s/.*Error.*/\007/p' 904 Sends window output to both, the user and the sed command. The sed 905 inserts an additional bell character (oct. 007) to the window 906 output seen by screen. This will cause 'Bell in window x' 907 messages, whenever the string `Error' appears in the window. 908 909 910File: screen.info, Node: Key Binding, Next: Flow Control, Prev: Subprocess Execution, Up: Top 911 912Key Binding 913*********** 914 915 You may disagree with some of the default bindings (I know I do). 916The `bind' command allows you to redefine them to suit your preferences. 917 918* Menu: 919 920* Bind:: `bind' syntax. 921* Bind Examples:: Using `bind'. 922* Command Character:: The character used to start keyboard commands. 923* Help:: Show current key bindings. 924* Bindkey:: `bindkey' syntax. 925* Bindkey Examples:: Some easy examples. 926* Bindkey Control:: How to control the bindkey mechanism. 927 928 929File: screen.info, Node: Bind, Next: Bind Examples, Up: Key Binding 930 931The `bind' command 932================== 933 934 - Command: bind [-c class] key [command [args]] 935 (none) 936 Bind a command to a key. The KEY argument is either a single 937 character, a two-character sequence of the form `^x' (meaning 938 `C-x'), a backslash followed by an octal number (specifying the 939 ASCII code of the character), or a backslash followed by a second 940 character, such as `\^' or `\\'. The argument can also be quoted, 941 if you like. If no further argument is given, any previously 942 established binding for this key is removed. The COMMAND argument 943 can be any command (*note Command Index::). 944 945 If a command class is specified via the `-c' option, the key is 946 bound for the specified class. Use the `command' command to 947 activate a class. Command classes can be used to create multiple 948 command keys or multi-character bindings. 949 950 By default, most suitable commands are bound to one or more keys 951 (*note Default Key Bindings::; for instance, the command to create 952 a new window is bound to `C-c' and `c'. The `bind' command can be 953 used to redefine the key bindings and to define new bindings. 954 955 956File: screen.info, Node: Bind Examples, Next: Command Character, Prev: Bind, Up: Key Binding 957 958Examples of the `bind' command 959============================== 960 961Some examples: 962 963 bind ' ' windows 964 bind ^f screen telnet foobar 965 bind \033 screen -ln -t root -h 1000 9 su 966 967would bind the space key to the command that displays a list of windows 968(so that the command usually invoked by `C-a C-w' would also be 969available as `C-a space'), bind `C-f' to the command "create a window 970with a TELNET connection to foobar", and bind <ESC> to the command that 971creates an non-login window with title `root' in slot #9, with a 972superuser shell and a scrollback buffer of 1000 lines. 973 974 bind -c demo1 0 select 10 975 bind -c demo1 1 select 11 976 bind -c demo1 2 select 12 977 bindkey "^B" command -c demo1 978 makes `C-b 0' select window 10, `C-b 1' window 11, etc. 979 980 bind -c demo2 0 select 10 981 bind -c demo2 1 select 11 982 bind -c demo2 2 select 12 983 bind - command -c demo2 984 makes `C-a - 0' select window 10, `C-a - 1' window 11, etc. 985 986 987File: screen.info, Node: Command Character, Next: Help, Prev: Bind Examples, Up: Key Binding 988 989Command Character 990================= 991 992 - Command: escape xy 993 (none) 994 Set the command character to X and the character generating a 995 literal command character (by triggering the `meta' command) to Y 996 (similar to the `-e' option). Each argument is either a single 997 character, a two-character sequence of the form `^x' (meaning 998 `C-x'), a backslash followed by an octal number (specifying the 999 ASCII code of the character), or a backslash followed by a second 1000 character, such as `\^' or `\\'. The default is `^Aa', but ```' 1001 is recommended by one of the authors. 1002 1003 - Command: defescape xy 1004 (none) 1005 Set the default command characters. This is equivalent to the 1006 command `escape' except that it is useful for multiuser sessions 1007 only. In a multiuser session `escape' changes the command 1008 character of the calling user, where `defescape' changes the 1009 default command characters for users that will be added later. 1010 1011 - Command: meta 1012 (`C-a a') 1013 Send the command character (`C-a') to the process in the current 1014 window. The keystroke for this command is the second parameter to 1015 the `-e' command line switch (*note Invoking Screen::), or the 1016 `escape' .screenrc directive. 1017 1018 - Command: command [-c CLASS] 1019 (none) 1020 This command has the same effect as typing the screen escape 1021 character (`C-a'). It is probably only useful for key bindings. 1022 If the `-c' option is given, select the specified command class. 1023 *Note Bind::, *Note Bindkey::. 1024 1025 1026File: screen.info, Node: Help, Next: Bindkey, Prev: Command Character, Up: Key Binding 1027 1028Help 1029==== 1030 1031 - Command: help 1032 (`C-a ?') 1033 Displays a help screen showing you all the key bindings. The first 1034 pages list all the internal commands followed by their bindings. 1035 Subsequent pages will display the custom commands, one command per 1036 key. Press space when you're done reading each page, or return to 1037 exit early. All other characters are ignored. If the `-c' option 1038 is given, display all bound commands for the specified command 1039 class. *Note Default Key Bindings::. 1040 1041 1042File: screen.info, Node: Bindkey, Next: Bindkey Examples, Prev: Help, Up: Key Binding 1043 1044Bindkey 1045======= 1046 1047 - Command: bindkey [OPTS] [STRING [CMD ARGS]] 1048 (none) 1049 This command manages screen's input translation tables. Every 1050 entry in one of the tables tells screen how to react if a certain 1051 sequence of characters is encountered. There are three tables: one 1052 that should contain actions programmed by the user, one for the 1053 default actions used for terminal emulation and one for screen's 1054 copy mode to do cursor movement. See *Note Input Translation:: for 1055 a list of default key bindings. 1056 1057 If the `-d' option is given, bindkey modifies the default table, 1058 `-m' changes the copy mode table and with neither option the user 1059 table is selected. The argument `string' is the sequence of 1060 characters to which an action is bound. This can either be a fixed 1061 tring or a termcap keyboard capability name (selectable with the 1062 `-k' option). 1063 1064 Some keys on a VT100 terminal can send a different string if 1065 application mode is turned on (e.g. the cursor keys). Such keys 1066 have two entries in the translation table. You can select the 1067 application mode entry by specifying the `-a' option. 1068 1069 The `-t' option tells screen not to do inter-character timing. One 1070 cannot turn off the timing if a termcap capability is used. 1071 1072 `cmd' can be any of screen's commands with an arbitrary number of 1073 `args'. If `cmd' is omitted the key-binding is removed from the 1074 table. 1075 1076 1077File: screen.info, Node: Bindkey Examples, Next: Bindkey Control, Prev: Bindkey, Up: Key Binding 1078 1079Bindkey Examples 1080================ 1081 1082Here are some examples of keyboard bindings: 1083 1084 bindkey -d 1085 1086Show all of the default key bindings. The application mode entries are 1087marked with [A]. 1088 1089 bindkey -k k1 select 1 1090 1091Make the "F1" key switch to window one. 1092 1093 bindkey -t foo stuff barfoo 1094 1095Make `foo' an abbreviation of the word `barfoo'. Timeout is disabled so 1096that users can type slowly. 1097 1098 bindkey "\024" mapdefault 1099 1100This key-binding makes `C-t' an escape character for key-bindings. If 1101you did the above `stuff barfoo' binding, you can enter the word `foo' 1102by typing `C-t foo'. If you want to insert a `C-t' you have to press 1103the key twice (i.e. escape the escape binding). 1104 1105 bindkey -k F1 command 1106 1107Make the F11 (not F1!) key an alternative screen escape (besides `C-a'). 1108 1109 1110File: screen.info, Node: Bindkey Control, Prev: Bindkey Examples, Up: Key Binding 1111 1112Bindkey Control 1113=============== 1114 1115 - Command: mapdefault 1116 (none) 1117 Tell screen that the next input character should only be looked up 1118 in the default bindkey table. 1119 1120 - Command: mapnotnext 1121 (none) 1122 Like mapdefault, but don't even look in the default bindkey table. 1123 1124 - Command: maptimeout timo 1125 (none) 1126 Set the intercharacter timer for input sequence detection to a 1127 timeout of TIMO ms. The default timeout is 300ms. Maptimeout with 1128 no arguments shows the current setting. 1129 1130 1131File: screen.info, Node: Flow Control, Next: Termcap, Prev: Key Binding, Up: Top 1132 1133Flow Control 1134************ 1135 1136 `screen' can trap flow control characters or pass them to the 1137program, as you see fit. This is useful when your terminal wants to use 1138XON/XOFF flow control and you are running a program which wants to use 1139^S/^Q for other purposes (i.e. `emacs'). 1140 1141* Menu: 1142 1143* Flow Control Summary:: The effect of `screen' flow control 1144* Flow:: Setting the flow control behavior 1145* XON/XOFF:: Sending XON or XOFF to the window 1146 1147 1148File: screen.info, Node: Flow Control Summary, Next: Flow, Up: Flow Control 1149 1150About `screen' flow control settings 1151==================================== 1152 1153 Each window has a flow-control setting that determines how screen 1154deals with the XON and XOFF characters (and perhaps the interrupt 1155character). When flow-control is turned off, screen ignores the XON 1156and XOFF characters, which allows the user to send them to the current 1157program by simply typing them (useful for the `emacs' editor, for 1158instance). The trade-off is that it will take longer for output from a 1159"normal" program to pause in response to an XOFF. With flow-control 1160turned on, XON and XOFF characters are used to immediately pause the 1161output of the current window. You can still send these characters to 1162the current program, but you must use the appropriate two-character 1163screen commands (typically `C-a q' (xon) and `C-a s' (xoff)). The 1164xon/xoff commands are also useful for typing C-s and C-q past a 1165terminal that intercepts these characters. 1166 1167 Each window has an initial flow-control value set with either the 1168`-f' option or the `defflow' command. By default the windows are set 1169to automatic flow-switching. It can then be toggled between the three 1170states 'fixed on', 'fixed off' and 'automatic' interactively with the 1171`flow' command bound to `C-a f'. 1172 1173 The automatic flow-switching mode deals with flow control using the 1174TIOCPKT mode (like `rlogin' does). If the tty driver does not support 1175TIOCPKT, screen tries to determine the right mode based on the current 1176setting of the application keypad -- when it is enabled, flow-control 1177is turned off and visa versa. Of course, you can still manipulate 1178flow-control manually when needed. 1179 1180 If you're running with flow-control enabled and find that pressing 1181the interrupt key (usually C-c) does not interrupt the display until 1182another 6-8 lines have scrolled by, try running screen with the 1183`interrupt' option (add the `interrupt' flag to the `flow' command in 1184your .screenrc, or use the `-i' command-line option). This causes the 1185output that `screen' has accumulated from the interrupted program to be 1186flushed. One disadvantage is that the virtual terminal's memory 1187contains the non-flushed version of the output, which in rare cases can 1188cause minor inaccuracies in the output. For example, if you switch 1189screens and return, or update the screen with `C-a l' you would see the 1190version of the output you would have gotten without `interrupt' being 1191on. Also, you might need to turn off flow-control (or use auto-flow 1192mode to turn it off automatically) when running a program that expects 1193you to type the interrupt character as input, as the `interrupt' 1194parameter only takes effect when flow-control is enabled. If your 1195program's output is interrupted by mistake, a simple refresh of the 1196screen with `C-a l' will restore it. Give each mode a try, and use 1197whichever mode you find more comfortable. 1198 1199 1200File: screen.info, Node: Flow, Next: XON/XOFF, Prev: Flow Control Summary, Up: Flow Control 1201 1202Flow 1203==== 1204 1205 - Command: defflow fstate [interrupt] 1206 (none) 1207 Same as the `flow' command except that the default setting for new 1208 windows is changed. Initial setting is `auto'. Specifying `flow 1209 auto interrupt' has the same effect as the command-line options 1210 `-fa' and `-i'. Note that if `interrupt' is enabled, all existing 1211 displays are changed immediately to forward interrupt signals. 1212 1213 - Command: flow [fstate] 1214 (`C-a f', `C-a C-f') 1215 Sets the flow-control mode for this window to FSTATE, which can be 1216 `on', `off' or `auto'. Without parameters it cycles the current 1217 window's flow-control setting. Default is set by `defflow'. 1218 1219 1220File: screen.info, Node: XON/XOFF, Prev: Flow, Up: Flow Control 1221 1222XON and XOFF 1223============ 1224 1225 - Command: xon 1226 (`C-a q', `C-a C-q') 1227 Send a ^Q (ASCII XON) to the program in the current window. 1228 Redundant if flow control is set to `off' or `auto'. 1229 1230 - Command: xoff 1231 (`C-a s', `C-a C-s') 1232 Send a ^S (ASCII XOFF) to the program in the current window. 1233 1234 1235File: screen.info, Node: Termcap, Next: Message Line, Prev: Flow Control, Up: Top 1236 1237Termcap 1238******* 1239 1240 `screen' demands the most out of your terminal so that it can 1241perform its VT100 emulation most efficiently. These functions provide 1242means for tweaking the termcap entries for both your physical terminal 1243and the one simulated by `screen'. 1244 1245* Menu: 1246 1247* Window Termcap:: Choosing a termcap entry for the window. 1248* Dump Termcap:: Write out a termcap entry for the window. 1249* Termcap Syntax:: The `termcap' and `terminfo' commands. 1250* Termcap Examples:: Uses for `termcap'. 1251* Special Capabilities:: Non-standard capabilities used by `screen'. 1252* Autonuke:: Flush unseen output 1253* Obuflimit:: Allow pending output when reading more 1254* Character Translation:: Emulating fonts and charsets. 1255 1256