I'm a heavy bash user and konsole is my preferred environment. I know I can use the keyboard command ctrl+shift+x to clear the scrollback buffer, but there's certain points in my scripts where I would like that to occur. How can I clear konsole's scrollback buffer using the command line, bash, or any other shell?
Asked
Active
Viewed 7,263 times
1 Answers
16
-
nice! good find and works perfectly! – Joshua K Oct 24 '09 at 04:32
-
didn't work for me on SUSE in a xterm with bash shell. – djangofan Mar 19 '11 at 20:00
-
4I liked echo -ne "\e[3J" better as it avoids printed line-break. – Patrick B. Mar 22 '12 at 12:01
-
1@PatricB.: true, though in this context, I'm expecting him to incorporate it into a script – retracile Mar 22 '12 at 16:26
-
@PatrickB. Thanks for the reminder on the -n. :) – Joshua K Jan 21 '13 at 20:53
-
Doesn't work on Kubuntu 14.04.02 – Autodidact Apr 10 '15 at 09:04
-
1@SandeepDatta: It works with konsole 4.14.3 on Fedora 20; it doesn't clear the screen--it clears the scrollback buffer. – retracile Apr 10 '15 at 18:36
-
1As an extension to this answer, I aliased this to the clear command (`alias clear="clear && echo -e '\e[3J' && clear"`) so my screen actually clears now. – BrockLee Sep 25 '15 at 15:21