Monday 4 June 2018

Using screen, commands like less and man don't clear the screen afterwards


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.



Answer



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.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...