4 ms·
The TTY Demystified (2008)
- almog 4y agoLinks to previous discussions: https://news.ycombinator.com/item?id=13571055 https://news.ycombinator.com/item?id=13571055 https://news.ycombinator.com/item?id=8094186 https://news.ycombinator.com/item?id=8094186 https://news.ycombinator.com/item?id=26803109 https://news.ycombinator.com/item?id=26803109 https://news.ycombinator.com/item?id=10631513 https://news.ycombinator.com/item?id=10631513 https://news.ycombinator.com/item?id=4062981 https://news.ycombinator.com/item?id=4062981 https://news.ycombinator.com/item?id=4544318 https://news.ycombinator.com/item?id=4544318 https://news.ycombinator.com/item?id=10064657 https://news.ycombinator.com/item?id=10064657 https://news.ycombinator.com/item?id=658155 https://news.ycombinator.com/item?id=658155
- metadat 4y agoMinor sidenote / hopefully welcome feedback: When pasting HN link lists like this, it's extra considerate to include the dates and comment counts, since sometimes stories have little or no discussion. Clicking through the links blindly wastes human time, especially for a longer list such as your post.
- almog 4y ago1. Generally speaking, dates are useful, but this is a link to article from 2008, so I'm not sure if previous submissions dates would be all that useful. 2. All links are to previous _discussions_, none are to discussion-less submissions.
- deleted 4y ago[deleted]
- dang 4y agoThanks! Macroexpanded: The TTY Demystified (2008) - https://news.ycombinator.com/item?id=26803109 https://news.ycombinator.com/item?id=26803109 - April 2021 (35 comments) The TTY demystified (2008) - https://news.ycombinator.com/item?id=17765683 https://news.ycombinator.com/item?id=17765683 - Aug 2018 (12 comments) The TTY demystified (2008) - https://news.ycombinator.com/item?id=13571055 https://news.ycombinator.com/item?id=13571055 - Feb 2017 (43 comments) The TTY demystified - https://news.ycombinator.com/item?id=10631513 https://news.ycombinator.com/item?id=10631513 - Nov 2015 (40 comments) The TTY demystified (2008) - https://news.ycombinator.com/item?id=10064657 https://news.ycombinator.com/item?id=10064657 - Aug 2015 (31 comments) The TTY demystified - https://news.ycombinator.com/item?id=8094186 https://news.ycombinator.com/item?id=8094186 - July 2014 (21 comments) The TTY Demystified - https://news.ycombinator.com/item?id=4544318 https://news.ycombinator.com/item?id=4544318 - Sept 2012 (46 comments) The TTY demystified - https://news.ycombinator.com/item?id=4062981 https://news.ycombinator.com/item?id=4062981 - June 2012 (17 comments) The TTY demystified - https://news.ycombinator.com/item?id=658155 https://news.ycombinator.com/item?id=658155 - June 2009 (13 comments)
- almog 4y agoCool, thank you!
- mwcremer 4y agoProbably lots of other people have suggested this, but in case not: have you considered a “meta-page” that coalesces multiple submissions into one?
- dang 4y agoWhen the various discussions were years apart, like here, I suspect it would elide too much context to coalesce them. But for submissions of the same vintage, it might be a good idea, and in fact not so different than the thread merging we already (but unsystematically) do.
- urda 4y agoKinda neat, thanks.
- westcort 4y agoBasically, the TTY driver keeps track of the foreground process group id, but only in a passive way. A user process can affect the behavior of any TTY device by manipulating the corresponding device file under /dev. For example, a user process can send a signal to the TTY driver, which will then suspend the process. TTY driver keeps track of the size of the connected terminal, but this information has to be updated explicitly, by the terminal emulator or even by the user. The TTY driver is a passive object.
- iforgotpassword 4y agoI've read and re-read about all those many quirks a lot of times over the decades, and some of the things I understand to an extend where I know what the issue is when something breaks... but man, the interactions between tty/pty, terminal (emulator), shell, screen, ssh and locales still sometimes make me want to scream. Nothing better than sshing into a random system and getting a ~ when you hit backspace.
- Shared404 4y ago> Nothing better than sshing into a random system and getting a ~ when you hit backspace. Or having the backspace print as a space, but still being registered as a backspace. That one threw me the first time I ran into that.
- ghostpepper 4y agoI regularly re-read this article myself and refer new Linux devs on our team to it. It's pretty incredible that the system of PID/SID/PGID has survived under the hood of Linux (and Unix) for this many decades.
- abnercoimbre 4y agoAnd I'm guessing you could say we're too entrenched to change it?
- simplicio 4y agoI used to think the unix way of doing this was overly baroque, till I had to figure out how a terminal emulator worked in Windows, which requires an actual instance of the windows default terminal program (con.exe I think?) be drawn on the screen. So if you want to grab the IO from a terminal program (say to make your own terminal emulator), the standard solution is to draw a windows terminal off the boundry of your monitor somewhere and scrape the text out and send it to your program.* *(I think this situation has improved somewhat in recent years with Windows Console?, but I haven't had a chance to play with that yet).
- enriquto 4y agoAs a venerable software philosopher said, That the concept of 'pty' still exists in the year 2009 is quite fucking amazing. I'm surprised we don't carry punchcards around anymore. --uriel You are missed, Uriel. The world needs you now more than ever.
- GekkePrutser 4y agoPunch holes were used in the Netherlands for a long time on bank transfer cards :) they'd be sent to "Postgiro" subscribers well into the 2000s. Kinda cool because I never experienced the punch card era. I expect most of us here didn't. PS who is Uriel? I only joined here a year or so ago and didn't hear of them before.
- GekkePrutser 4y agoSIGSTOP and SIGCONT are also really useful with GUI apps. I use them when I want to pause a major app like Firefox but don't want to sleep the entire machine.
- executesorder66 4y agoWhat use case do you have for pausing Firefox?
- GekkePrutser 4y agoMinimising power usage while keeping the system as a whole running. "Light sleep mode" as it were.
- brainwipe 4y agoFor anyone new to the topic; don't panic at the size of the vertical scrollbar in the article - the majority of it is comments! The article itself is succinct and not a huge read.