Can anyone tell me how these codes are interpreted by the various
machines, and whether it is a good idea to use them at all? If needed I
will run up a quick coloured picture and post it to any interested
parties to see if their terminal will make sense of it.
Thanks,
GtB
They are infact called 'ANSI' codes. There is a standard, and most
platforms seem to have something that does stick pretty close to the
standard.
: Can anyone tell me how these codes are interpreted by the various
: machines, and whether it is a good idea to use them at all? If needed I
: will run up a quick coloured picture and post it to any interested
: parties to see if their terminal will make sense of it.
All Machines should be able to manage the following codes:
<ESC>[0 Reset all Attributes (and set colour to White on Black)
[1 Bold Characters (Hi Intensity)
[2 Low Intensity (Linux does this - not sure about others)
[4 Underscore (Not all term emmulations do this - Linux does)
[5 Flashing Text (Not all term emmulations do this - Linux does)
[7 Inverse Video
[8 Concealed on (I've never played with this one, it has
no effect under any of Linux's Term Emms)
Foreground Background
Black <ESC>[30 [40
Red [31 [41
Green [32 [42
Yellow [33 [43
Blue [34 [44
Magneta [35 [45
Cyan [36 [46
White [37 [47
Codes can be joined together to make strings for example:
<ESC>[1;37;42m Will turn Hi Intensity on, set colour to
White on Green. It will be a bright white
(Because Hi Intensity has been turned on.)
<ESC>[2J Will Clear the Screen and move the cursor
to Position 0,0. (Should work on most
term emms. Tho some prefer Ctrl-L, you are
probably safer sticking to a <ESC>[2J)
<ESC>[x;yH Locate position x;y (where X is the Row
and Y is the column) - You'd be better off
avoiding this one unless you want to do
animations.
The above colours comply with a universal standard (ISO 6429) which means
they should be okay on any platform which is capable of displaying them.
(Ie they wont show up on a mono display :)
: Thanks,
: GtB
If this isn't totally clear, gimme an Email...
-Jared
--
Jared Quinn fu...@jungle.hna.com.au
-------------------------------------------------------------------------
"I'm not Crazy! (In an Institution) Your the one who's crazy. (In an
Institution) Your driving me crazy! (In an Institution)"
Institutionalised (Suicidal Tendencies)
(Well, this is the *only* one I use, because it's the most universal.)
What's badly *needed* is an additional code for "WAIT n SECONDS". It
would be easy to create a replacement for 'cat' that supported this--
any suggestions as to the *least-compromised* escape sequence to assign
to this new function???
I've been resorting to shameless 'padding' of my animation experiments,
so they play okay at 9600 or better. This simple WAIT sequence could
resolve that totally, allowing much more compact animations...
jorn
ObAscii: The Killroy collection
/---\
| O O |
--oOO--U--OOo--
____
_(____)_
___ooO_(_o__o_)_Ooo___
\|||/
(o o)
----ooO-(_)-Ooo--------
( ( ( ))
) ) ) ((
( ( ( ___o___)
'. ___ .' | |====O
' (> <) ' |_____|
--ooO-(_)-Ooo--------------------
"""""""
^-O-O-^
---ooO--U--Ooo-----
......
.:||||||||:.
/ \
( o o )
--@@@@----------: :----------@@@@--
>\\\|/<
|_"""_|
(O) (o)
+----OOO--(_)--OOOo---