A-Net Online

  • ansview.py

    From hollowone@911:1503/0 to All on Sat Oct 25 12:05:43 2025
    https://github.com/hollowonepl/ansviewer

    A little bit of my own development to show .ANS files in my iTerm2 on Mac.
    but as it's python script it should work on Linux, Unix and whatever that has Python3 and ANSI Escape codes supporting terminal emulator

    One day of coding so may be faulty. sharing as it is!

    -h1

    ... Xerox Alto was the thing. Anything after we use is just a mere copy.

    --- Mystic BBS v1.12 A49 2024/05/29 (Linux/64)
    * Origin: 2o fOr beeRS bbS>>20ForBeers.com:1337 (911:1503/0)
  • From hollowone@911:1503/0 to hollowone on Sat Oct 25 12:40:52 2025
    https://github.com/hollowonepl/ansviewer

    Disregard unless you want to help fix some obvious bugs.

    I was proud way too quickly with some of my sample .ANS
    but then I got massacred by the ANSI art packs and bringing this back to
    my sandbox.

    but I want to complete this script under a goal that it's minimalistic and uses no dependencies other than system.

    Wish me luck.

    -h1

    ... -=Lordz of BooM are back=-

    --- Mystic BBS v1.12 A49 2024/05/29 (Linux/64)
    * Origin: 2o fOr beeRS bbS>>20ForBeers.com:1337 (911:1503/0)
  • From dingo@911:1801/0 to hollowone on Wed Oct 29 15:51:57 2025

    On Saturday, October 25th hollowone said...
    https://github.com/hollowonepl/ansviewer

    Disregard unless you want to help fix some obvious bugs.

    It's all good man, I've written all that before as well, it was built into the x/84 bbs, also in python, the basic "trick" of your script is using python to decode cp437 as unicode and display it natively, as utf-8, that's the basic problem of using modern terminals with legacy bbs systems, too.

    I wrote a telnet client in python, 'pip install telnetlib3' and 'telnetlib3-client --help' has option '--encoding=cp437' or similar to do that, so you can connect to these legacy systems with a modern terminal instead of special ones like syncterm. Though I do appreciate the bitmap fonts, I may make a new telnet client that uses sixel to render bitmap fonts, like topaz or cp437 in modern terminals, i guess i'll announce it here if I remember

    I use this for sauce parsing, https://github.com/tehmaze/sauce/blob/master/sauce/__init__.py and now also co-maintain it

    I use this for screen and keyboard, all that termios/etc stuff can work on windows, though everyone uses WSL on windows now so it doesn't matter, https://github.com/jquast/blessed/ i forked and continue to maintain this library, I have several open PR's for adding more advanced stuff like mouse support hope to released soon, just waiting for anyone to review it

    I then combined the two libraries into a "showart()" function in that old bbs, and, the special "Terminal.wrap" method allows me to center the art on the screen, the blessed wrap function takes care to understand the horizontal distances of sequences or whatever which makes that possible https://github.com/jquast/x84/blob/11f445bb82e6e895d7cce57d4c6d8572d1981162/x84/bbs/output.py#L244-L392


    --- ENiGMA 1/2 v0.0.14-beta (linux; x64; 22.18.0)
    * Origin: Xibalba -+- xibalba.vip:44510 (911:1801/0)
  • From hollowone@911:1503/0 to dingo on Thu Oct 30 13:38:39 2025
    Disregard unless you want to help fix some obvious bugs.

    It's all good man, I've written all that before as well, it was built
    into the x/84 bbs, also in python, the basic "trick" of your script is using python to decode cp437 as unicode and display it natively, as
    utf-8, that's the basic problem of using modern terminals with legacy
    bbs systems, too.
    I wrote a telnet client in python, 'pip install telnetlib3' and 'telnetlib3-client --help' has option '--encoding=cp437' or similar to
    do that, so you can connect to these legacy systems with a modern
    terminal instead of special ones like syncterm. Though I do appreciate
    the bitmap fonts, I may make a new telnet client that uses sixel to
    render bitmap fonts, like topaz or cp437 in modern terminals, i guess
    i'll announce it here if I remember

    Thanks for all the hints. I also have my own telnet client and library for terminal, which also does the cp437 to utf8 mapping.
    I like it, I love true type fonts on retina screen when I enlarge my nerd font enough.

    It all works fine now both in that client and ansview (I have some errors related to more how ansi escape codes for positioning behave than cp437 mapping now) I hope to fix them soon. Good learning.

    Biggest challenge tho I have now is zmodem implementation so download/upload would be possible via terminal/tui client.

    Fight continues :)

    -h1

    ... Xerox Alto was the thing. Anything after we use is just a mere copy.

    --- Mystic BBS v1.12 A49 2024/05/29 (Linux/64)
    * Origin: 2o fOr beeRS bbS>>20ForBeers.com:1337 (911:1503/0)
  • From dingo@911:1801/0 to hollowone on Fri Oct 31 08:30:19 2025

    hollowone around Thursday, October 30th...
    It all works fine now both in that client and ansview (I have some errors related to more how ansi escape codes for positioning behave than cp437 mapping now) I hope to fix them soon. Good learning.

    Yes this is precisely what I wanted to point out in the 'blessed' library, has this "Sequence-aware" string class, https://blessed.readthedocs.io/en/latest/api/sequences.html

    there is an "iter_parse" that allows you to iterate over an ansi sequence. It's all done by using terminal capability database dynamically on startup, grouped by whether or not they have an affect on horizontal distance
    https://github.com/jquast/blessed/blob/master/blessed/_capabilities.py#L145

    or any that "cause movement", etc.

    Anyway I hope this helps, or if it doesn't, maybe someone out there interested in python might enjoy this library, I have recently added mouse support with a very cool example,

    https://blessed--310.org.readthedocs.build/en/310/mouse.html#report-motion

    I hope somebody will review the pull request soon so that I can merge and release to pypi, it was a heck of a lot of code for supporting "DEC Private Modes", something I think we should all make better use of ..




    --- ENiGMA 1/2 v0.0.14-beta (linux; x64; 22.18.0)
    * Origin: Xibalba -+- xibalba.vip:44510 (911:1801/0)