41.9 Commands to Adjust Your TerminalMost terminals and window systems read every character that the host computer sends to them. They're watching for an escape sequence , a series of characters that give commands to the terminal or window. (From now on, I'll just say "terminal." But this article applies to windows, too.) When the terminal sees an escape sequence, it performs the command instead of showing you the characters.
You can send these escape sequences yourself, from your UNIX account.
For instance, maybe some program has accidentally left your terminal set to
reverse video.
If you're using an ANSI terminal (like a VT100) you could
type an
echo
command (8.6
)
to send the sequence
These escape sequences should be documented in your terminal's manual. In this article, I'll use sequences for a VT102 or compatible terminal. If you're trying to make your setup more general so that it works on lots of terminals, you should use a command like tput or tcap (41.10 ) that reads your terminal's terminfo or termcap information. For example, you might decide that it's easier to read a complicated display when it's in reverse video. To put it in reverse video and go back to normal video later: % Most full-screen programs (vi , etc.) re-initialize your terminal. That can undo some of what these commands do.
To write the script, make a file named for one of the aliases, like
Clear
.
The first line of the script stores an ESC character in a
shell variable (6.8
)
named e
.
It's used in all the other aliases as
You can install this script from the CD-ROM or from the online archive (52.7 ) . If you don't get the file from the disc, be careful to type those escape sequences exactly. The Graphics command uses the digit 0, not the letter O. The ToStatus and ClrStatus commands use the digit 1 (one), not the letter l (L). If you get the script from the archive, ask tar to install Clear and its eight other links: %
The script
tests the name it was called with (44.22
)
,
in - based on a suggestion and aliases by Bruce Barnett |
|