Escape Codes
artkennedy
Posts: 174
in Propeller 1
This is somewhat embarrassing. I can't make escape codes work in Terra Term. I am posting here instead on a Terra Term forum because I am trying to use Tachyon syntax to send the codes. I thought I had figured out what to do but I was mistaken.
Note: in CSRUP3 the parameter is sent as the ASCII code for "3" where as in CSRDN3 it is sent as the character itself. And I tried a lot more variations. A lot more.
In the terminal setup New-line Receive is set as AUTO and Transmit as CR.
What am I missing? (he is tempted to shout)
: CSRUP 27 EMIT 91 EMIT 65 EMIT ; : CSRUP3 27 EMIT 91 EMIT 3 EMIT 65 EMIT ; : CSHOME 27 EMIT 91 EMIT 49 EMIT 126 EMIT ; : CSLF 27 EMIT 91 EMIT 68 EMIT ; : CSRDN3 27 EMIT 91 EMIT 51 EMIT 66 EMIT ;Of these only CRSUP behaves as expected. Can anyone tell me why?
Note: in CSRUP3 the parameter is sent as the ASCII code for "3" where as in CSRDN3 it is sent as the character itself. And I tried a lot more variations. A lot more.
In the terminal setup New-line Receive is set as AUTO and Transmit as CR.
What am I missing? (he is tempted to shout)
Comments
I don't know if the Tachyon syntax is correct, however:
The number of positions should be a number and not the ASCII code, so 51 instead of 3.
This is a bit unclear, you want to clear the screen or move the cursor to home ? In either case, the last character 126 (tilde) is not correct. Home is ESC[H while clear screen is ESC[2J (which should not move the cursor as per specification, altough some implementations move the cursor, usually it should be followed by ESC[H).
These looks correct to me.
Have you tried to send the codes with spin (or something else) just to make sure they are correct and the terminal accepts them ?
Also, since you are using relative cursor movements, make sure the cursor is positioned so they have some effects, for example the cursor up sequence won't work if the cursor is already at the topmost position. Try sending something like ESC[10;10H at the beginning to position the cursor at 10,10.
For reference, just in case:
http://ascii-table.com/ansi-escape-sequences-vt-100.php
That's why you will see "neon" colors in TeraTerm.
Have you had a look at how it is done in EXTEND? Here are the relevant parts:
BTW, _ansi is a long because it stored the terminal response as a reference as well as a flag. No response from the terminal would shift in 4 null keys to make it a false flag.