EtchedPixels / EmulatorKit

A collection of emulators mostly of retrobrew style systems
GNU General Public License v3.0
142 stars 41 forks source link

rc2014: convert del to backspace when reading tty #10

Closed kolontsov closed 1 year ago

kolontsov commented 4 years ago

To work with CP/M out-of-the-box it worth to convert modern 0x7F (DEL) to Backspace automatically. Will it break something?

(may it would be better to move tty read/write and char translation to some common file?)

EtchedPixels commented 4 years ago

I really don't want to do remapping. What configuration do you see this problem. I've not noticed it with the CP/M I'm running or ROMWBW ?

kolontsov commented 4 years ago

First I noticed it in macOS 10.15 with RomWBW 2.9.2-pre.21 (by the way, emulator works just fine, thanks a lot!). On Mac, "backspace" key (that one above Enter) generates 0x7f, and both built-in Terminal.app and popular iTerm2.app see it as ASCII DEL (^?, 0x7f). Both terminal apps have an option to automatically convert DEL to BS (^H, 0x8), but this option is turned off by default. If I turn it on, CP/M gets ^H and behaves as expected: removes character on the left.

I also checked Ubuntu 18 (on ThinkPad x220), gnome-terminal also see 0x7f when I press "Backspace", and it also has an option to choose what Backspace generates (in "Compatibility" section) - so it can be switched to ^H. But it's not default, again.

(may be it just need to be mentioned in README. Or may be I don't understand something)