Re: less, exit but left content on screen
Tong Sun wrote:
> I remember that I used to be able to exit 'less' by command key 'x' or
> something so that the content just viewed is left on screen, instead of
> being cleared and restored to the screen before invoking 'less'. But I
> found there is no such capability in current less (version 394). Or
> is there?
The issue is whether the terminal uses an alternate screen buffer or
not. If the terminal does not then your screen contents always
remain. If so then they still remain, just in the alternate screen
Using the standard xterm the control-middle mouse button will display
many options of which one is "Show Alternate Screen". It is possible
to flip back and forth (inconveniently) to see this manually switch to
the alternate screen buffer.
> I am not sure whether my memory is correct or not, but I think such
> capability, leaving the just viewed content on screen, is desirable in
> certain circumstances. I hope such capability be implemented/put back
> into less.
What you are seeing is not a change to less but a change to your
environment. Less and other screen utilities such as emacs and vi
have always done this if the capability is available. Previously you
were probably using a terminal that did not support an alternate
screen buffer. Since now you are you are seeing the screen buffer
You can disable this feature of the terminal by using the *titeInhibit
One time command line option test invocation:
xterm -xrm "*titeInhibit:true"
Then if that works then you can add that setting to your X environment
resources. Typically it is placed in the ~/.Xresources file which is
normally loaded by your X session manager upon starup. You can also
load this interactively with the following command.
echo "*titeInhibit:true" | xrdb -merge
Note that setting *titeInhibit to true is not the same as running
'less -X'. Using 'less -X' stops less from running all terminal
initialization. Setting titeInhibit stops the terminal from
supporting an alternate screen buffer.
Also, a small suggestion. Please read this following about how to
submit bug reports and to also send a copy to another addresses. Look
for "Sending copies of bug reports to other addresses" which addresses
how to do this such that followups will have the correct bug report
address automatically available for people to followup.
But personally I am not sure how beneficial it is to CC debian-user on
these things. I think I would recommend against doing so in the future.