this post was submitted on 09 Dec 2023
145 points (87.2% liked)

Programmer Humor

32000 readers
936 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 9 months ago

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.