Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In contrast to this question I want the clearing of the screen re-enabled for less. It works fine in my xterm terminal under Cygwin/mintty or Gnome Terminal (both xterms).

However, when inside a screen session, the clearing of the screen is somehow disabled. I tried several things, like

screen -T xterm

or putting the autonuke statement in my ~/.screenrc. Also, inside the screen session

export TERM=xterm
tset

has no effect. So, now I'm out of ideas. Any help appreciated.

share|improve this question
    
hmm, i'm seeing the same thing, on Cygwin/mintty, Debian/putty, Ubuntu/putty. in putty i use putty as the TERM instead of xterm but that's the only real difference. –  quack quixote May 5 '10 at 8:21

1 Answer 1

up vote 7 down vote accepted

You probably want to avoid screen -T or resetting TERM away from its default value while inside screen sessions (it should probably be screen or at least something that starts with screen).

Try putting the following line in your .screenrc:

altscreen on

To activate it on a per-session basis, you can do Control+a:altscreen onReturn.

My manpage says:

altscreen on|off

If set to on, "alternate screen" support is enabled in virtual termi- nals, just like in xterm. Initial setting is `off'.

BTW, I have explained the root cause of the “screen clearing” (actually alternate/normal screen swapping) in another answer. It is possible that your screen terminfo entry is missing smcup/rmcup or that your screen does not support alternate screens. Both of those seem less likely that altscreen being off.

share|improve this answer
    
Cool, that did it. Thanks a lot! –  Boldewyn May 5 '10 at 10:07
    
i read your alt-screen explanation a few days ago and figured it was related. thanks for the excellent writeups -- i'm putting this in my .screenrc right now. –  quack quixote May 5 '10 at 10:08
    
I'm using Mac and I don't have an altscreen command. Any other way of doing this? –  Dana Jun 30 '11 at 17:22
1  
@Dana: What version of screen (screen --version)? It seems that altscreen has been around since screen 3.9.13. Based on opensource.apple.com, it seems like the Apple-bundled version of screen has been newer than 3.9.13 since 10.3. Just as a reminder, it is not a regular “shell command”, but a command that is specific to screen; it must be entered at the screen “colon prompt” (Control+a, then :altscreen on, then Return). –  Chris Johnsen Jun 30 '11 at 22:54

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.