TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The TTY demystified (2008)

243 pointsby Ivoahover 8 years ago

9 comments

CaliforniaKarlover 8 years ago
One of the most important commands I learned was &quot;reset&quot;, especially when I was working with <i>anything</i> that would want to do something special. From the man page:<p>&quot;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.&quot;<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.
评论 #13571510 未加载
评论 #13574740 未加载
CJeffersonover 8 years ago
This isn&#x27;t entirely relevant to the article, but I hope some shell&#x2F;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&#x27;s stdout&#x2F;stderr out to a seperate window, including (if I stored it) all it&#x27;s previous output, and redraw the current terminal removing that program&#x27;s output.<p>I&#x27;ve always been tempted to do something like this, and I&#x27;m curious if there is any massive reasons it&#x27;s simply not possible.
评论 #13572123 未加载
评论 #13573540 未加载
评论 #13572011 未加载
评论 #13572119 未加载
skissaneover 8 years ago
&gt; Beware, though: What you are about to see is not particularly elegant. In fact, the TTY subsystem — while quite functional from a user&#x27;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?
评论 #13571992 未加载
评论 #13571877 未加载
评论 #13572942 未加载
snhorneover 8 years ago
If you&#x27;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:&#x2F;&#x2F;www.rubyletter.com&#x2F;newsletter&#x2F;2017&#x2F;02&#x2F;03&#x2F;terminal.html" rel="nofollow">http:&#x2F;&#x2F;www.rubyletter.com&#x2F;newsletter&#x2F;2017&#x2F;02&#x2F;03&#x2F;terminal.htm...</a>
ZenoArrowover 8 years ago
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:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=TTY%20demystified&amp;sort=byDate&amp;dateRange=all&amp;type=all&amp;storyText=false&amp;prefix=false&amp;page=0" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=TTY%20demystified&amp;sort=byDate&amp;...</a>
评论 #13573782 未加载
ape4over 8 years ago
Should add &quot;(2008)&quot; to this.
评论 #13571813 未加载
laumarsover 8 years ago
Thanks for the submission, I&#x27;ve missed this previous times it has been posted.<p>I&#x27;m currently in the process of writing my own shell so if anyone has any other good resources you&#x27;d recommend then I&#x27;d be hugely grateful :) (the simpler the better too hehehe)
评论 #13578439 未加载
评论 #13571622 未加载
tejasmanoharover 8 years ago
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. :-)
birchbover 8 years ago
ASCII was invented in 1963, so the author&#x27;s statement that Telex was ASCII-based is probably wrong. Is the rest of the article also as inaccurate?
评论 #13572053 未加载