techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.7K
active users

#dos2ansi

0 posts0 participants0 posts today

You might think rendering #MSDOS #ANSIart on a modern #Windows is just fine because it still supports the old codepages, including #cp437. Well, sort of.

Some escape sequences are interpreted differently than ANSI.SYS did. In the worst case, you'll just see garbage. Most files are "sane" enough though, but even then, the default colors are "just wrong"...

#dos2ansi takes advantage of the 256color support available since Windows 10 to mimic the original #VGA palette. It also renders to a virtual canvas first, exactly emulating ANSI.SYS, and then uses a safe subset of ANSI for actual output. And it can read and display #SAUCE metadata. 😎

Of course it also works on #Linux, #FreeBSD, etc.

zirias.github.io/dos2ansi/

Continued thread

Also quite recent: #dos2ansi. This is a very versatile converter for #MSDOS #ansiart (and other "text") files to a format using #Unicode and only standard #ANSI #SGR escape sequences, so, suitable for today's terminals like #xterm. It includes an ansiart viewer which is "just" a shellscript, leveraging dos2ansi, xterm, less and some nice original #IBM fonts to do its job. So, maybe something for the #retrocomputing fans.

github.com/Zirias/dos2ansi

Docs (manpages) are here:
zirias.github.io/dos2ansi/

As there was *some* interest, a #FreeBSD port is available: freshports.org/converters/dos2

Replied in thread

@dani Haha 😎

I'm running a (heavily configured) here. This screenshot was just for demonstration that and don't depend on any configuration, so this was a completely unconfigured X session in , which by default runs .

You can even see the test mode in can only use 8 colors (because this is what the default xterm entry announces), still the windows launched by have full color support, they explicitly set the terminal name to "xterm-256colors".

Not having added anything to for a while now, I'd say v2.0 is the "final" version for now. I initially wanted that for v1.0, and it's amazing how many weird files, edge cases, and also ideas for improvements you can discover for something that "simple" 🙈

I have ideas for future development, like provide the core functionalities as a shared library, like add some config file for dos2ansi itself as well (instead of just for ), maybe even more ... but all of that can wait, it's IMHO "complete" as it is.

A package is attached to the release on github, and a port is added ... anyone wants to help make it available in more repositories? 😎 Would be most helpful if the fonts it uses by default are packaged as well and can be set as dependencies ...
repology.org/project/dos2ansi/

Continued thread

Released: v2.0
github.com/Zirias/dos2ansi/rel

The real "visible change" is documentation. now got a manpage as well, and the one for improved a lot. Also better build instructions and some updates/corrections in the README. With these docs, you can hopefully make it do exactly what you want 😉

Also, the build system (my own homebrewn framework) got lots of improvements and fixes.
github.com/Zirias/zimk/

Continued thread

I'm planning to create a release v2.0 soon, which will have more or less the feature set of v1.8, but with complete and helpful documentation for everything. Main work left to do for that is to add more text to the manpages 😉

At least, the tool I wrote for generating docs now has everything I'll need for that!

github.com/Zirias/mkclidoc

Simple documentation generator for CLI utilities. Contribute to Zirias/mkclidoc development by creating an account on GitHub.
GitHubGitHub - Zirias/mkclidoc: Simple documentation generator for CLI utilitiesSimple documentation generator for CLI utilities. Contribute to Zirias/mkclidoc development by creating an account on GitHub.
Continued thread

And now, my little documentation generation tool can also produce manpages in format (this will be useful for the version of ) 😎

Using simple/minimal semantic markup, the "manpage style" is entirely left to

Screenshots:
- Desktop unstyled
- Desktop bright mode
- Desktop dark mode
- Mobile dark mode

Continued thread

Now working on adding a manpage for as well. I noticed I need to add features to my "mkclidoc" tool in order to get something meaningful here ...

First step, added support for cross-references 😎 -- next thing needed will be documenting related files...

Next release will probably just be nice and complete documentation!

Continued thread

v1.8 released!
github.com/Zirias/dos2ansi/rel

There's some major rework inside adding support for seekable streams, which was necessary to implement the logic detecting even when the preceding DOS EOF character is missing.

