4

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?

orezvani
  • 187
  • 2
  • 9

4 Answers4

4

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: altscreen state

If set to on, "alternate screen" support is enabled in virtual terminals, just like in xterm. Initial setting is ‘off’.

Thomas Dickey
  • 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
1

In the terminal type

clear

That should do the trick

Three Diag
  • 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
1

Ctrl+L over the dirty screen

Anthon
  • 78,313
  • 42
  • 165
  • 222
Sild
  • 315
  • 2
  • 12
-2

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?

GAD3R
  • 63,407
  • 31
  • 131
  • 192
Ops
  • 21
  • 2