CP437 Support in unix now lives reddit / bbs ---------------------------------------------------------------------- denzuko · 2021-10-02 23:16 Thanks to a post by kernelgeek. I've found [https://github.com/keaston/cp437](https://github.com/keaston/cp437) which translates cp437 into vt100 codes. This makes cu(1), uucp(1), and every standard unix scripting tool in existence actually viable for bbsing without bulky minicom or other full ncurses base tools. ---------------------------------------------------------------------- denzuko · 2021-10-02 23:33 ## example configs for uucp/cu(1): ## /etc/uucp/sys: system sdf address sdf.org time any port TELNET protocol t system voidbbs address voidbbs.com time any port TELNET protocol t system agency address agency.bbs.nz time any port TELNET protocol t system hackthegibson address e2ro3ow3awo7r2favn24n65ycc2qmzkoayn5r57e3f56nvjwdcgg32ad.onion time anyport SSH-VIA-TOR protocol i ## /etc/uucp/port: port TELNET type tcp service 23 port SSH type pipe command /usr/bin/ssh -a -x -q reliable true protocol etyig port SSH-VIA-TOR type pipe command /usr/bin/torsock /usr/bin/ssh -a -x -q reliable true protocol etyig ## ~/.bash_aliases: # use "^a:zmodem catch" for xmodem-downloads # more at https://gist.github.com/Sulter/d2ce41ca2dc5f59738d80c728f6b669e # or for true unix/suckless fair; # rz|socat - `FILE:/dev/`tty`,b115200,raw # sz |socat `FILE:/dev/`tty`,b115200,raw - alias agencybbs='screen cp437 cu agency' alias voidbbs='screen cp437 cu voidbbs' alias sdf='screen cp437 cu sdf' alias xmcore='screen cp437 cu hackthegibson' ---------------------------------------------------------------------- gnu2tux · 2021-10-03 00:16 So would this mean that I can use my old IBM XT to telnet to my raspberry pi, run screen (or ideally tmux) and get it to display chars properly? I tried using cp437 for this but I didn't get anywhere with it, seemed to make no difference, tmux still outputted utf8 and so I got a lot of gibberish on my display. Perhaps I'm doing it wrong?! ---------------------------------------------------------------------- denzuko · 2021-10-03 00:54 The issue there is tmux is borked for this kind of stuff. \`screen(1)\` has the right support. Plus if one wants to use \[xyz\]modem. tmux will never work, the devs have outright stated they will not turn off stdio capture which would also hinder \`cp437(1)\`. I know; it was a frustration for me as well. But yes with the UUCP configs I highlighed one can use your old 8bitty and 16bitty to connect to a unix server or more importantly have your unix/linux workstation connect to your 8bitty/16bitty running a BBS, MUD, etc. If one is using their 8bitty/16bitty as the client side with MS-DOS then yeah one could do a null modem to the RPi and then connect out using the screen+cp437+cu(1) combo or try something like Telix or MS- DOS Kermit 3.15 as the client to be more period accurate. ---------------------------------------------------------------------- jcs · 2021-10-03 01:47 Except the font still won't look right for ANSI art, in which case you probably just want a TrueType/BDF version of the DOS 437 font so your regular Terminal can use it. https://github.com/jcs/ansiterm ---------------------------------------------------------------------- denzuko · 2021-10-03 01:52 Nice option. personally not using xorg or osx so your font solution wouldn't fit some use cases. Plus can confirm it does work for ANSI art: [https://imgur.com/gallery/eKTaYlA](https://imgur.com/gallery/eKTaYlA) ---------------------------------------------------------------------- jcs · 2021-10-03 01:54 That does not look correct at all... ---------------------------------------------------------------------- denzuko · 2021-10-03 01:57 Way better than without cp437(1). https://imgur.com/gallery/fzlWBgb ---------------------------------------------------------------------- gnu2tux · 2021-10-03 03:47 Very cool. Any reason why you are using cu/uucp? Couldn't one just use telnet, eg: screen cp437 telnet bbsname If it's necessary to use cu, I've not really dabbled with that old stuff before, it seems pretty rudimentary stuff. I note that pressing backspace doesn't work, you can type Ctrl+Bkspace and it will work though, how does one re-map backspace and potentially other keys to behave properly? ---------------------------------------------------------------------- denzuko · 2021-10-03 04:13 telnet might work but I'm using UUCP since I have a small cluster of pdp's running bsd in the museum, plus a few IoT sites that bandwidth is a premium. So cu(1) makes scripting dead simple. One can pipe with cu/uucp telnet does not last time I checked. Sure netcat/socat also works with pipes and I'll bet most would use that but hey we're working with old tech because we like it not because its mainstream. Plus, with uucp one gets autologin, AT command support, mesh routing and a bunch of other really cool stuff. Also in this year, 2021, UUCP uses are growing, especially for telecommunications in the HF band, for example, for communities in the Amazon rainforest for email exchange, data transfer, and other uses Now the backspace thing is dead easy; put \`stty erase \^?\` or \`stty erase \^h\` in your bashrc and it should work. stty(1)'s job is just that change settings for your current tty (e.g. keyboard and console). It came about because of version differences between vt100, vt200, and IBM teletype terminals. [https://tldp.org/HOWTO/Keyboard-and-Console- HOWTO-5.html](https://tldp.org/HOWTO/Keyboard-and-Console- HOWTO-5.html) Other little 'tricks' to help fix one's console with stty can be found in: [https://www.peachpit.com/articles/article.aspx?p=659655&seqNum=13](ht tps://www.peachpit.com/articles/article.aspx?p=659655&seqNum=13) ---------------------------------------------------------------------- gnu2tux · 2021-10-03 07:03 Awesome! Thanks! I got carried away with all of this and realised the application of cp437 is for modern terminal emulation software, not for real old hardware which has cp437 bios. It would appear that screen does not have any ability to push cp437 chars as far as my tests have shown... So my quest to be able to use a multiplexer from my old PC still continues... 😢 ---------------------------------------------------------------------- [deleted] · 2021-10-03 14:31 [deleted] ---------------------------------------------------------------------- denzuko · 2021-10-03 14:34 I'm in the same boat for PETSII support with iconv(1)/dd(1) or something like cp437. ---------------------------------------------------------------------- denzuko · 2021-10-03 15:06 yeah [SDF.org](https://sdf.org/?tutorials/uucp) is still running it and in 2019 a guy was trying to reboot a small network. https://boingboing.net/2019/03/25/tilde-servers-r-us.html IMHO, there's still a good usage for both uucp and fidonet style filebones/echonets. Especially with [lora](https://github.com/jgoerzen /lorapipe/blob/master/doc/lorapipe.1.md), satellite, IoT, or anything where IP is overkill or being reinvented as extra overhead for some message queue protocol. ---------------------------------------------------------------------- ILikeBumblebees · 2021-10-03 20:03 > Thanks to a post by kernelgeek. I've found https://github.com/keaston/cp437 which translates cp437 into vt100 codes. CP437 is a character encoding, and VT100 is a protocol for terminal control codes. They're different sorts of things. This program translates CP437-encoded text into UTF-8 by mapping the upper half of the character set, containing the extended characters, to the Unicode code points for equivalent characters. ---------------------------------------------------------------------- ILikeBumblebees · 2021-10-03 20:05 > Perhaps I'm doing it wrong?! You've got it the wrong way around. This tool translates CP437 output to UTF-8, so you can use older software and text files, with CP437 encoding, on modern systems that display UTF-8. It doesn't go in the other direction. ---------------------------------------------------------------------- ILikeBumblebees · 2021-10-03 20:07 > Except the font still won't look right for ANSI art It will if you use the right font, like [one of these](https://int10h.org/oldschool-pc-fonts/). I use Verite 9x16 Regular as my standard terminal font -- it renders ANSI art perfectly at the character level, although everything looks a little vertically condensed due to not using the exact VGA aspect ratio. But there are aspect-correct fonts in there as well. ---------------------------------------------------------------------- ILikeBumblebees · 2021-10-03 20:09 Yes, the previous screenshot gets the glyphs right, while this one doesn't, but they both have very badly broken spacing. ---------------------------------------------------------------------- denzuko · 2021-10-03 20:14 I look at cros terminal and termux for the spacing issue not screen, cu, or cp437 which is what's been demo in the screenshots. ---------------------------------------------------------------------- gnu2tux · 2021-10-03 20:54 Yep, I'm doing it wrong! I need something to display cp437 on a real cp437 machine. The problem is that the data coming from the BBS *is* cp437, the telnet client *is* cp437, the only thing that is not cp437 is screen ! ---------------------------------------------------------------------- wndrbr3d · 2021-10-03 23:57 We've performed a similar translation on [MBBSEmu](https://www.mbbsemu.com/) to allow Major BBS game ANSI to work on the local/terminal console when in VT100 mode. We set the console mode to VT100 + Unicode and we manually mapped the ASCII characters to their Unicode counterparts. [https://github.com/mbbsemu/MBBSEmu/blob/master/MBBSEmu/Session/LocalC onsole/LocalConsoleSession.cs#L30](https://github.com/mbbsemu/MBBSEmu/ blob/master/MBBSEmu/Session/LocalConsole/LocalConsoleSession.cs#L30) ---------------------------------------------------------------------- [deleted] · 2021-10-04 01:53 [deleted]