When working at a normal xterm (not sure about a "real" terminal), when a full-screen program such as man or vim is closed, it disappears, leaving your screen so you can see your prompt, and previous prompts including where you launched the program that closed.

When I am running within GNU Screen, however, when the program is closed it does not clear but is simply shifted up so a prompt can be displayed. To me this is ugly, and I'd like to know if "normal" behaviour can be resumed.

I realise I could manually clear the screen myself but a) I don't want to and b) that would result in a totally clear screen, not what I'm after (though perhaps better, if this is as good as it gets).

2 Answers 2


Some terminals, such as xterm, support what is known as an “alternate screen”: there are separate screens for full-screen programs and for scrolling programs. In xterm, you can switch between the two screens with the “show alternate screen” command at the bottom of the Ctrl+mouse 2 menu.

This behavior is disabled by default in screen but can be enabled with the altscreen option: add altscreen on to your ~/.screenrc.

  • 1
    wow - this makes gnu screen ridiculously more usable...great answer
    – brad
    Sep 23, 2010 at 13:39

This is related to your termcap settings for screen. Maybe you can try starting screen with the -a command line option.

  • Thanks for the pointer, but I can't find any relevant info on how to set termcap to allow this, and -a doesn't help. Aug 29, 2010 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .