ANSI escape characters

156 views
Skip to first unread message

Klaas-Jan Stol

unread,
Aug 2, 2005, 7:26:43 AM8/2/05
to Internals List
hi,

I'm not very familiar with this, so forgive me for my ignorance with
this. I don't know whether this issue is related to Parrot, or that it's
something else I don't understand. I read a bit about ANSI escape codes,
and I'm wondering if this should work in Parrot. That is, when writing
these commands:

"\027[2J" -- ANSI clear screen
"\027[H" -- ANSI home cursor

The screen should be cleared and the cursor should be set to it's
original position. However, when I use these codes, it doesn't work, the
first time
I write something to the screen, I get this:

[2J[H

and after this,

[H

is displayed before the rest of the things being printed.
Again, I don't know if this is a Parrot issue, or it's me doing
somehting wrong. Anybody got a clue?

Maybe a related issue: WHen trying to store characters like "¥" and "ş"
in a string, it doesnt' work. I couldn't really find status info on
strings. (should this be working already? or is it under construction)

Thanks,
klaas-jan

Nick Glencross

unread,
Aug 2, 2005, 9:35:46 AM8/2/05
to perl6-i...@perl.org

Nick Glencross

unread,
Aug 2, 2005, 9:39:40 AM8/2/05
to perl6-i...@perl.org
Nick Glencross wrote:

I may have been overly concise! What I meant was that \0xx notation is
octal, and so \033 is Escape. Haven't tried the Jako example, but the
pasm one still works!

Nick

Klaas-Jan Stol

unread,
Aug 3, 2005, 4:55:28 AM8/3/05
to Nick Glencross, perl6-i...@perl.org
Nick Glencross wrote:

Thanks Nick! It works :-)
I'm only wondering why Lua writes the string "\027..." to the screen,
with the same effect. Can it have something to do with the encoding?
(ascii, iso-8859-1, unicode)

Thanks again,
klaas-jan

Leopold Toetsch

unread,
Aug 3, 2005, 5:45:56 AM8/3/05
to Klaas-Jan Stol, perl6-i...@perl.org
Klaas-Jan Stol wrote:

> I'm only wondering why Lua writes the string "\027..." to the screen,
> with the same effect. Can it have something to do with the encoding?
> (ascii, iso-8859-1, unicode)

No. In all these charsets <esc> := 27d, 0x1b, 033o. Therefore the reason
can only be that Lua doesn't convert \027 to octal, but to decimal. All
these string escapes are a matter of the language specs and can vary
between HLLs.

> Thanks again,
> klaas-jan

leo

Reply all
Reply to author
Forward
0 new messages