Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 10 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
add comment

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
add comment

Your Answer

 
discard

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.