6
5
I would like to issue a command from a bash script to clear the terminal it is running from:
- I don't want to clear the bash history (history -c)
- I don't want to issue the clear command (which moves the terminal down to the last prompt, giving the impression the terminal has been cleared, but previous output remains visible if you scroll up)
- I want to completely remove all previous output to my terminal and have it clean as if I was opening a new one
Thanks.
This is just a simple reset. Reset doesn't clear scrollback. – Let_Me_Be – 2011-02-01T13:16:47.307
@Let_Me_Be: I never experienced that it didn't. Tried just now -- works fine in xterm, rxvt and gnome-terminal. – maxelost – 2011-02-01T13:42:09.940
printf '\033c' works like a charm. Thanks a lot. – Max – 2011-02-02T07:56:13.053