ICE

Please login or register.

Login with username, password and session length
Advanced search  

News:

ICETCP.PRO and ICETCP.PLUS are compatible with Windows 11!

Author Topic: Special Escape Sequences Decoded!  (Read 9413 times)

admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 26
Special Escape Sequences Decoded!
« on: June 26, 2006, 11:49:09 am »

The following is a listing of extended escape sequences, most of these are NOT supported by native terminals (like a real wyse60). They are in all versions of ICE and should be sent from the Unix side via a shell script or profile entry. The ESC is the escape character, 1b hex, 27 decimal or 33 octal. For example, to set the cursor to a block the command in a script file or from a bash prompt would be:
echo  -e  "\033[=1;11C\c"
Where \033 is the octal code for escape.
the \c at the end of the string supresses an added carriage return.
-e is required for some shells and not others.

Screen size changing for the wyse60/wyse160
ESC`;      set to 132 columns
ESC`:      set to 80 columns
ESCe+      set to 43 lines
ESCe)      set to 25 lines


Screen size changing for all other terminal types
ESC[?3h    set to 132 columns
ESC[?3l    set to 80 columns
ESC[?26h    set to 43 lines
ESC[?26l    set to 24 lines
ESC[?27l    set to 25 lines


Setting screen colors and attributes
Escape sequences can be used to customize the following terminal emulation attributes on the fly: screen colors, cursor appearance, graphic (line drawing) character colors, reverse video colors, color definition of blinking, color definition of underline, color definition of high intensity underline.

There are some differences between the support of these on the wyse emulations compared to the other emulations.

Wyse60/160, IBM3151, VT102, VT220, ATT605
These are monochrome terminals which cannot natively display color. ICE supports UNIX console color setting sequences adding color setting to the normal wyse emulation. ANSI standard color setting sequences are also supported. The SCO setcolor command will also work for setting all the attributes listed above.

Ansi (SCO), AT386, Linux Console
These are standard color terminals. ANSI standard color setting sequences are supported. SCO unix setcolor sequences are also supported.

How color sequences work
The numbers shown in the color code tables represent colors. They should be used in escape sequences whenever the letter C appears below. For example, the escape sequence for setting the Ansi foreground color is ESC[3Cm. To set the foreground color to cyan the actual escape sequence would be ESC[36m

Ansi Color Sequences (All Emulations)
ESC[3Cm   Set foreground color
ESC[4Cm   Set Background color

Ansi color codes for above:
0=black 1=red      2=green 3=yellow
4=blue   5=magenta   6=cyan   7=white

The following is an example of an Ansi color sequence as it might be set in a script file (sets blue foreground on white background).

echo  "\033[34m\033[47m"

The following setcolor code chart applies to all color setting sequences below this point.

0=black          1=blue           2=green          3=cyan
4=red            5=magenta        6=brown          7=white
8=grey           9=light blue     10=light green    11=light cyan
12=light red     13=light magenta 14=yellow        15=light white


Old Setcolor (xenix) codes
The old setcolor sequences are supported fully for wyse emulation. Only the foreground and background sequences are supported for non-wyse emulations. The letter C in the list below should be replaced with a color code. If there is more than one C the first one is foreground and the second is background.

ESC[2;C;C;m   Set normal foreground and background colors
ESC[7;C;C;m   Set reverse foreground and background colors
ESC[2;C;C;g   Set graphics foreground and background colors
ESC[=S;EC    Set the cursor size where S is the starting line (from the top of a character cell) to E which is the end line of a character cell

New version setcolor codes
These are supported for all terminal types. The letter C in the list below should be replaced with a color code.
ESC[=1D  Set high intensity for background
ESC[=1E  Set normal intensity for background
ESC[=CF  Set normal foreground color
ESC[=CG  Set normal background color
ESC[=CH  Set reverse video foreground color
ESC[=CI  Set reverse video background color
ESC[=CJ  Set graphics char foreground color
ESC[=CK  Set graphics char background color
ESC[=S;EC    Set the cursor size where S is the starting line (from the top of a character cell) to E which is the end line of a character cell

Special ICE defined extra color sequences
These special escape sequences are for changing the colors that emulate underlining and blinking attributes. All terminal types are supported.

ESC[=SL   Set background fill attribute color
 S=0 fill with the current background color
 S=1  fill with the current base background color
ESC[=SM   Return current color attributes:
 S=0 return current foreground colors
 S=1 return current reverse colors
 S=2 return current graphic char colors
ESC[=CN   Set write protect char foreground color
ESC[=CO   Set write protect char background color
ESC[=CP    Set BOLD foreground char color
ESC[=CR   Set blink char foreground color
ESC[=CS   Set blink char background color
ESC[=T     Reset all of the above to their default values and colors
ESC[=CU   Set underline normal foreground color
ESC[=CV   Set underline normal background color
ESC[=CW   Set underline high foreground color
ESC[=CX   Set underline high background color
ESC[=SY   Set color fill flag
 S=0 default (base) background
 S=1 current background
ESC[=Z   Reset to default colors
ESC[=C[   Set BOLD background attribute color
ESC[=S\   Wyse graphics attribute
 S=0 wyse compatible (no separate graphic char attribute)
 S=1 old DEJAVU compatible (separate graphic char attribute)

« Last Edit: April 20, 2010, 04:15:56 pm by Bob »
Logged
 

Page created in 0.015 seconds with 20 queries.