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.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
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.
In some terminals (xterm), ctrl-L clears the screen like
reset, but faster. However in gnome-terminal ctrl-L behaves like
Since I can't yet comment, just want to point out that Putty provides it's own terminal, unleses you use X11 tunneling.
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'".