Terminal Support

There are lots of different display devices in the world—terminals, PCs, graphics workstations, and so on. Emacs is capable of running on all but the “dumbest” of them, but whether it actually does or not depends on a couple of features of UNIX.

The first of these is called an environment variable. When you log onto a UNIX system, several of these variables are set up for you. They have values, usually character strings, that the UNIX shell keeps around and passes to each command you invoke as an indication of various features of your computing environment.

By convention, environment variables are named in all capital letters. Typical ones include PATH, which tells UNIX which directories to look for commands in, and SHELL, whose value is the name of the shell you are using. We are concerned with the environment variable TERM, which tells UNIX and certain programs (such as Emacs) which kind of terminal you are using.

TERM is usually set when you log on, either by some systemwide shell initialization file or by your own .profile file (.login for C shell users). On some systems, you may even be prompted for your terminal type when you log on. To check the value of TERM, type echo $TERM at the UNIX prompt; the dollar sign means “value of.” To set it, type TERM=termname (for Bourne, Korn, or bash shell; note the lack of spaces on either side of the equal sign) or setenv TERM termname (for C shell). If you don’t know what your terminal type is, try asking your system ...

Get Learning GNU Emacs, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.