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

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

  • 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. May 5 '10 at 8:21

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.

  • 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
  • 2
    @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). Jun 30 '11 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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