Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
up vote 17 down vote accepted

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.

share|improve this answer
wow - this makes gnu screen ridiculously more usable...great answer – brad Sep 23 '10 at 13:39
+100 if I could – David Oneill Nov 16 '10 at 21:21

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

share|improve this answer
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. – tsvallender Aug 29 '10 at 19:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.