Each window in a screen session emulates a VT100 terminal, with
some extra functions added. The VT100 emulator is hardcoded, no other
terminal types can be emulated.
The commands described here modify the terminal emulation.
The following is a list of control sequences recognized by
screen. `(V)' and `(A)' indicate VT100-specific and
ANSI- or ISO-specific functions, respectively.
ESC E Next Line
ESC D Index
ESC M Reverse Index
ESC H Horizontal Tab Set
ESC Z Send VT100 Identification String
ESC 7 (V) Save Cursor and Attributes
ESC 8 (V) Restore Cursor and Attributes
ESC [s (A) Save Cursor and Attributes
ESC [u (A) Restore Cursor and Attributes
ESC c Reset to Initial State
ESC g Visual Bell
ESC Pn p Cursor Visibility (97801)
Pn = 6 Invisible
7 Visible
ESC = (V) Application Keypad Mode
ESC > (V) Numeric Keypad Mode
ESC # 8 (V) Fill Screen with E's
ESC \ (A) String Terminator
ESC ^ (A) Privacy Message String (Message Line)
ESC ! Global Message String (Message Line)
ESC k Title Definition String
ESC P (A) Device Control String
Outputs a string directly to the host
terminal without interpretation.
ESC _ (A) Application Program Command (Hardstatus)
ESC ] (A) Operating System Command (Hardstatus, xterm
title hack)
Control-N (A) Lock Shift G1 (SO)
Control-O (A) Lock Shift G0 (SI)
ESC n (A) Lock Shift G2
ESC o (A) Lock Shift G3
ESC N (A) Single Shift G2
ESC O (A) Single Shift G3
ESC ( Pcs (A) Designate character set as G0
ESC ) Pcs (A) Designate character set as G1
ESC * Pcs (A) Designate character set as G2
ESC + Pcs (A) Designate character set as G3
ESC [ Pn ; Pn H Direct Cursor Addressing
ESC [ Pn ; Pn f Direct Cursor Addressing
ESC [ Pn J Erase in Display
Pn = None or 0 From Cursor to End of Screen
1 From Beginning of Screen to Cursor
2 Entire Screen
ESC [ Pn K Erase in Line
Pn = None or 0 From Cursor to End of Line
1 From Beginning of Line to Cursor
2 Entire Line
ESC [ Pn A Cursor Up
ESC [ Pn B Cursor Down
ESC [ Pn C Cursor Right
ESC [ Pn D Cursor Left
ESC [ Ps ;...; Ps m Select Graphic Rendition
Ps = None or 0 Default Rendition
1 Bold
2 (A) Faint
3 (A) Standout Mode (ANSI: Italicized)
4 Underlined
5 Blinking
7 Negative Image
22 (A) Normal Intensity
23 (A) Standout Mode off (ANSI: Italicized off)
24 (A) Not Underlined
25 (A) Not Blinking
27 (A) Positive Image
30 (A) Foreground Black
31 (A) Foreground Red
32 (A) Foreground Green
33 (A) Foreground Yellow
34 (A) Foreground Blue
35 (A) Foreground Magenta
36 (A) Foreground Cyan
37 (A) Foreground White
39 (A) Foreground Default
40 (A) Background Black
... ...
49 (A) Background Default
ESC [ Pn g Tab Clear
Pn = None or 0 Clear Tab at Current Position
3 Clear All Tabs
ESC [ Pn ; Pn r (V) Set Scrolling Region
ESC [ Pn I (A) Horizontal Tab
ESC [ Pn Z (A) Backward Tab
ESC [ Pn L (A) Insert Line
ESC [ Pn M (A) Delete Line
ESC [ Pn @ (A) Insert Character
ESC [ Pn P (A) Delete Character
ESC [ Pn S Scroll Scrolling Region Up
ESC [ Pn T Scroll Scrolling Region Down
ESC [ Ps ;...; Ps h Set Mode
ESC [ Ps ;...; Ps l Reset Mode
Ps = 4 (A) Insert Mode
20 (A) `Automatic Linefeed' Mode.
34 Normal Cursor Visibility
?1 (V) Application Cursor Keys
?3 (V) Change Terminal Width to 132 columns
?5 (V) Reverse Video
?6 (V) `Origin' Mode
?7 (V) `Wrap' Mode
?25 (V) Visible Cursor
ESC [ 5 i (A) Start relay to printer (ANSI Media Copy)
ESC [ 4 i (A) Stop relay to printer (ANSI Media Copy)
ESC [ 8 ; Ph ; Pw t Resize the window to `Ph' lines and
`Pw' columns (SunView special)
ESC [ c Send VT100 Identification String
ESC [ x (V) Send Terminal Parameter Report
ESC [ > c Send Secondary Device Attributes String
ESC [ 6 n Send Cursor Position Report
In order to do a full VT100 emulation screen has to detect
that a sequence of characters in the input stream was generated
by a keypress on the user's keyboard and insert the VT100
style escape sequence. Screen has a very flexible way of doing
this by making it possible to map arbitrary commands on arbitrary
sequences of characters. For standard VT100 emulation the command
will always insert a string in the input buffer of the window
(see also command stuff, see section Paste).
Because the sequences generated by a keypress can
change after a reattach from a different terminal type, it is
possible to bind commands to the termcap name of the keys.
Screen will insert the correct binding after each
reattach. See section Bindkey for further details on the syntax and examples.
Here is the table of the default key bindings. (A) means that the command is executed if the keyboard is switched into application mode.
Key name Termcap name Command
-----------------------------------------------------
Cursor up ku stuff \033[A
stuff \033OA (A)
Cursor down kd stuff \033[B
stuff \033OB (A)
Cursor right kr stuff \033[C
stuff \033OC (A)
Cursor left kl stuff \033[D
stuff \033OD (A)
Function key 0 k0 stuff \033[10~
Function key 1 k1 stuff \033OP
Function key 2 k2 stuff \033OQ
Function key 3 k3 stuff \033OR
Function key 4 k4 stuff \033OS
Function key 5 k5 stuff \033[15~
Function key 6 k6 stuff \033[17~
Function key 7 k7 stuff \033[18~
Function key 8 k8 stuff \033[19~
Function key 9 k9 stuff \033[20~
Function key 10 k; stuff \033[21~
Function key 11 F1 stuff \033[22~
Function key 12 F2 stuff \033[23~
Backspace kb stuff \010
Home kh stuff \033[1~
End kH stuff \033[4~
Insert kI stuff \033[2~
Delete kD stuff \033[3~
Page up kP stuff \033[5~
Page down kN stuff \033[6~
Keypad 0 f0 stuff 0
stuff \033Op (A)
Keypad 1 f1 stuff 1
stuff \033Oq (A)
Keypad 2 f2 stuff 2
stuff \033Or (A)
Keypad 3 f3 stuff 3
stuff \033Os (A)
Keypad 4 f4 stuff 4
stuff \033Ot (A)
Keypad 5 f5 stuff 5
stuff \033Ou (A)
Keypad 6 f6 stuff 6
stuff \033Ov (A)
Keypad 7 f7 stuff 7
stuff \033Ow (A)
Keypad 8 f8 stuff 8
stuff \033Ox (A)
Keypad 9 f9 stuff 9
stuff \033Oy (A)
Keypad + f+ stuff +
stuff \033Ok (A)
Keypad - f- stuff -
stuff \033Om (A)
Keypad * f* stuff *
stuff \033Oj (A)
Keypad / f/ stuff /
stuff \033Oo (A)
Keypad = fq stuff =
stuff \033OX (A)
Keypad . f. stuff .
stuff \033On (A)
Keypad , f, stuff ,
stuff \033Ol (A)
Keypad enter fe stuff \015
stuff \033OM (A)
screen
will treat the following charcters (up to three) as an octal
number instead. The optional argument preset
is treated as user input, thus one can create an "umlaut" key.
For example the command `bindkey ^K digraph '"'' enables the user
to generate an a-umlaut by typing `CTRL-K a'.
screen
displays a notification in the message line. The notification message
can be re-defined by means of the bell command. Each occurrence
of `%' in message is replaced by the number of the window to
which a bell has been sent, and each occurrence of `~' is replaced
by the definition for bell in your termcap (usually an audible bell).
The default message is
'Bell in window %'
An empty message can be supplied to the bell_msg command to suppress
output of a message line (bell_msg "").
vbell is switched to `on', but your
terminal does not support a visual bell, the visual bell message is
displayed in the status line when the bell character is received.
Visual bell support of a terminal is
defined by the termcap variable vb. See section `Visual Bell' in The Termcap Manual, for more information on visual bells.
The equivalent terminfo capability is flash.
Per default, vbell is `off', thus the audible bell is used.
vbell is
set to `on' and the terminal does not support a visual bell.
The default message is `Wuff, Wuff!!'.
Without parameter, the current message is shown.
screen 's visual
bell message. The default is 1 second.
time.
allpartial off. This is a global flag that immediately takes effect
on all windows overriding the partial settings. It does not change the
default redraw behaviour of newly created windows.
redisplay) after switching to the current window. This command
only affects the current window. To immediately affect all windows use the
allpartial command. Default is `off', of course. This default is
fixed, as there is currently no defpartial command.
wrap command except that the default setting for new
windows is changed. Initially line-wrap is on and can be toggled with the
wrap command (C-a r) or by means of "C-a : wrap on|off".
termcap command (see section Termcap), for more information.
The current setting can be viewed with the See section Info command.