
Terminal Emulator and TTY: Identity of the Black Screen
iTerm2 is not a real terminal. It's an Emulator. From Teletype (TTY) relics to PTY.

iTerm2 is not a real terminal. It's an Emulator. From Teletype (TTY) relics to PTY.
Why does my server crash? OS's desperate struggle to manage limited memory. War against Fragmentation.

Two ways to escape a maze. Spread out wide (BFS) or dig deep (DFS)? Who finds the shortest path?

Fast by name. Partitioning around a Pivot. Why is it the standard library choice despite O(N²) worst case?

Establishing TCP connection is expensive. Reuse it for multiple requests.

When I first started coding on my MacBook, I installed something called iTerm2. A black window with green text. I'd type commands and things would happen. People called it a "terminal."
But it felt weird. Why are we using this retro-looking interface in 2025? Why text when we have GUI? And occasionally I'd see paths like /dev/tty or /dev/pts/3. What were those?
Even more confusing: people used "terminal," "console," and "shell" interchangeably. Nobody explained the difference.
So I dug in. I had to figure out what this black screen really was.
At first I thought it'd be simple. "Terminal = black screen." But the more I researched, the more terms kept popping up:
I had no idea what was what. Then I stumbled upon a StackOverflow comment:
"You're not using a terminal. You're using a terminal emulator. Real terminals were hardware."
Emulator? So iTerm2 was simulating something?
That's when it clicked. This was about history.
In the 1960s, computers were room-sized with no monitors. Instead, people used Teletypewriters (TTY)—machines that looked like typewriters. You'd type on them, and characters would travel through wires to a distant mainframe. The computer would send responses back, and the TTY would print them on paper.
The typewriter was the terminal.By the 1970s, physical terminals like the VT100 replaced paper with CRT monitors. Still hardware, but now characters appeared on a screen. These terminals understood ANSI escape codes—special character sequences. For example, \033[31m would turn text red.
# ANSI escape code examples
echo -e "\033[31mRed text\033[0m"
echo -e "\033[1;32mBold green\033[0m"
echo -e "\033[4;34mUnderlined blue\033[0m"
Run this in your terminal and colors change. Why? Because 1970s VT100 terminals were designed that way. And programs like iTerm2, Windows Terminal, and Alacritty all simulate VT100 behavior in software. That's why they're called Terminal Emulators.
Suddenly everything made sense. iTerm2 on my MacBook was simulating 1970s hardware. Like playing Super Mario on a Nintendo emulator, I was recreating a 50-year-old typewriter experience.
In Linux, typing tty gives you something like this:
$ tty
/dev/pts/3
What is /dev/pts/3? It's a PTY (Pseudo-Terminal) device file. Linux treats everything as files, including terminals.
/dev/tty: Points to the terminal connected to the current process (like a symlink)/dev/pts/N: Pseudo-terminals created in GUI environments/dev/ttyN: Physical consoles or serial ports (like the text console you get with Ctrl+Alt+F2)When you launch a terminal emulator in a GUI (macOS, Windows, GNOME), this happens:
Metaphor: The emulator is a "switchboard operator," the shell is a "customer service agent." When you speak, the operator relays it to the agent. When the agent responds, the operator relays it back. PTY is the phone line connecting them.
The stty command configures terminal behavior:
# View current terminal settings
$ stty -a
# Hide password input (disable echo)
$ stty -echo
$ read password
$ stty echo
# Check terminal size
$ stty size
50 180
These settings date back to hardware terminal days. For example, the erase setting defines what character the backspace key sends—because old terminals sent either ^H or ^? depending on the model.
The tty command tells you which terminal device your process is connected to:
# In iTerm2
$ tty
/dev/pts/3
# In a different tab
$ tty
/dev/pts/4
# In a cron job or non-interactive script
$ tty
not a tty
This reveals whether you're in an interactive terminal session or running in the background.
When using SSH, you might see the -t option:
ssh -t user@server sudo vim /etc/hosts
The -t flag means "force PTY allocation." Why?
Some programs (vim, sudo, top) require an interactive terminal to work properly. Without a PTY, they'll error out with "stdin is not a tty."
Instead of opening multiple terminal windows, you can manage multiple sessions within one terminal using a terminal multiplexer like tmux or screen.
# Start tmux
$ tmux
# Create new window: Ctrl+b c
# Switch windows: Ctrl+b 0, Ctrl+b 1
# Split horizontally: Ctrl+b %
# Split vertically: Ctrl+b "
# Detach session (background): Ctrl+b d
# Reattach later
$ tmux attach
Metaphor: If your terminal emulator is a "house," tmux creates "rooms" inside it. You can move between rooms without leaving the house.
The killer feature: sessions survive SSH disconnections. If you're running a long task on a remote server and WiFi drops, just reconnect and type tmux attach—your work is still there.
Now we can clearly distinguish these three:
/dev/console.Metaphor: Terminal is the "telephone," shell is the "person you're talking to," console is the "office main line."
In recent years, terminal emulators have evolved dramatically. They've gone from simulating 50-year-old typewriters to incorporating GPU acceleration and AI features.
Traditional terminal emulators (iTerm2, GNOME Terminal) render text with the CPU. Scrolling through massive logs can lag.
Alacritty and Kitty use OpenGL for GPU rendering. The result? Blazing speed. Tens of thousands of log lines scroll smoothly.
Warp embeds AI directly into the terminal. Ask in natural language and it generates commands. Say "find files larger than 5MB" and it produces find . -size +5M.
Warp also treats command input as blocks. You can edit commands like in vim, and each command's output is neatly boxed.
For decades, Windows had terrible terminals. cmd.exe felt like MS-DOS even in 2025. Then in 2019, Microsoft released Windows Terminal as open source.
Windows users can now have an iTerm2-level experience.
The most surprising part of studying terminal history? The 50-year-old design is still relevant.
GUIs are intuitive and pretty. But for managing remote servers, writing scripts, or chaining complex commands, nothing beats text streams. You can't click your way to "find files modified last week, larger than 10MB, containing TODO comments." But in a terminal, it's one line:
find . -mtime -7 -size +10M -type f -exec grep -l "TODO" {} \;
That's why we still use black screens. Whether it's a Rust-based GPU-accelerated terminal or an AI-powered futuristic one, they're all emulating 1960s teletypes.
Technology advances, but fundamentals endure. Text as an interface. Files as abstraction. Pipes for composition. That's why they're still the best tools we have.