When I'm cleaning out a directory, I'm always using ls
to
see what files are there.
When I have a terminal with windows, I can keep an ls
listing in
one window and do cleanup in another.
In a terminal without windows, I use this script named dirtop
.
It clears the screen, puts an ls
listing at the top of the screen,
and sends an
escape sequence (5.8
)
to the terminal that makes the screen top
nonscrolling.
So, as I type my commands, they scroll "underneath" the ls
listing
at the top without disturbing it.
If I use a command like vi
that resets the screen, I just use
dirtop
again when the command is done.
When I'm done, the command dirtop -c
clears the screen and
makes the whole screen scrollable again.

This script works only on VT100-type terminals and compatibles
because the escape sequences are hardcoded into it.
It should probably be rewritten to use termcap
or terminfo
information so
it'd work on more terminals.
Luckily, there are lots of VT100-compatible terminals and communications
programs.