2
The default behavior for 'less' is to clear the screen after quitting. This behavior stopped when I started using:
export TERM=xterm
Now 'less' leaves the last page I viewed on the screen, and I want to re-enable the default behavior of clearing the screen.
Googling this problem I found that people use the following command in their ~/.screenrc
:
altscreen on
I'm not sure if this is a mac-issue but I don't have this command available.
I'm using bash shell on Mac terminal and I have no $LESS
environment variable defined.
1This isn't a duplicate. The other question explicitly asks about the problem inside GNU
screen
. This one has nothing to do withscreen
, as evidenced by, "I don't have [altscreen
] available" and "I'm using bash shell on Mac terminal." – peth – 2011-06-30T19:02:16.827What happens when you call
– peth – 2011-06-30T19:11:39.477less
like:less -+F -+X <file>
? If that changes the behavior, your less is configured to behave that way somewhere in you system configuration. If not, it's likely that your terminal doesn't support the alternate screen feature or doesn't have it enabled. You'd need the reverse of http://superuser.com/questions/136162/how-can-i-still-see-the-man-text-after-i-quit-man/136205#136205 or get a terminal that has the alternate screen feature.@peth: This really isn't a duplicate question. As for your question, no matter how I play with the command line options, the last page always remains on the screen. I don't think this has something to do with the less configuration since this only started happening after I defined
export TERM=xterm
. Thanks for your help! – Dana – 2011-07-01T16:02:06.920