[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Stretch]Typing ""clear" on terminal restricts the scrollback to only a screenful



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Jun 21, 2017 at 09:27:45AM +0530, Avinash Sonawane wrote:
> On Wed, Jun 21, 2017 at 3:26 AM, Larry Dighera <LDighera@att.net> wrote:
> 
> > Try: tput clear
> 
> Right. My bad! I already did that. But I have always considered
> `clear` and `tput clear` to be the same so I didn't mention it before.
> Anyways I got exactly same behavior with `tput clear`.

They do *nearly* the same:

  tomas@rasputin:~$ clear | hexdump -C
  00000000  1b 5b 33 3b 4a 1b 5b 48  1b 5b 32 4a              |.[3;J.[H.[2J|
  0000000c
  tomas@rasputin:~$ tput clear | hexdump -C
  00000000  1b 5b 48 1b 5b 32 4a                              |.[H.[2J|
  00000007

(FWIW: my terminal is a straight xterm, and TERM=xterm).

Mystery? Well, clear's manpage says:

       clear  clears your screen if this is possible, including its
       scrollback buffer (if the extended "E3" capability is defined)
       [...]

so this "ESC[3;J" at the beginning of clear seem to be this magical
scrollback buffer thingy. Too pressed to actually look things up,
though :)

cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAllKJTYACgkQBcgs9XrR2kb5gwCcCkb8iye1W7XvZQV/f/Yel3WT
PXgAn3RZj8lGXq40FsI4dFykeIp8YuWH
=dByB
-----END PGP SIGNATURE-----


Reply to: