A terminal emulator is a program that pretends to be a hardware video display terminal. In the 1970s and early 1980s, a programmer at a Unix system sat in front of a physical device such as the DEC VT100: a box with a keyboard and a cathode-ray-tube screen, connected over a serial line to a host computer. That hardware knew how to draw characters, move the cursor, and clear regions of the screen when the host sent it specific byte sequences. A terminal emulator reproduces that behavior in software, so a window on a modern graphical desktop or a remote login session behaves, byte for byte, like one of those original terminals.
The behavior being emulated is defined by two overlapping bodies of work. The DEC VT100 User Guide (EK-VT100-UG-003, Digital Equipment Corporation, third edition June 1981) documents the specific escape sequences the VT100 recognized, including cursor positioning, scrolling regions, and character attributes. Those sequences were themselves an implementation of the control-function framework standardized as ECMA-48, “Control functions for coded character sets” (Ecma International), which corresponds to ISO/IEC 6429 and the earlier ANSI X3.64. An emulator that claims VT100 compatibility is asserting that it parses and acts on this vocabulary of escape sequences the same way the original hardware did.
Because so much software was written assuming a VT100-class terminal, the VT100 became a de facto target. Emulators identify the terminal type they present through the TERM environment variable and the terminfo or termcap databases, commonly advertising values such as “vt100” or the superset “xterm”. When a program wants to move the cursor or set a color, it does not talk to the emulator with a special API; it writes ordinary bytes to its standard output, and the emulator interprets any embedded escape sequences while displaying the rest as text.
Terminal emulators sit on top of the operating system’s terminal device abstraction rather than replacing it. On Unix-like systems the emulator opens a pseudo-terminal (a pty), connects the shell to one end, and reads and writes the other end itself. From the shell’s point of view it is attached to a normal terminal device with a line discipline; from the user’s point of view the emulator is just a window. This separation is what lets the same shell run identically under a graphical emulator, a serial console, or a remote SSH session.
The emulator also handles the reverse direction: keystrokes. When a user presses an arrow key or a function key, the emulator sends the corresponding escape sequence back to the program, again following the conventions established by hardware terminals and the ANSI control-sequence standard. This bidirectional fidelity is why decades-old programs still run unmodified in today’s terminal windows, and why utilities like GNU Screen and tmux can multiplex several emulated terminals through a single real one.