0

I know cls and clear exist. But after using these commands I can still scroll up and see my history. I want it to behave like a real reopening of the window.

Any help?

Ozkan
  • 165
  • 2
  • 11

3 Answers3

3

Try reset: this clears the scrollback buffer in the terminal programs I've tried (xfce4-terminal, gnome-terminal and xterm).

Flup
  • 3,601
1

In some terminals (xterm), ctrl-L clears the screen like reset, but faster. However in gnome-terminal ctrl-L behaves like clear.

Since I can't yet comment, just want to point out that Putty provides it's own terminal, unleses you use X11 tunneling.

Edit:

If you wish to clear the scrollback buffer via the command-line, use a previous superuser answer PuTTY: clear scrollback from commandline. This can be aliased as alias reset="clear && printf '\033[3J'".

user19087
  • 541
1

As the other stated, reset should do the trick. However, some terminal emulator (mintty from Cygwin if I'm right) doesn't even clear the scrollback buffer. In this case, they should have an option to do that directly. In mintty there is something like "Clear scrollback" when you do a right click in the window, or open the menu.

piernov
  • 2,046