One of the most important commands I learned was "reset", especially when I was working with <i>anything</i> that would want to do something special. From the man page:<p>"When invoked as reset, tset sets cooked and echo modes, turns off and raw modes, turns on newline translation and resets any unset characters to their default values before doing the terminal described above. This is useful after a program dies a terminal in an abnormal state."<p>Except, it is also useful when you exit something like a Serial-Over-LAN session, after watching the BIOS do inappropriate things to your terminal window.
This isn't entirely relevant to the article, but I hope some shell/TTY expert might read this, and know the answer :)<p>Hypothetically, could a TTY, in combination with the help of a shell, be able to separate the stdin, stdout and stderr of every running program? By default the shell could do what we normally see, but then easily (with some kind of GUI control) let me pull a particular program's stdout/stderr out to a seperate window, including (if I stored it) all it's previous output, and redraw the current terminal removing that program's output.<p>I've always been tempted to do something like this, and I'm curious if there is any massive reasons it's simply not possible.
> Beware, though: What you are about to see is not particularly elegant. In fact, the TTY subsystem — while quite functional from a user's point of view — is a twisty little mess of special cases.<p>I wonder if it is about time someone tried to build something more elegant. If someone was inventing something like the TTY subsystem from scratch today, with no requirements for backward compatibility, what would they do differently?
If you're interested in the history surrounding the TTY, I just published a newsletter about it on Friday which you can read (without signing up for anything) here: <a href="http://www.rubyletter.com/newsletter/2017/02/03/terminal.html" rel="nofollow">http://www.rubyletter.com/newsletter/2017/02/03/terminal.htm...</a>
This one is a bit of a classic, for the last 8 years (apart from in 2015) it has been on HN at least once a year:<p><a href="https://hn.algolia.com/?query=TTY%20demystified&sort=byDate&dateRange=all&type=all&storyText=false&prefix=false&page=0" rel="nofollow">https://hn.algolia.com/?query=TTY%20demystified&sort=byDate&...</a>
Thanks for the submission, I've missed this previous times it has been posted.<p>I'm currently in the process of writing my own shell so if anyone has any other good resources you'd recommend then I'd be hugely grateful :) (the simpler the better too hehehe)
I stumbled across this a few months ago while implementing basic TTY resizing and ended up learning way more than I needed to. Super impressive, thorough article. :-)
ASCII was invented in 1963, so the author's statement that Telex was ASCII-based is probably wrong. Is the rest of the article also as inaccurate?