On Sat, 17 Oct 2020 at 03:37, Steven D'Aprano <st...@pearwood.info> wrote: > > On Fri, Oct 16, 2020 at 11:30:56PM +0200, Marco Sulla wrote: > > > Well, in terminals like bash, `clear` does not really delete the > > previous input. It simply move the scroll so the first line of the > > input is the current input. > > That's not actually correct: in bash, `clear` actually deletes the > scrollback buffer too. > > In modern Linuxes, `clear` takes an option `-x` which suppresses that > behaviour. Perhaps you have an alias? > > alias clear='clear -x'
Well, this is interesting. From `man clear`: clear clears your screen if this is possible, including its scrollback buffer (if the extended “E3” capability is defined). -x do not attempt to clear the terminal's scrollback buffer using the extended “E3” capability. So probably I always used pseudoterminal without E3 capability. I think that in this case `clear` simply writes N enter chars, until the terminal is "cleared". IMHO this is the safest option. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/M6XXYVQAQNTHFT7F33452P6E62CO5GAM/ Code of Conduct: http://python.org/psf/codeofconduct/