A Mystery of Unix History
changelog.complete.org
changelog.complete.org
The control-S/control-Q flow control only worked on UNIX in "line mode", which also did backspace and such. VI turned that off and ran in raw mode. Before BSD, UNIX mostly ran in line mode. The TCP/IP implementation we used, a heavily modified 3COM UNET, predated BSD networking. It normally ran in "line mode", and when running VI remotely, VI switched the pseudo-terminal to "raw mode", which caused the Telnet connection to send the options DON'T ECHO[2] and DO SUPPRESS GO AHEAD.[3] The connection was now transparent to special characters. This was necessary on the rather laggy links of the time. Exiting VI restored line mode.
If VI crashed, or you killed it, or, when job control came in, you switched tasks, you were stuck in raw mode, and had to reset the terminal session by typing "stty saneLF". You actually had to type LF, because CR->LF translation was suppressed in that mode.
BSD didn't bother with this, and ran terminals in remote echo mode all the time, which required lower lag connections. Berkeley was mostly IP over Ethernet at the time, without much long-haul, so that worked for them.
[1] http://xahlee.info/kbd/iold51593/SAIL_keyboard_96232.jpg [2] https://tools.ietf.org/html/rfc857 [3] https://tools.ietf.org/html/rfc858
It's worth noting that at Sail, the Meta and Control keys simply sent extra "bucky" bits on top of the 7-bit character code, resulting in a 9-bit input. And the actual ESC key was intercepted by the Waits for special commands from the user, and was never delivered to user-land programs (ESC-H tells the OS to hide your screen from others; ESC-I asks the OS to send an interrupt signal to your program; etc). The octal location 033, where ESC lives in Ascii, was instead used for the character "not-equals" on Sail; similarly, most of the other locations in the range 001-037 were used for other special characters that aren't in Ascii, and all were typically generated with a Top key-combination press. The whole notion of Control automatically stripping off the high-order bits of a character was foreign.
of course this predates the invention of hex, or at least the modern conventional notation for it
One thing I've noticed in going over the early Unix versions is that the Bell Labs people didn't care for VT100s at all and Research Unix has practically no support for video terminals. They probably didn't jump straight from the Teletype to the Blit, but their software sure did. On the other hand, BSD took full advantage of the ADM-3A from day one, and termcap/curses expanded to support each of the VT series as they were released.
Man I forgot about all this terminal wrangling stuff. Thanks for the memories!
...is still in my memory.
to be clear, this means ctrl-j. I still have to use it very occasionally.
Actually, an LF before `stty sane` is advisable too.
There are arrow keys printed on HJKL (accessed via control), escape is left of Q, control is left of A, and colon has a dedicated key rather than being shift+semicolon.
Another tidbit is that the home key is also used for tilde, which explains its association with the home directory.
1: https://en.wikipedia.org/wiki/ADM-3A#/media/File:KB_Terminal...
Well, it's :* and ;+ and so on, along with the now-unusual shifted number row: a bit-paired keyboard¹, matching ASCII, which was the practical thing to do when your terminal was hard-wired.
Huh? AFAIU, all the historical source code uses tabs for indentation. Both K&R and BSD style uses hard tabs, as does Linux kernel style and most older GNU project code for that matter. Various Unix programs assume tabs, for example indentation elision in shell heredoc syntax ("<<-") only works for tabs.
Soft tabs (spaces) has been a relatively new thing in the C/Unix world. You may not notice it because, working as well as they do, hard tabs magically indent according to your local preference, so hard tabs aren't noticeable.[1]
[1] What doesn't work is right-hand alignment. That's most noticeable in modern BSD code, where the style is to tab-align variable types and names into different columns. If your tab stop isn't set to 8 (the required tab stop), they don't line up. Most hard tabbers don't mix indentation and alignment, anymore.
EDIT: Here's the earliest source code for vi I could quickly find: https://github.com/n-t-roff/ex-2.2/blob/220a2cfa/ex.c It uses hard tabs. It's also still using pre-ANSI function syntax, suggesting this code wasn't cleaned up before committing to Git.
I seem to have made assumptions due to only running into spaces in "old" places such as Python, Vim, Emacs, etc. To be fair, this all happened well before I was born. Why would software developers of all people try to do away with a useful abstraction?!
Oddly, the linked keyboard doesn't appear to have a tab key but the Vi source code you found contains them? Am I missing something obvious?
(`/* Copyright (c) 1979 Regents of the University of California */`, that's some impressively old code to find on GitHub.)
Re BSD: Yeah, tabs don't work for alignment almost by definition. I'm surprised anyone was crazy enough to author a code style that called for it.
I think the other thing that got in the way of standardising on TAB was that 8 character indent is too much, but once you let people configure it it's no longer consistent between systems.
> that's some impressively old code to find on GitHub
You may like https://github.com/chrislgarry/Apollo-11
Python is about 30 years old. Started by Guido van Rossum in December 1989.
Python is older than HTTP, older than the Web.
It's older than most programming languages still in common use today (TIOBE).
I think most people would think of Python as "old" if they thought about its history. Its current cool factor in AI and employment makes it seem newer than it is.
Vi has the insert-mode commands for indenting (Ctrl-T) and unindenting (Ctrl-D) the current line. If you're used to them, you don't really need Tab except for aligning things within the line. Also, Tab is Ctrl-I.
Also note it was viewed as a weird choice to omit the key at the time. Televideo, a competitor, called it out in their ads: https://imgur.com/a/u7KHRjQ
Somewhat interesting that Apple recently took away, then gave back the ESC key on their pro laptops.
This is a feature of some game engines which allow people to use arbitrary keys (or combinations) as modifier keys. Which allow for less motion of the hand over the keyboard, by simply being able to hit the same keys (with some modifiers) quickly.
Also while on the subject 8 key rollover, which is pretty common, is probably more than enough.
This photo seems to corroborate that: https://external-preview.redd.it/SiLVPTrm_c8MfLplX48AxZySG5x...
It's shown clearly in the document the article (indirectly) points to: https://vt100.net/docs/vt100-ug/chapter1.html
Around 84 we started evaluating a purchase of hundreds of terminals for the university, and eventually settled on the Wyse WY-75, mostly because it was ANSI/VT-100 compatible and had an escape key.
DEC didn't care, because they didn't use the ESC key in VMS.
Anecdotal, but I use Ctrl-[ in vi all the time. More comfortable the escape key in my experience. I've tried jj and jk, but I inevitably end up on a system without my .exrc or init.vim at some point, and struggle. Ctrl-[ has the benefit of working everywhere.
http://www.bitsavers.org/pdf/dec/terminal/vt220/EK-VT220-TM-...
One of the nice things about RS232 is that it was specified that you could scrunch up the individual wires of the cable and it wouldn't damage the interface circuitry (good for crappy solderers like me) and you could hot plug and unplug it. Oh, all right, TWO of the nice things :-)
As other comments note, they were developed on earlier models or non-Dec terminals.
Also Emacs was not developed on Unix. The first Unix Emacs was created by James Gosling of Java fame.
You also have resources like The Unix Heritage Society [2], who show a timeline of historic events on their wiki [3].
I bought Brian Kernighan's memoir [4], which so far is an incredibly detailed and personal account of his time at BTL.
[1] http://catb.org/~esr/writings/taoup/html/
[3] https://wiki.tuhs.org/doku.php?id=events:start
[4] https://www.amazon.com/UNIX-History-Memoir-Brian-Kernighan/d...
On page 161 the author mentions in passing that Eric Schmidt had been working on BerkNet. THE Eric Schmidt. The Google Eric Schmidt.
Earlier the book mentions that Bill Joy was able to hire a developer with money they got from DARPA. That developer was Michael Toy and later Sam Leffler. There's a movie called Code Rush about the open-sourcing of Netscape's source code in 1998 (which begat Mozilla and Firefox) and Michael Toy was the project lead for the open source effort back then. Sam Leffler later developed TIFF.
The Unix-Haters Handbook (1994) has a lot of history and takes you back in time..
http://gen.lib.rus.ec/search.php?req=unix+haters+handbook
Brian Kernighan 'interviews' Ken Thompson (2019) - Ken telling stories. They're both very funny, a very entertaining video, some stories I (and even Brian) hadn't heard.
https://www.youtube.com/watch?v=EY6q5dv_B-o
UNIX: Making Computers Easier To Use (1982)
https://www.youtube.com/watch?v=XvDZLjaCJuw
Also the other day I read in the AWK book that it was mainly inspired by SNOBOL4, so looked at some SNOBOL4 books from archive.org, from 1970-2 and just before, slightly earlier than Unix history takes you back. One tells you how to organize your punch cards to feed in the program.. Another had a bibliography with many dozens of SNOBOL books. It was widely used by people in the humanities apparently; like AWK it was at home dealing with words and text.
What?
https://en.wikipedia.org/wiki/VT100#/media/File:DEC_VT100_te...
https://groups.google.com/forum/#!topic/comp.terminals/a73kE...