1 This is screen.info, produced by makeinfo version 4.5 from
4 INFO-DIR-SECTION General Commands
6 * Screen: (screen). Full-screen window manager.
9 This file documents the `Screen' virtual terminal manager.
11 Copyright (c) 1993-2003 Free Software Foundation, Inc.
13 Permission is granted to make and distribute verbatim copies of this
14 manual provided the copyright notice and this permission notice are
15 preserved on all copies.
17 Permission is granted to copy and distribute modified versions of
18 this manual under the conditions for verbatim copying, provided that
19 the entire resulting derived work is distributed under the terms of a
20 permission notice identical to this one.
22 Permission is granted to copy and distribute translations of this
23 manual into another language, under the above conditions for modified
24 versions, except that this permission notice may be stated in a
25 translation approved by the Foundation.
28 File: screen.info, Node: Input Translation, Next: Digraph, Prev: Control Sequences, Up: Virtual Terminal
33 In order to do a full VT100 emulation `screen' has to detect that a
34 sequence of characters in the input stream was generated by a keypress
35 on 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
37 map arbitrary commands on arbitrary sequences of characters. For
38 standard VT100 emulation the command will always insert a string in the
39 input buffer of the window (see also command `stuff', *note Paste::).
40 Because the sequences generated by a keypress can change after a
41 reattach from a different terminal type, it is possible to bind
42 commands to the termcap name of the keys. `Screen' will insert the
43 correct binding after each reattach. See *Note Bindkey:: for further
44 details on the syntax and examples.
46 Here is the table of the default key bindings. (A) means that the
47 command is executed if the keyboard is switched into application mode.
49 Key name Termcap name Command
50 -----------------------------------------------------
51 Cursor up ku stuff \033[A
53 Cursor down kd stuff \033[B
55 Cursor right kr stuff \033[C
57 Cursor left kl stuff \033[D
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~
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~
112 Keypad enter fe stuff \015
116 File: screen.info, Node: Digraph, Next: Bell, Prev: Input Translation, Up: Virtual Terminal
121 - Command: digraph [preset]
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
135 File: screen.info, Node: Bell, Next: Clear, Prev: Digraph, Up: Virtual Terminal
140 - Command: bell_msg [message]
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
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.
156 - Command: vbell [state]
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'.
166 Per default, `vbell' is `off', thus the audible bell is used.
168 - Command: vbell_msg [message]
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
176 - Command: vbellwait sec
178 Define a delay in seconds after each display of `screen' 's visual
179 bell message. The default is 1 second.
182 File: screen.info, Node: Clear, Next: Info, Prev: Bell, Up: Virtual Terminal
189 Clears the screen and saves its contents to the scrollback buffer.
192 File: screen.info, Node: Info, Next: Redisplay, Prev: Clear, Up: Virtual Terminal
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
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.
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.
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::).
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
229 For system information use `time'.
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.
237 File: screen.info, Node: Redisplay, Next: Wrap, Prev: Info, Up: Virtual Terminal
242 - Command: allpartial state
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.
252 - Command: altscreen state
254 If set to on, "alternate screen" support is enabled in virtual
255 terminals, just like in xterm. Initial setting is `off'.
257 - Command: partial state
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.
268 Redisplay the current window. Needed to get a full redisplay in
272 File: screen.info, Node: Wrap, Next: Reset, Prev: Redisplay, Up: Virtual Terminal
277 - Command: wrap state
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'.
285 - Command: defwrap state
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
293 File: screen.info, Node: Reset, Next: Window Size, Prev: Wrap, Up: Virtual Terminal
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.
305 File: screen.info, Node: Window Size, Next: Character Processing, Prev: Reset, Up: Virtual Terminal
310 - Command: width [`-w'|`-d'] [cols [lines]]
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.
320 - Command: height [`-w'|`-d'] [lines [cols]]
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.
326 File: screen.info, Node: Character Processing, Prev: Window Size, Up: Virtual Terminal
331 - Command: c1 [state]
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
342 - Command: gr [state]
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.
350 - Command: bce [state]
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.
357 - Command: encoding enc [denc]
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::.
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'.
372 See also `defencoding', which changes the default setting of a new
375 - Command: charset set
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.
386 The current setting can be viewed with the *Note Info:: command.
388 - Command: utf8 [state [dstate]]
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.
397 - Command: defc1 state
399 Same as the `c1' command except that the default setting for new
400 windows is changed. Initial setting is `on'.
402 - Command: defgr state
404 Same as the `gr' command except that the default setting for new
405 windows is changed. Initial setting is `off'.
407 - Command: defbce state
409 Same as the `bce' command except that the default setting for new
410 windows is changed. Initial setting is `off'.
412 - Command: defencoding enc
414 Same as the `encoding' command except that the default setting for
415 new windows is changed. Initial setting is the encoding taken from
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
423 - Command: defutf8 state
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'.
430 File: screen.info, Node: Copy and Paste, Next: Subprocess Execution, Prev: Virtual Terminal, Up: Top
435 For those confined to a hardware terminal, these commands provide a
436 cut and paste facility more powerful than those provided by most
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
448 File: screen.info, Node: Copy, Next: Paste, Up: Copy and Paste
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
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
472 File: screen.info, Node: Line Termination, Next: Scrollback, Up: Copy
477 - Command: crlf [state]
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.
485 File: screen.info, Node: Scrollback, Next: Copy Mode Keys, Prev: Line Termination, Up: Copy
490 - Command: defscrollback num
492 Same as the `scrollback' command except that the default setting
493 for new windows is changed. Defaults to 100.
495 - Command: scrollback num
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.
501 - Command: compacthist [state]
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.
508 File: screen.info, Node: Copy Mode Keys, Next: Movement, Prev: Scrollback, Up: Copy
513 - Command: markkeys string
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.
527 File: screen.info, Node: Movement, Next: Marking, Prev: Copy Mode Keys, Up: Copy
532 `h', `j', `k', `l' move the cursor line by line or column by column.
534 `0', `^' and `$' move to the leftmost column or to the first or last
535 non-whitespace character on the line.
537 `H', `M' and `L' move the cursor to the leftmost column of the top,
538 center or bottom line of the window.
540 `+' and `-' move the cursor to the leftmost column of the next or
543 `G' moves to the specified absolute line (default: end of buffer).
545 `|' moves to the specified absolute column.
547 `w', `b', `e' move the cursor word by word.
549 `B', `E' move the cursor WORD by WORD (as in vi).
551 `C-u' and `C-d' scroll the display up/down by the specified amount of
552 lines while preserving the cursor position. (Default: half screenfull).
554 `C-b' and `C-f' move the cursor up/down a full screen.
556 `g' moves to the beginning of the buffer.
558 `%' jumps to the specified percentage of the buffer.
560 Note that Emacs-style movement keys can be specified by a .screenrc
561 command. (`markkeys "h=^B:l=^F:$=^E"') There is no simple method for a
562 full emacs-style keymap, however, as this involves multi-character
566 File: screen.info, Node: Marking, Next: Repeat count, Prev: Movement, Up: Copy
571 The copy range is specified by setting two marks. The text between
572 these marks will be highlighted. Press `space' to set the first or
573 second mark respectively.
575 `Y' and `y' can be used to mark one whole line or to mark from start of
578 `W' marks exactly one word.
581 File: screen.info, Node: Repeat count, Next: Searching, Prev: Marking, Up: Copy
586 Any command in copy mode can be prefixed with a number (by pressing
587 digits `0...9') which is taken as a repeat count. Example: `C-a C-[ H
588 10 j 5 Y' will copy lines 11 to 15 into the paste buffer.
591 File: screen.info, Node: Searching, Next: Specials, Prev: Repeat count, Up: Copy
596 `/' `vi'-like search forward.
598 `?' `vi'-like search backward.
600 `C-a s' `emacs' style incremental search forward.
602 `C-r' `emacs' style reverse i-search.
604 - Command: ignorecase [state]
606 Tell screen to ignore the case of characters in searches. Default
610 File: screen.info, Node: Specials, Prev: Searching, Up: Copy
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
619 `c' or `C' to set the left or right margin respectively. If no repeat
620 count is given, both default to the current cursor position.
621 Example: Try this on a rather full text screen: `C-a [ M 20 l SPACE c
624 This moves one to the middle line of the screen, moves in 20 columns
625 left, marks the beginning of the paste buffer, sets the left column,
626 moves 5 columns down, sets the right column, and then marks the end of
627 the paste buffer. Now try:
628 `C-a [ M 20 l SPACE 10 l 5 j SPACE'
630 and notice the difference in the amount of text copied.
632 `J' joins lines. It toggles between 4 modes: lines separated by a
633 newline character (012), lines glued seamless, lines separated by a
634 single space or comma separated lines. Note that you can prepend the
635 newline character with a carriage return character, by issuing a `set
638 `v' is for all the `vi' users who use `:set numbers' - it toggles the
639 left margin between column 9 and 1.
641 `a' before the final space key turns on append mode. Thus the contents
642 of the paste buffer will not be overwritten, but appended to.
644 `A' turns on append mode and sets a (second) mark.
646 `>' sets the (second) mark and writes the contents of the paste buffer
647 to the screen-exchange file (`/tmp/screen-exchange' per default) once
648 copy-mode is finished. *Note Screen Exchange::.
649 This example demonstrates how to dump the whole scrollback buffer to
651 `C-a [ g SPACE G $ >'.
653 `C-g' gives information about the current line and column.
655 `x' exchanges the first mark and the current cursor position. You can
656 use this to adjust an already placed mark.
658 `@' does nothing. Absolutely nothing. Does not even exit copy mode.
660 All keys not described here exit copy mode.
663 File: screen.info, Node: Paste, Next: Registers, Prev: Copy, Up: Copy and Paste
668 - Command: paste [registers [destination]]
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.
688 - Command: stuff string
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::.
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.
700 - Command: slowpaste msec
701 - Command: defslowpaste msec
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.
711 - Command: readreg [-e encoding] [register [filename]]
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):
723 C-a : readreg p /etc/passwd
727 File: screen.info, Node: Registers, Next: Screen Exchange, Prev: Paste, Up: Copy and Paste
732 - Command: copy_reg [key]
734 Removed. Use `readreg' instead.
736 - Command: ins_reg [key]
738 Removed. Use `paste' instead.
740 - Command: process [key]
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.
748 - Command: register [-e encoding] key string
750 Save the specified STRING to the register KEY. The encoding of
751 the string can be specified via the `-e' option.
754 File: screen.info, Node: Screen Exchange, Next: History, Prev: Registers, Up: Copy and Paste
759 - Command: bufferfile [EXCHANGE-FILE]
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):
767 C-a : bufferfile /etc/passwd
771 - Command: readbuf [-e ENCODING] [FILENAME]
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.
779 Unlinks the screen-exchange file.
781 - Command: writebuf [-e ENCODING] [FILENAME]
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::).
791 File: screen.info, Node: History, Prev: Screen Exchange, Up: Copy and Paste
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).
809 File: screen.info, Node: Subprocess Execution, Next: Key Binding, Prev: Copy and Paste, Up: Top
814 Control Input or Output of a window by another filter process. Use
819 * Exec:: The `exec' command syntax.
820 * Using Exec:: Weird things that filters can do.
823 File: screen.info, Node: Exec, Next: Using Exec, Up: Subprocess Execution
828 - Command: exec [[FDPAT] NEWCOMMAND [ARGS ... ]]
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.
857 File: screen.info, Node: Using Exec, Prev: Exec, Up: Subprocess Execution
864 * Whitespace between the word `exec' and FDPAT and the command name
867 * Trailing dots and a FDPAT consisting only of dots can be omitted.
869 * A simple `|' is synonymous for the `!..|' pattern.
871 * The word `exec' can be omitted when the `|' abbreviation is used.
873 * The word `exec' can always be replaced by leading `!'.
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
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.
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'
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.
910 File: screen.info, Node: Key Binding, Next: Flow Control, Prev: Subprocess Execution, Up: Top
915 You may disagree with some of the default bindings (I know I do).
916 The `bind' command allows you to redefine them to suit your preferences.
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.
929 File: screen.info, Node: Bind, Next: Bind Examples, Up: Key Binding
934 - Command: bind [-c class] key [command [args]]
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::).
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.
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.
956 File: screen.info, Node: Bind Examples, Next: Command Character, Prev: Bind, Up: Key Binding
958 Examples of the `bind' command
959 ==============================
964 bind ^f screen telnet foobar
965 bind \033 screen -ln -t root -h 1000 9 su
967 would 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
969 available as `C-a space'), bind `C-f' to the command "create a window
970 with a TELNET connection to foobar", and bind <ESC> to the command that
971 creates an non-login window with title `root' in slot #9, with a
972 superuser shell and a scrollback buffer of 1000 lines.
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.
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.
987 File: screen.info, Node: Command Character, Next: Help, Prev: Bind Examples, Up: Key Binding
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.
1003 - Command: defescape xy
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.
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.
1018 - Command: command [-c CLASS]
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::.
1026 File: screen.info, Node: Help, Next: Bindkey, Prev: Command Character, Up: Key Binding
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::.
1042 File: screen.info, Node: Bindkey, Next: Bindkey Examples, Prev: Help, Up: Key Binding
1047 - Command: bindkey [OPTS] [STRING [CMD ARGS]]
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.
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
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.
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.
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
1077 File: screen.info, Node: Bindkey Examples, Next: Bindkey Control, Prev: Bindkey, Up: Key Binding
1082 Here are some examples of keyboard bindings:
1086 Show all of the default key bindings. The application mode entries are
1089 bindkey -k k1 select 1
1091 Make the "F1" key switch to window one.
1093 bindkey -t foo stuff barfoo
1095 Make `foo' an abbreviation of the word `barfoo'. Timeout is disabled so
1096 that users can type slowly.
1098 bindkey "\024" mapdefault
1100 This key-binding makes `C-t' an escape character for key-bindings. If
1101 you did the above `stuff barfoo' binding, you can enter the word `foo'
1102 by typing `C-t foo'. If you want to insert a `C-t' you have to press
1103 the key twice (i.e. escape the escape binding).
1105 bindkey -k F1 command
1107 Make the F11 (not F1!) key an alternative screen escape (besides `C-a').
1110 File: screen.info, Node: Bindkey Control, Prev: Bindkey Examples, Up: Key Binding
1115 - Command: mapdefault
1117 Tell screen that the next input character should only be looked up
1118 in the default bindkey table.
1120 - Command: mapnotnext
1122 Like mapdefault, but don't even look in the default bindkey table.
1124 - Command: maptimeout timo
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.
1131 File: screen.info, Node: Flow Control, Next: Termcap, Prev: Key Binding, Up: Top
1136 `screen' can trap flow control characters or pass them to the
1137 program, as you see fit. This is useful when your terminal wants to use
1138 XON/XOFF flow control and you are running a program which wants to use
1139 ^S/^Q for other purposes (i.e. `emacs').
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
1148 File: screen.info, Node: Flow Control Summary, Next: Flow, Up: Flow Control
1150 About `screen' flow control settings
1151 ====================================
1153 Each window has a flow-control setting that determines how screen
1154 deals with the XON and XOFF characters (and perhaps the interrupt
1155 character). When flow-control is turned off, screen ignores the XON
1156 and XOFF characters, which allows the user to send them to the current
1157 program by simply typing them (useful for the `emacs' editor, for
1158 instance). 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
1160 turned on, XON and XOFF characters are used to immediately pause the
1161 output of the current window. You can still send these characters to
1162 the current program, but you must use the appropriate two-character
1163 screen commands (typically `C-a q' (xon) and `C-a s' (xoff)). The
1164 xon/xoff commands are also useful for typing C-s and C-q past a
1165 terminal that intercepts these characters.
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
1169 to automatic flow-switching. It can then be toggled between the three
1170 states 'fixed on', 'fixed off' and 'automatic' interactively with the
1171 `flow' command bound to `C-a f'.
1173 The automatic flow-switching mode deals with flow control using the
1174 TIOCPKT mode (like `rlogin' does). If the tty driver does not support
1175 TIOCPKT, screen tries to determine the right mode based on the current
1176 setting of the application keypad -- when it is enabled, flow-control
1177 is turned off and visa versa. Of course, you can still manipulate
1178 flow-control manually when needed.
1180 If you're running with flow-control enabled and find that pressing
1181 the interrupt key (usually C-c) does not interrupt the display until
1182 another 6-8 lines have scrolled by, try running screen with the
1183 `interrupt' option (add the `interrupt' flag to the `flow' command in
1184 your .screenrc, or use the `-i' command-line option). This causes the
1185 output that `screen' has accumulated from the interrupted program to be
1186 flushed. One disadvantage is that the virtual terminal's memory
1187 contains the non-flushed version of the output, which in rare cases can
1188 cause minor inaccuracies in the output. For example, if you switch
1189 screens and return, or update the screen with `C-a l' you would see the
1190 version of the output you would have gotten without `interrupt' being
1191 on. Also, you might need to turn off flow-control (or use auto-flow
1192 mode to turn it off automatically) when running a program that expects
1193 you to type the interrupt character as input, as the `interrupt'
1194 parameter only takes effect when flow-control is enabled. If your
1195 program's output is interrupted by mistake, a simple refresh of the
1196 screen with `C-a l' will restore it. Give each mode a try, and use
1197 whichever mode you find more comfortable.
1200 File: screen.info, Node: Flow, Next: XON/XOFF, Prev: Flow Control Summary, Up: Flow Control
1205 - Command: defflow fstate [interrupt]
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.
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'.
1220 File: screen.info, Node: XON/XOFF, Prev: Flow, Up: Flow Control
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'.
1231 (`C-a s', `C-a C-s')
1232 Send a ^S (ASCII XOFF) to the program in the current window.
1235 File: screen.info, Node: Termcap, Next: Message Line, Prev: Flow Control, Up: Top
1240 `screen' demands the most out of your terminal so that it can
1241 perform its VT100 emulation most efficiently. These functions provide
1242 means for tweaking the termcap entries for both your physical terminal
1243 and the one simulated by `screen'.
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.