Email or username:

Password:

Forgot your password?
Top-level
Gomijacogeo

@b0rk @njvack Then X11 came along and we needed a tty-like abstraction to attach these newfangled terminal windows to processes, because all the I/O and job control was wired to talk to a tty-shaped device. And some new side channels were added (e.g. SIGWINCH). So there are a ton of ioctls() to talk to the driver and control/interrogate exactly what kind of tty it really is.

3 comments
Gomijacogeo

@b0rk @njvack Oh yeah, you also needed ptys for telnet/rlogin/ssh-like services. And the tty driver was already hellishly complex even before GUIs entered the picture. Tons of respect to anyone who unpeels the onion in the modern era - so many moving parts.

Gomijacogeo

@b0rk @njvack One other thing that was an A-ha! moment for me back in the day was learning that stty uses an ioctl() to determine the tty behind stdin, so you can redirect from another tty (assuming you have permission) to see its settings. So, assuming /dev/ttys000 is a different window, I can 'stty -a < /dev/ttys000' and see how the flags change between cat, bash, and vim for example.

Go Up