logoalt Hacker News

jimmaswellyesterday at 5:34 PM0 repliesview on HN

> We have a couple of real VT320s.

That's awesome, I have one too and I fell in love with it. I fixed up the old gif320 program to run properly on modern machines a while ago and made a C# port too:

https://github.com/ldyeax/gif320

https://github.com/ldyeax/Gif320Sharp/

How do you deal with modern programs not respecting TERM/LANG capabilities? I found even using man pages on my machine would sometimes result in the terminal getting caught up on some invalid byte sequence emitted from some unicode that snuck its way through or such.

I ended up writing a program I called VT320 Translator, or vt320t for the name of the binary, which in broad strokes runs your target program in a background terminal and sends curated updates to the VT320 while passing through keyboard input. (You can kind of approximate this with just screen and some other things but it doesn't end up being very good IME) This lets me do some neat things like translate unicode characters into DRCS (Dynamically Redefined Character Set) sequences that you can actually see on the VT320, use optimized heuristics for screen updates tuned to the exact hardware, etc.

At the core is a vtparse-based VT320 emulator that strives to be as accurate as possible with an accompanying diff generator from one emulator state to another. If you're interested I could get into more of what I've done here and even get the code onto my github - it's been private for a while because it's being used in an upcoming game demo but I could easily separate out the non-game-related parts that make up vt320t.