If TERM is not set, programs may not run.

If your TERM environment variable is not defined, then programs have no way to know how to move the cursor or output text at the top of a screen. If you try running Emacs without TERM defined, you’ll see something like this:

% emacs
Please set the environment variable TERM; see tset(1).

Emacs won’t run at all without TERM defined.

vi, on the other hand, will run, but you sort of wish it hadn’t.

% vi
Visual needs addressable cursor or upline capability
:

vi cannot run without knowing how to move the cursor. So its response is to put you in its underlying editor, ex. Most people don’t know ex, or don’t know that they know it; vi users may recognize it as the “colon prompt” at the bottom of a vi window and realize that they can exit by typing q and Return.

Get WYNTK: UNIX System Admininistrator now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.