![]() |
|||||||||||||||||||||||||||
|
This page was last modified: July 27 2006 16:21:06 | ||||||||||||||||||||||||||
Terminal emulationThe first time I stumbled over the expression "Terminal emulator" was when I configured Vim. I couldn't get syntax highlighting to work, and it turned out that the solution was to change the terminal emulator to "vt100". But it is never enough for me just to know how things are done... I also want to know why they are done and how they work. So I asked these questions:
What exactly is a terminal emulator? The definition of a terminal emulator is related to old style computing, where the big computer was in a room somewhere and everyone used "dumb terminals" to access it. A dumb terminal was basically a screen and a keyboard. So a terminal emulator is basically a program that runs on your computer and emulates the behavior of a dumb terminal, or perhaps several varieties of terminals. What does it do? The terminals used in the old days operated by some electronics that "spoke" a particular language for controlling them. Each terminal manufacturer - in fact, each model of terminal - had its own language. Some terminals were smarter than others, with screens that could do all sorts of things. The smartest terminal of all in those days was DEC's VT100, whose language came to be something of a standard. So when you use your PC to connect to your server and interact with it, the "language" they speak to each other depends on which emulator is used. The language dictates what groups of characters will...
What difference does it make which one I use? The instructions that you give the server via the PC can only work if they are written in a "language" that both your PC and server can understand. Because the terminal emulator is making your PC act like a terminal that is under the control of the server, that language is called your terminal type, or terminal emulation. Say your PC tells the server to speak "vt100". Then, the server will send you vt100 control sequences. If your PC does speak vt100, things will happen properly on your screen. If your PC doesn't, you won't know what are regular text characters and what are control sequences, so you will end up seeing them all on the screen, as if they were text, resulting in pure and utter garbage. In my case the terminal type was set to "xterm" and since it obviously does not understand color, my settings for syntax highlighting in Vim, didn't work. I only got black and white, bold text and underline. Changing it to vt100 which understands color, fixed the problem. How do I tell my server which terminal emulator to use? Just open the shell profile that belongs to the user. If you want to change the terminal for user bill, just go to bill's homedirectory and open his shell profile. Since I use bash I open .profile and change the terminal.:
cd /usr/home/bill The file may look like this.:
1 # $FreeBSD: src/share/skel/dot.profile,v 1.19.2.2 2002/07/13 16:29:10 mp Exp $ Note the bolded text in the above. This is the line where the terminal emulator is set. In this example it is set to vt100. |
|||||||||||||||||||||||||||