>_How the Terminal Works · Lesson 1 of 7

Terminal vs Shell — Two Different Programs

People say 'the terminal' for the whole experience, but it's two programs: the terminal draws the window, and the shell interprets your commands. Untangling them explains most terminal mysteries.

The terminal emulator (Windows Terminal, iTerm2, GNOME Terminal) is a graphics program: it draws text, handles fonts and colors, turns your keystrokes into bytes. The shell (bash, zsh, PowerShell) is a text program running inside it: it reads a line like 'ls -l', finds and runs the program, and hands the output bytes back to the terminal to draw. Either can be swapped out independently — same terminal can run bash or zsh; same shell runs in any terminal.

Text
you press 'l', 's', Enter
   |
   v
terminal emulator     "I turn keys into bytes and bytes
   |                   into pixels. I don't know what ls is."
   v
shell (bash/zsh)      "ls? Let me find that program,
   |                   run it, and give you its output."
   v
the ls program        does the actual work, prints results
   |
   v  (bytes flow back up the same path)
pixels on your screen

Why 'emulator'? Real terminals were hardware — a VT100 was a screen and keyboard wired to a distant computer, speaking a byte protocol over a serial cable. The hardware died; the byte protocol survived. Modern terminal windows emulate those devices so faithfully that 1978 software still runs — and that same protocol is why SSH-ing to a server feels identical to a local window.

◆ Note
Naming the layers: console ≈ terminal (historical hardware term), shell = the command interpreter, command line = the interface style, TTY = 'teletype', the kernel's name for a terminal connection — visible in commands like tty and ps.