I have recently started using screen in order to be able to split my terminal vertically and horizontally. However, it does not clear the terminal automatically. For example, when I open a file using vim and then I close it, the screen fills the terminal with the content of file. Is there a way to fix it and make it like normal Terminal?
- 187
- 2
- 9
4 Answers
You're probably thinking of the alternate screen feature, which allows full-screen applications such as htop to display in a different view, and on completion returning to the normal view (without the application showing). That is the altscreen setting in your .screenrc, described in the manual:
Command:
altscreenstateIf set to on, "alternate screen" support is enabled in virtual terminals, just like in xterm. Initial setting is
‘off’.
- 75,040
- 9
- 171
- 268
-
It works. There wasn't any `.screenrc` file at the beginning; I created one and put the `altscreen on` in it. – orezvani May 12 '16 at 23:45
In the terminal type
clear
That should do the trick
- 497
- 4
- 15
-
`clear` will clean the screen, but I want the output of previous commands to be there. Let's say I run `htop` and close it, I want the output to be cleaned. – orezvani May 12 '16 at 08:33
Normally screen command help to keep our session live irrespective whether you have closed the putty or remote session from your workstation. we can again resume to same screen anytime if we have not detached screen (Ctrl + A and Ctrl + D ).
are you using screen in any script?