Concept

Terminal Emulator

Definition

A terminal emulator is a graphical program that simulates a serial hardware terminal of the 1970s and 80s — the DEC VT100 in particular — inside a window on a modern desktop. It renders a grid of cells, interprets the escape sequences a program writes to its standard output, sends keystrokes back as the program reads from standard input, and connects both directions to a child process, usually a shell, through a pseudo-terminal device pair.

The category includes the venerable xterm on Linux, GNOME Terminal and Konsole on Linux desktops, the macOS-native Terminal.app and iTerm2, the cross-platform Alacritty, Kitty, and WezTerm, and Windows Terminal on Microsoft platforms. They differ in features — tabs, true colour, GPU acceleration, ligatures — but they all implement the same fundamental contract.

Why it matters

How it works

When the emulator launches, it opens a pseudo-terminal pair — a master end the emulator reads and writes, and a slave end the child shell sees as its controlling terminal. The shell starts up believing it is connected to a VT100; it reads keystrokes from the slave end and writes output back through the same channel. The emulator reads the bytes the shell produces, interprets any embedded escape sequences (move cursor, change colour, clear screen, set window title), and updates its grid of cells accordingly. The rendering layer then paints the grid to the window using the chosen font and colour scheme.

Keyboard input flows in the reverse direction. A keystroke in the window is translated into the byte sequence the VT100 protocol expects — printable characters as themselves, arrow keys as escape sequences, modifiers encoded into specific patterns — and written to the master end of the pty. The shell reads those bytes from the slave end exactly as if a human were typing into a real serial terminal. This abstraction is why a shell over SSH, inside tmux, inside xterm still works: every layer simply implements the same VT100 contract, and the layers compose transparently.

Where it goes next

Continue exploring

Tags