27
15
When I connect to my server via PuTTY, I can clear the visible screen with the clear
command.
However, I can still scroll backwards in PuTTY's GUI to see the old stuff. I am aware of PuTTY's Clear Scrollback feature, but that requires mouse clicking.
I'd like to perform that exact same "Clear Scrollback" operation, but from the commandline.
Is it possible?
I read this site, which seems to indicate so.
However, my experiments have failed. For instance:
printf '\033[3J'
Does nothing, for me.
I may not be understanding the meaning of CSI 3 J
in that second link, though...
What version of PuTTY are you using? The page indicates the feature works in PuTTY 0.59 and above. I have PuTTY 0.60 and it works for me. Note it only clears the scrollback buffer, it doesn't clear the screen. (If I have a scroll bar I can actually scroll, then use this sequence, I notice the scroll bar become disabled because there's suddenly nothing available to scroll to. But the currently displayed screen remains in place.) – Bavi_H – 2013-02-22T02:56:24.690
@Bavi_H: ah, thank you - I was not realizing that it won't affect the currently displayed text. I see it is working, too. The full solution I want is
clear && printf '\033[3J'
. If you make an answer, I'll accept it. – jwd – 2013-02-22T03:10:19.547