Go to the previous, next section.

Virtual Terminal

Each window in a screen session emulates a VT100 terminal, with some extra functions added. The commands described here modify the terminal emulation.

Control Sequences

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 =                   (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 (not used)
ESC ]                   (A)     Operating System Command (not used)
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
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 [ Ps ;...; Ps h             Set Mode
ESC [ Ps ;...; Ps l             Reset Mode
      Ps = 4            (A)     Insert Mode
           ?1           (V)     Application Cursor Keys
           ?3           (V)     Change Terminal Width to 132 columns
           ?5           (V)     Visible Bell (`On' followed by `Off')
           ?6           (V)     `Origin' Mode
           ?7           (V)     `Wrap' Mode
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 [ 6 n                       Send Cursor Position Report

Bell

Command: bell message

(none)
When a bell character is sent to a background window, 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 command to suppress output of a message line (bell "").

Command: vbell [state]

(C-a C-g)
Sets or toggles the visual bell setting for the current window. If your terminal does not support a visual bell, the visual bell message is displayed in the status line. See section `Visual Bell' in The Termcap Manual, for more information on visual bells. The equivalent terminfo capability is flash.

Command: vbell_msg message

(none)
Sets the visual bell message. message is printed to the status line if the window receives a bell character (^G) and vbell is set to `on'. The default message is `Wuff, Wuff!!'.

Command: vbellwait sec

(none)
Define a delay in seconds after each display of screen 's visual bell message. The default is 1 second.

Clear

Command: clear

(C-a C)
Clears the screen and saves its contents to the scrollback buffer.

Height

Command: height [lines]

(none)
Set the display height to a specified number of lines. When no argument is given it toggles between 24 and 42 lines display.

Info

Command: info

(C-a i, C-a C-i)
Uses the message line to display some information about the current window: the cursor position in the form `(column,row)' starting with `(1,1)', the terminal width and height plus the size of the scrollback buffer in lines, like in `(80,24)+50', various flag settings (flow-control, insert mode, origin mode, wrap mode, application-keypad mode, output logging, activity monitoring, and redraw (`+' indicates enabled, `-' not)), the currently active character set (`G0', `G1', `G2', or `G3'), and in square brackets the terminal character sets that are currently designated as `G0' through `G3'. For system information use time.

Redisplay

Command: allpartial state

(none)
If set to on, only the current cursor line is refreshed on window change. This affects all windows and is useful for slow terminal lines. The previous setting of full/partial refresh for each window is restored with allpartial off.

Command: partial state

(none)
Defines whether the display should be refreshed (as with redisplay) after switching to the current window. This command only affects the current window. To affect all windows use the allpartial command. Default is `off', of course.

Command: redisplay

(C-a l, C-a C-l)
Redisplay the current window. Needed to get a full redisplay in partial redraw mode.

Wrap

Command: wrap state

(C-a r, C-a C-r)
Sets the line-wrap setting for the current window. When line-wrap is on, the second consecutive printable character output at the last column of a line will wrap to the start of the following line. As an added feature, backspace (^H) will also wrap through the left margin to the previous line. Default is `on'.

Command: defwrap state

(none)
Same as the 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".

Reset

Command: reset

(C-a Z)
Reset the virtual terminal to its "power-on" values. Useful when strange settings (like scroll regions or graphics character set) are left over from an application.

Width

Command: width [num]

(C-a W)
Toggle the window width between 80 and 132 columns, or set it to num columns if an argument is specified. This requires a capable terminal and the termcap entries `Z0' and `Z1'. See the termcap command (see section Termcap), for more information.

Go to the previous, next section.