On Fri, Oct 16, 2020 at 09:53:35PM -0400, David Mertz wrote:
On Fri, Oct 16, 2020 at 9:36 PM Steven D'Aprano
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.
I never noticed that, since my "terminal" is `tmux` (running inside a Linux terminal). In that case, `clear` might clear the underlying terminal scrollback buffer, but it does not clear the tmux scrollback buffer. The `screen` terminal multiplexer is similar.
Oh yeah; I forgot about screen and tmux. I just tried it in screen, and `os.system('clear')` does not clear the scrollback used by screen. I think that if we go ahead with this, we shouldn't allow lack of support for screen and/or tmux to stand in the way. A 99% solution is better than a 0% solution :-)
All of which suggests to me that doing the "same thing" in a platform neutral way is not an insignificant effort.
Indeed. -- Steve