this post was submitted on 09 Dec 2023
145 points (87.2% liked)
Programmer Humor
32831 readers
530 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This is because the "tty" (by which I mean the device named by the output of ´tty´) is only displaying what is sent to it. Be it from the keyboard or pty2.
The fact that the keyboard also fills an input buffer from python has to do with how python and the keyboard are attached to the same input file device which is a separate thing from them having same output file device.
If anything that could output to tty2 could inject inputs to something using tty2 as an input buffer, that would be a security nightmare.
Now, I'll sit back and let Cunningham's law kick in.