🔥

Thread (@thewizardlucas)


What if I told you that your terminal is not "really" a terminal❓ If you are not a hardcore time-traveller, what you use is not really a terminal, in fact, it's a terminal emulator. Terminal emulators are software simulations of “real” terminals.

These emulators provide you with an interface to interact with the Linux TTY driver. The TTY driver is responsible for handling the data to and from programs.
notion image

Each TTY has its own stdin, stdout, and stderr streams connected to it. These are the streams provided to programs for them to read from (stdin) and write to (stdout and stderr).
notion image

Like everything in UNIX, the tty is a file. Each instance of a terminal emulator has a different tty file associated with it. Because each emulator reads from and writes to a different file, you don’t see the output of the programs you run in all the windows you have open.

To find out which tty is associated with a terminal window you can use the tty command.
notion image

When you open a new terminal window, its streams will point to the connected TTY.
notion image