Quite some improvements to the script as well, now comes with "fontsets" (explained in the comments in these and the config file) 😎

Plus added a manpage. Wanted a single source of truth (shared with the help output) and didn't find a good tool for that, so I quickly came up with my own:
github.com/Zirias/mkclidoc
It's bundled with dos2ansi now. Can produce man in both classic troff and BSD mandoc. The default choice is based on `uname` for now, tested on and .

Continued thread

I just released v1.7, which includes one final bugfix: Quoted output of metadata should use proper "shell-style" quoting, so it can be directly consumed by , which it does now. Plus got a (tiny) bit of optimization.

github.com/Zirias/dos2ansi/rel

Well, just after releasing, I found more stuff to tackle. No, not new bugs at least.

But more weirdly broken ANSIart files. Example:
16colo.rs/pack/root0297/FU-B%2

This one *has* SAUCE metadata, but it's not properly "hidden" behind a DOS EOF character (0x1a), which means even 'type' on a real DOS machine will output the SAUCE gibberish below the pic 🙈

So, there *might* be a v1.8 adding more heuristics to detect and parse more broken SAUCE ... 😂

Continued thread

Yet another revision, v1.6.3
github.com/Zirias/dos2ansi/rel

--- brings yet another subtle bugfix in : To set the title with an escape sequence, it uses "printf %b" with its \-notation for control characters, so literal backslashes in the title must be escaped as well 🙈

Apart from that, added nice "portability bikeshed":

- Removed the dependency on 'sed' again, quoting/escaping strings for 'eval' *can* be done in pure script.

- Added proper detection of the POSIX shell to my build system, along with variables to override the choice. Used that to generate the shebang for . Really an awesome way to write /bin/sh without writing /bin/sh 😂 (rumors say there *are* POSIX systems with the compliant shell in a different path ...)

Screenshot: Yet another file with "weird" title from

Continued thread

And now there's even v1.6.2: github.com/Zirias/dos2ansi/rel

The good thing is: The issues I'm fixing here are getting more and more obscure 😂

First I noticed doesn't accept all for its '-title' option, no matter what. But it *does* support the escape sequence to set a title, so, why not use this instead.

Having added support for that (and also optionally for setting the window size using an escape sequence), I had a look at quoting again. Indeed, failed for e.g. file names containing special characters.

Therefore added a *safe* quote function. The downside is, it requires now. Well ....

Screenshot shows both improvements, I picked a "maximum weird" file name and used a file that has an 'ö' in its title 🥳 -- in the showansi debugging output, you can see the quoting in action 🤯

Continued thread

v1.6.1 (a pure bugfix/service release):
github.com/Zirias/dos2ansi/rel

* Fix possible crash (🙈) when querying for font or codepage on a file with a non-text type.
* Try to parse something meaningful even out of partially broken SAUCE data

Yep, the possible crash was the reason to create a release even for a pretty "small" bugfix. 🙄 Chances are nobody would have noticed though, the SAUCE *display* was not affected, only the machine-readable query (-q).

Screenshot: The "offending" file. It even had literal ",1" written in the month field of the SAUCE date, but obviously meaning January here 😂

Continued thread

Just noticed the script from is now "smarter" than the renderer on 16colo.rs 😂

When there's no () metadata indicating the font to use, but the canvas after rendering turns out to be exactly 80x50 or 80x43, it just *guesses* that's most likely the VGA50 or EGA43 mode and picks that font 😉

(Of course, this "smartness" can be disabled with the "-S" flag)

Compare to this: 16colo.rs/pack/avpack16/frg-an

Continued thread

v1.6:
github.com/Zirias/dos2ansi/rel

* Fix cursor movement again, it never wraps or scrolls.
* Many smaller improvements to the script
* Add an example configuration using scalable fonts from int10h.org/oldschool-pc-fonts/ instead of the default bitmap fonts

Scalable fonts are a tradeoff here. You get freely configurable sizes and correction of aspect ratio. You lose pixel-perfect (perfectly sharp) display. You can't have both, unfortunately.

Screenshot shows scalable fonts 😉