0

I'm trying to understand basic "behind-the-scenes" Shell stuff without actually deep-diving into computer history.

For example, I'm trying to understand the difference between a CLI shell, a terminal emulator, and pseudo-tty.

Here's how I currently understand it.

  • terminal (tty) is a text display from the olden days that you interact with via a keyboard
  • pseudo-tty is anything that emulates a terminal
  • Terminal Emulator (e.g. iTerm, Terminal on macOS) emulates a terminal within some displaying system
  • Shell is a program that lets you interact with the OS via commands or scripts (and usually runs in a Terminal Emulator)

As you can see, I'm pretty rocky on the definition of pseudo-tty. Can anyone shed a light on these concepts in an ELI5 manner?

edit: I read this (https://unix.stackexchange.com/a/4132/332070) but I'm still very confused about pseudo-TTYs.

0

"Pseudo-tty" just means "a tty device that's not actually associated with a physical port". These days, that's just about the only sort of "terminal device" to which things are connected, now that we're no longer using modems, teletypes, or serial terminals. When you open a command line using xterm, gnome-terminal, etc, you're connected to a pseudo-tty.

If you have code or an application that it talking to a pseudo-tty device, it can make termios calls to control various aspects of the device (like parity generation/checking, carriage return/newline mapping, handling of certain control characters, etc).

LWN has an article that goes into more detail.

The remainder of your definitions seem spot-on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.