MLUG: Re: [MLUG] clearing the screen without losing data
Re: [MLUG] clearing the screen without losing data
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Sat, May 3, 2008 at 1:27 AM, Mike Miller <EMAIL:PROTECTED> wrote:
> in some terminals everything that was on the screen is deleted
> and in others it is just scrolled up so that I can look at it if I want to.

It appears to depend on your $TERM setting.  vt100 will erase.  For example:

export TERM=vt100
seq 1 100
clear

If you scroll back, you won't see the end of the sequence.  In
contrast, xterm will scroll.  For example:

export TERM=xterm
seq 1 100
clear

I would venture the difference is because of the command sent to the terminal.

$ ( TERM=vt100 ; tput clear | od -bcAn )
 033 133 110 033 133 112
 033   [   H 033   [   J
$ ( TERM=xterm ; tput clear | od -bcAn )
 033 133 110 033 133 062 112
 033   [   H 033   [   2   J

To view all the string command variations for clear:

$ find /lib/terminfo/ -type f |
while read name ; do
  echo $name
  TERM=${name##*/}
  tput clear | od -bcAn
done

For more info, man tput and terminfo.

Regards,
- Robert

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members