• ANSI Question

    From apam@21:1/125 to All on Sun Sep 17 19:24:48 2017
    Hey

    Hoping Someone familiar with ANSI escape codes can answer..

    Is ESC[J (clear from cursor to end of the screen) not always supported? I've discovered HTMLterm is doing something weird when reading mail in magicka,

    basically when using arrow keys I go to the top of the displayed letter and erase to bottom of the screen then redraw from the cursor to the bottom of the screen to save having to redraw the header.

    It doesn't work in html term, it clears the whole screen, and puts some of the bottom of the screen into where the header goes.

    I figured out a way to work around it and not clear the screen at all, but just wondering if this a bug in HTML term or just me not understanding the standard.

    Thanks,
    Andrew
    --- MagickaBBS v0.6alpha (Linux/x86_64)
    * Origin: Exotica BBS - telnet://exoticabbs.com:2023/ (21:1/125)
  • From NuSkooler@21:1/121 to apam on Sun Sep 17 10:01:04 2017
    On Sunday, September 17th apam muttered...
    I figured out a way to work around it and not clear the screen at all, but just wondering if this a bug in HTML term or just me not understanding the standard.

    You're going to run into a lot of this across various terms. The "standards" are a bit rough :)

    To clear/reset screen, enig does: ESC[0mESC[2JESC[1;1H

    I've started a project (but not yet published anything really) with codewar65 to document the various oddities like this... will post it here when it's up and useful in some way :D





    --- ENiGMA 1/2 v0.0.8-alpha (linux; x64; 6.11.3)
    * Origin: Xibalba -+- xibalba.l33t.codes:44510 (21:1/121)
  • From Oliver@21:1/180 to apam on Sun Sep 17 16:44:34 2017
    Hi, I just looked up the sourcecode on http://github.com/dataliven/HtmlTerm/ blob/master/Release/HtmlTerm.js and there in line 3948 it is. There is an optional parameter n which states how to clear the screen. If it's not present or 0 then it should clear to the end of the screen. For this a function call
    to ClrEos()s included, and when looking at that, I see a scrollDown() and
    a ScrollUp() and a clrEol() but no loop, so this does not look to be
    very well implemented.

    Best regards
    Oliver

    --- Mystic BBS v1.12 A31 (Raspberry Pi)
    * Origin: bab.by (21:1/180)
  • From codewar65@21:1/121 to Oliver on Sun Sep 17 14:19:24 2017
    On Sunday, September 17th Oliver was heard saying...
    there in line 3948 it is. There is an optional parameter n which states how to clear the screen. If it's not present or 0 then it should clear to the end of the screen. For this a function call to ClrEos()s included,

    Many CSI parameters are optional and have default values. CSI n J is one of them. if there is no value for n, 0 is used (ClrEos).

    How terminals interprete some codes vary. Like CSI r ; c H can be abbreviated to CSI H to move the cursor to row 1, col 1. CSI 0 m can be abbreviated CSI m.

    I wrote a VT100 complient terminal once and things like attribute reset on clear screen, or even if the cursor should move vary. (the cursor is not supposed to go to 1,1 on CSI 2 J btw, but because of ANSI.SYS, many do).

    Best to be safe and send the kitchen sink to the client. If you are clearing a screen and don't want to move the cursor, perform either CSI 0 J CSI 1 J or CSI
    s CSI 2 J CSI u. Take nothing for granted. ;)

    cw

    --- ENiGMA 1/2 v0.0.8-alpha (linux; x64; 6.11.3)
    * Origin: Xibalba -+- xibalba.l33t.codes:44510 (21:1/121)