Skip to Content
Navigation:

A stick figure smiling

This is a page from an upcoming zine called "The Secret Rules of the Terminal".

To get an email when the zine comes out, sign up for the zine announcements list!

Image of a comic. To read the full HTML alt text, click "read the transcript".
read the transcript!

the TTY driver is the most obscure part of the system

You almost never need to think about it, but when I’ve wanted to do something weird (like put a terminal in a web browser) understanding the driver is SO USEFUL

when you start your terminal emulator, it asks the OS to create a “pseudoterminal pair” which is a pair of two files

terminal emulator <-> TTY <-> TTY driver <-> TTY <-> program

a “TTY” is the program’s side of the pair

programs use it to:

  • communicate with the terminal emulator by reading/writing bytes
  • configure the TTY driver (more on the next page!)

Run tty fo see the current TTY!

the TTY driver is why Ctrl+C does the same thing relatively consistently

program: you press Ctrl+C, I send a signal!
well, unless the program tells me it wants the raw bytes!

some things the TTY driver is in charge of

(you might think “these are unrelated” and you’d be right)

  • storing the terminal window’s size
  • sending a SIGHUP signal when you close your terminal
  • a basic mode for entering text called “canonical mode”
  • pausing the output and confusing you when you press Ctrl+S
  • tracking which process is in the “foreground” and sending what you type there

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2025 | All rights reserved (see the FAQ for notes about licensing)