Using screen, commands like less and man don't clear the screen afterwards
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.