If TERM is set wrong, you may get gibberish.
If the TERM environment variable is set incorrectly, you may get an error message complaining about a nonexistent terminal type. For example:
% setenv TERM wyse-747 % vi wyse-747: Unknown terminal type Visual needs addressable cursor or upline capability :q
However, it’s more likely that you have used a legitimate terminal type, but one that’s wrong for this terminal. If so, the program will run merrily along, but the terminal will look as if it is possessed. Characters will be garbled. Your cursor may be placed at an odd position.
The thing to do is to remember that the garbled text only affects what you see: the program itself is working fine and should properly interpret what you type. So quit out as you normally would (CTRL-X CTRL-C in Emacs, :q in vi) and then find out what the correct terminal type is from your system administrator (or someone else who knows).
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access