Preferences

Even after reading this, TTYs will surprise you. I've done my share of TTY programming in Linux and here be dragons.

From modes to tty types to control chars and signals, the TTY system is itself a bloated relic whose stink becomes apparent when you try to connect it to the rest of the unix philosophy, where everything is supposed to be a stateless text stream.

This stuff is really interesting for historical reasons and made sense 20 years ago, but I long for the day where the TTY system is gone and character drivers work on some standard JSON stream or something.


ibisum
meh. TTY programming was hard in the 90's, and then it was done. If you find it hard now, you're probably still just learning all about it. Its an old, well and truly solved problem. The slayers of yesterdays TTY dragons are todays WebSocket hackers, I surmise.

Still, I think the TTY - and UARTS in general - have a lot of utility in this day and age, warty dragons and all. I've got a terminal server in my lab just for the case of wiring up the small, light, cheap, efficient embedded systems which still depend on the dragons to deliver the fire. Nothing quite like having a functional 9600-baud term you can tap into with an Oscilloscope and work out what the bits mean .. try doing that with a JSON-based interface. ;)

LukeShu
I disagree, it is still hard: https://bugs.freedesktop.org/show_bug.cgi?id=70290

Further, there are still things for which there is not a right way to do it. If you look at the man page for "unbuffer" (part of expect), there's a "CAVEATS" section that describes a bug... that can't be fixed while PTYs are in their current state. I wouldn't call it "well and truly solved".

I think you misspelled "40 years ago".

By 1994, GUIs were common on workstations, and hardware-based serial terminals were disappearing fast. OTOH, the command line as a UI paradigm is alive and well today and might well be around for another 20 or 40 years.

While getting deep into the TTY system might be hard in most cases the defaults of programs nowadays work quite well. And there is nothing easier and simper than opening a Minicom or Screen to interact with your embedded device. Besides being a much more low level interface it also shows you the shutdown and boot process where your ssh connection is not available. It's a really handy tool, although it might be annoying from time to time.

This item has no comments currently.