ANSI screen codes
A N S I S C R E E N C O D E S
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
complements of....
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ original ³
³ÛßßßßßßßßßßßßßßßßßßßßßßßÛÜÜ ÛÛÛÛÛÛ ³
³ÛÞÞÞÞÞ Magic-MARK-erÞÞÞ ÛÛÛ²²² ÛÛÛÛ ³
³ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛßß ÛÛÛÛ ³
³ graphics ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
The following screen codes are very easily entered
directly from your keyboard.
I enjoy using them when online on a bbs.
They can be used when sending mail, chatting privately
with another member, or in open forum.
You will be entering "ansi escape codes".
CURSOR CONTROL FUNCTIONS
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Cursor Position
ESC[#;#H
The sequence moves the cursor to the position specified by the parameters.
The First parameter (#) specifies the line number, and the second specifies
the column number. The default value is 1.
If no parameters are specified, the cursor is moved to the home position.
Cursor Up
ESC[#A
This sequence moves the cursor up one or more lines without changing columns.
The value of # determines the number of lines moved. The default value is 1.
The sequence is ignored if the cursor is already on the top line.
Cursor Down
ESC[#B
This sequence moves the cursor down one or more lines without changing columns.
The value of # determines the number of lines moved. The default value is 1.
The sequence is ignored if the cursor is already on the bottom line.
Cursor Forward
ESC[#C
This sequence moves the cursor forward one column without changing lines.
The value of # determines the number of columns moved. The default value is 1.
The sequence is ignored if the cursor is already on the far right column.
Cursor Backward
ESC[#D
This sequence moves the cursor back one column without changing lines.
The value of # determines the number of columns moved. The default value is 1.
The sequence is ignored if the cursor is already in the far left column.
Cursor Position Report
ESC[#;#R
This sequence reports current cursor position through the standard input device
The first parameter specifies the current line and the second parameter
specifies the current column.
Device Status Report
ESC[6n
This sequence reports current cursor position through the console driver,
which outputs a Cursor Position Report sequence.
Horizontal and Vertical Position
ESC[#;#f
Moves the cursor to the position specified by the parameters.
The first parameter specifies the line number,
and the second specifies the column number. The default value is 1.
If no parameters are specified, the cursor is moved to the home position.
Save Cursor Position
ESC[S
The current cursor position is saved.
This cursor position can be restored with the Restore Cursor Position sequence.
Restore Cursor Position
ESC[u
This sequence restores the cursor position to the value it had
when the console driver received the Save Cursor Position Sequence.
ERASE FUNCTIONS
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Erase Display
ESC[2J
This sequence erases the screen and moves the cursor to the home position.
Erase Line
ESC[K
This sequence erases from the cursor to the end of the line.
(including the cursor position).
MODES OF OPERATION
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Set Graphics Rendition
ESC[#;...;#m
This sequence invokes the graphic functions specified by the parameters
described in the Table 1 below. The graphic functions remains until the
next occurrence of this sequence.
For example:
ÄÄÄÄÄÄÄÄÄÄÄ
ESC[7mMagic-MARK-er knows ansiESC[0m
This makes the sentence "Magic-MARK-er knows ansi" display in reverse video.
ESC[33;44mMARK knows ANSIESC[0m
This makes the sentence "MARK knows ANSI" display in red against a
blue background on a color monitor.
ESC[37;5;44mMagic-MARK-er knows ansiESC[0m
This makes the sentence "MARK knows ANSI" display in a flashing white
foreground agsainst a red background.
Remember:
ÄÄÄÄÄÄÄÄ
The code after the above statements ESC[0m turns off the attributes
and is necessary. If it is not used, the screen will remain as set
by the original escape code you enter.
Table 1 ESCAPE PARAMETERS TO SET GRAPHICS RENDITION
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
0 All attributes OFF
1 Bold ON
4 Underscore ON (Monochrome displays only)
5 Blink ON
7 Reverse video ON
8 Concealed ON
F O R E G R O U N D C O L O R S
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
30 Black
31 Red
32 Green
34 Blue
35 Magenta
36 Cyan
37 White
For background colors add 10 to foreground colors
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
R E S E T M O D E
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
The following sequence turns the attributes off.
ESC[0m
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
complements of....
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ original ³
³ÛßßßßßßßßßßßßßßßßßßßßßßßÛÜÜ ÛÛÛÛÛÛ ³
³ÛÞÞÞÞÞ Magic-MARK-erÞÞÞ ÛÛÛ²²² ÛÛÛÛ ³
³ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛßß ÛÛÛÛ ³
³ graphics ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
The following screen codes are very easily entered
directly from your keyboard.
I enjoy using them when online on a bbs.
They can be used when sending mail, chatting privately
with another member, or in open forum.
You will be entering "ansi escape codes".
CURSOR CONTROL FUNCTIONS
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Cursor Position
ESC[#;#H
The sequence moves the cursor to the position specified by the parameters.
The First parameter (#) specifies the line number, and the second specifies
the column number. The default value is 1.
If no parameters are specified, the cursor is moved to the home position.
Cursor Up
ESC[#A
This sequence moves the cursor up one or more lines without changing columns.
The value of # determines the number of lines moved. The default value is 1.
The sequence is ignored if the cursor is already on the top line.
Cursor Down
ESC[#B
This sequence moves the cursor down one or more lines without changing columns.
The value of # determines the number of lines moved. The default value is 1.
The sequence is ignored if the cursor is already on the bottom line.
Cursor Forward
ESC[#C
This sequence moves the cursor forward one column without changing lines.
The value of # determines the number of columns moved. The default value is 1.
The sequence is ignored if the cursor is already on the far right column.
Cursor Backward
ESC[#D
This sequence moves the cursor back one column without changing lines.
The value of # determines the number of columns moved. The default value is 1.
The sequence is ignored if the cursor is already in the far left column.
Cursor Position Report
ESC[#;#R
This sequence reports current cursor position through the standard input device
The first parameter specifies the current line and the second parameter
specifies the current column.
Device Status Report
ESC[6n
This sequence reports current cursor position through the console driver,
which outputs a Cursor Position Report sequence.
Horizontal and Vertical Position
ESC[#;#f
Moves the cursor to the position specified by the parameters.
The first parameter specifies the line number,
and the second specifies the column number. The default value is 1.
If no parameters are specified, the cursor is moved to the home position.
Save Cursor Position
ESC[S
The current cursor position is saved.
This cursor position can be restored with the Restore Cursor Position sequence.
Restore Cursor Position
ESC[u
This sequence restores the cursor position to the value it had
when the console driver received the Save Cursor Position Sequence.
ERASE FUNCTIONS
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Erase Display
ESC[2J
This sequence erases the screen and moves the cursor to the home position.
Erase Line
ESC[K
This sequence erases from the cursor to the end of the line.
(including the cursor position).
MODES OF OPERATION
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Set Graphics Rendition
ESC[#;...;#m
This sequence invokes the graphic functions specified by the parameters
described in the Table 1 below. The graphic functions remains until the
next occurrence of this sequence.
For example:
ÄÄÄÄÄÄÄÄÄÄÄ
ESC[7mMagic-MARK-er knows ansiESC[0m
This makes the sentence "Magic-MARK-er knows ansi" display in reverse video.
ESC[33;44mMARK knows ANSIESC[0m
This makes the sentence "MARK knows ANSI" display in red against a
blue background on a color monitor.
ESC[37;5;44mMagic-MARK-er knows ansiESC[0m
This makes the sentence "MARK knows ANSI" display in a flashing white
foreground agsainst a red background.
Remember:
ÄÄÄÄÄÄÄÄ
The code after the above statements ESC[0m turns off the attributes
and is necessary. If it is not used, the screen will remain as set
by the original escape code you enter.
Table 1 ESCAPE PARAMETERS TO SET GRAPHICS RENDITION
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
0 All attributes OFF
1 Bold ON
4 Underscore ON (Monochrome displays only)
5 Blink ON
7 Reverse video ON
8 Concealed ON
F O R E G R O U N D C O L O R S
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
30 Black
31 Red
32 Green
34 Blue
35 Magenta
36 Cyan
37 White
For background colors add 10 to foreground colors
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
R E S E T M O D E
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
The following sequence turns the attributes off.
ESC[0m
Comments
Post a Comment