Problems with Terminals
I just made a change to my
Then I started vi
and noticed a message in reverse video before the
screen cleared and my file was displayed.
It was probably an error message.
, like some other programs, shows errors and then
clears (erases) the screen before you can read them.
Great design, eh?
Here are some workarounds:
When my terminal used to run at a slow data rate (1200 baud or less),
I could usually read an error message before the screen cleared.
In these days of 28,800 bps and above, you can still fake that.
Then set your terminal or communications
package to a slow data rate and log in again.
Now look fast.
Way back, when
ttys were real teletypes (41.2
finding errors was easy: there was no screen to clear; the error was
right there on the paper.
So, if your terminal has a printer, turn it on.
(On DOS, try doing [CTRL]
Re-run your program and read the error on the paper.
If your window or communications program has a "capture to file" function,
turn it on.
Make the error happen.
Turn off the capture function (important!).
Then read the file - you'll probably need to use a program like
to keep the screen-clearing characters stored in the file from erasing
your screen as you read the file!
If you don't have a screen-capture function, but you do have the
use it with the technique in the step above.
If your window has a scroll bar or a "page up" command, try it.
Some screen-clear commands won't clear the scrolling memory.
to grab the standard output and standard error to a file
while you're viewing:
vi foo |& tee saved_stuff
vi foo 2>&1 | tee saved_stuff
Then look at the saved file with a pager program, possibly filtering
it through cat -v
first. (The vmore
was made for just this kind of job.)
Restart the program and get to the point just before the error will happen.
Try to hit
between the time the error is output and the screen clears.
That can be tough to do
over a network
or on a high-speed connection, though, because of the delay between the
time you press the key and the time when all the output finally stops
Temporarily switch (6.10
to a termcap/terminfo
definition that doesn't
have a clear-screen capability.
Two good settings for TERM are dumb
That previous trick will leave your program almost useless, if it runs at all.
If you do a lot of troubleshooting of full-screen programs like vi
or writing startup files such as .exrc
it's worth your time to find a termcap
that has all the capabilities of the usual definition - except that it
won't clear the screen.
(You'll probably want to check the termcap capabilities cl=
, and maybe ti=
Or, for terminfo
, look at clear=
, and maybe smcup=
If you don't know how, read O'Reilly & Associates' termcap & terminfo
lure a UNIX guru from down the hall somewhere.