on quit, 'less' does NOT clear its contents when run in a 'screen' session

6

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

When I quit 'less' in a normal bash, it clears the previous contents displayed by 'less' and shows the bash contents again. This is the defualt behavior and what I desire.

However, when I use 'less' in a 'screen' session (still bash inside the screen session), after quitting it does not erase the contents shown by 'less' and the contents of bash are gone (still having a new bash comand line prompt though).

How can I make it so that less does clear its display after quitting, even though I am using it within a 'screen' session?

user50105

Posted 2010-12-20T02:57:32.903

Reputation:

Question was closed 2012-09-27T12:32:54.053

Answers

6

Try adding this command to your ~/.screenrc file:

altscreen on

You can also do Ctrl-a : altscreen on from within screen to toggle it on or off in the current session.

Make sure your $LESS environment variable does not contain X in its value.

Paused until further notice.

Posted 2010-12-20T02:57:32.903

Reputation: 86 075

Didn't work... uncommenting "altscreen on" did. – cprn – 2014-09-16T12:05:56.560

1

Also check that these work:

$ tput smcup | od -c
$ tput rmcup | od -c

they should print something like:

0000000 033  [  ?  1  0  4  9  h

rather than:

0000000

Mikel

Posted 2010-12-20T02:57:32.903

Reputation: 7 890