kristofer sweger Home
ANSIPLUS Home


Escape Sequences

Each of the "ANSI" Escape sequences recognized by ANSIPLUS is listed in the table below with a link to its detailed description. In the table, " # " represents any numeric parameter and " Esc " is the Escape character (decimal 27, hexadecimal 1Bh). Because ANSIPLUS has so many different escape sequences, they have been grouped by six major function categories: display mode and character set, cursor positioning, color selection and definition, erase, insert, delete and fill, scrolling and driver status and control

ANSIPLUS Escape Sequences
Escape Seq. Description and Link

Display mode and character set
Esc [#;#h Set video mode
Esc [#;# l Reset video mode
Esc [!#;#t Select character set height
Esc [!#;... #e Select graphics mode text treatment options

Cursor positioning
Esc [!#v  Select video page
Esc [#U Select next page
Esc [#V  Select preceding page
Esc [#;#H Set cursor position
Esc [#;#f Set cursor position
Esc [#A Move cursor up
Esc [#B Move cursor down
Esc [#C Move cursor right
Esc [#D Move cursor left
Esc [#E  Move cursor to next line
Esc [#F  Move cursor to preceding line
Esc [#G  Move cursor to absolute column in same line
Esc [#a  Move cursor to absolute line in same column
Esc [#;#;#g Reset tabs
Esc [#;... #W Tab control
Esc [#I Horizontal tab
Esc [#Y Vertical tab
Esc [#Z Backward tab
Esc [#;#s Save cursor position or other driver context
Esc [#;#u Restore cursor position or other driver context

Color selection and definition
Esc [!#;#;#;#;#c Define colors, select palette, setup blinking
Esc [#;... #m Select current color attributes for output
Escape Seq. Description and Link

Erase, insert, delete and fill
Esc [#;#J Clear the current screen page
Esc [#;#;#K Clear the current line
Esc [#;#X Erase characters on the current line
Esc [#;#L Insert lines on the screen
Esc [!#;#L Insert lines from scroll-back
Esc [#;#M  Delete lines from the screen
Esc [!#;#M Delete lines and add to scroll-back
Esc [#;#@ Insert characters on a line
Esc [#;#P Delete characters from a line
Esc [#b Repeat last output character

Scrolling
Esc [#;#;#;#;#S Scroll up
Esc [!#;#;#;#;#S Scroll up and add to scroll-back
Esc [#;#;#;#;#T Scroll down
Esc [!#;#;#;#;#T Scroll down from scroll-back
Esc [#;#;#;#;# @ Scroll left
(Note: a space must precede @)
Esc [#;#;#;#;# A Scroll right
(Note: a space must precede A)
Esc [#;#;#;#r Set scrolling region

Driver status and control
Esc [#;#n Query ANSIPLUS status
Esc [!#;... #d Enable/disable ANSIPLUS driver features
Esc [!#;... #g Define Ctrl+G beep tone
Esc [#;... #p Define key reassignment
Esc [!#;... #k Add keys to keyboard buffer
Esc [!#w Wait for specified time to elapse

 

ANSIPLUS Extensions and the ANSI Standard

ANSIPLUS uses a number of added control parameters and includes entire new control functions that are not part of the ANSI X3.64 standard or the MS-DOS ANSI.sys driver, so do not expect them to be supported by any other drivers or devices. The following added ANSIPLUS functions are not standard ANSI:

Esc [!#t Select character set height
Esc [!#;...#e Select graphics mode text treatment options
Esc [!#v Select video page
Esc [!#;#;#;#;#c Define colors available, select palette, setup blinking
Esc [!#;#L Insert lines from scroll-back
Esc [!#;#M Delete lines and add to scroll-back
Esc [!#;#;#;#;#S Scroll up and add to scroll-back
Esc [!#;#;#;#;#T Scroll down from scroll-back
Esc [!#;...#d Enable or disable ANSIPLUS driver features
Esc [!#;...#g Define Ctrl +G beep tone
Esc [!#;...#k Add keys to keyboard buffer
Esc [!#w Wait for specified time to elapse

The following ANSI control sequences accept both standard ANSI parameters and extra ANSIPLUS parameters, but are not included in MS-DOS ANSI.sys:

Esc [#;#g Reset tabs
Esc [#;...#W Tab control
Esc [#;#X Erase characters on the current line
Esc [#;#L Insert lines on the screen
Esc [#;#M Delete lines from the screen
Esc [#;#@ Insert characters on a line
Esc [#;#P Delete characters from a line
Esc [#;#;#;#;#S Scroll up
Esc [#;#;#;#;#T Scroll down
Esc [#;#;#;#;# @ Scroll left
Esc [#;#;#;#;# A Scroll right
Esc [#;#;#;#r Set scrolling region

The following are standard ANSI terminal control sequences that are not included in MS-DOS ANSI.sys:

Esc [#U Select next page
Esc [#V Select preceding page
Esc [#E Move cursor to next line
Esc [#F Move cursor to preceding line
Esc [#G Move cursor to absolute column in same line
Esc [#a Move cursor to absolute line in same column
Esc [#I  Horizontal tab
Esc [#Y Vertical tab
Esc [#Z Backward tab
Esc [#b Repeat last output character

The following control sequences, which are also included in ANSI.sys, accept both standard ANSI parameters and extra ANSIPLUS parameters:

Esc [#;#h Set video mode
Esc [#;#s Save cursor position or other driver context
Esc [#;#u Restore cursor position or other driver context
Esc [#;#J Clear the screen
Esc [#;#;#K Clear the current line
Esc [#;...#m Select current color attributes for output characters
Esc [#;#n Query ANSIPLUS status: cursor position, colors, etc.
Esc [#;...#p Define key reassignment

The following are ANSI sequences that are in both MS-DOS ANSI.sys and ANSIPLUS:

Esc [#A Move cursor up
Esc [#B Move cursor down
Esc [#C Move cursor right
Esc [#D Move cursor left

 

Escape Sequence Recognizer Enhancements

To simplify program generation of control sequences, the ANSIPLUS escape sequence recognizer syntax has been relaxed:

Unrecognized escape sequences are passed through by the driver unaltered. With a few exceptions, the Esc character is trapped only when followed by a left bracket ("["), so programs that write the escape character (a left arrow) to the screen will continue to do so after the driver is installed. The exceptions are Esc E, Esc H and Esc J, which are all ANSI standard.


© Copyright 2000-2007, Kristofer Sweger. All rights reserved.
Rev. 10/16/07