Why 'GNU less' clears the screen in Konsole after quiting and how to change it?

When I use the less utility in a virtual console (by pressing Ctrl-Alt-F2 ) and exit from less the text remains there to see it. So if for example I want to see the arguments of a command I exit from the manpage in a specific line and this text will remain on screen while I am writing my command. But if I am on KDE Konsole then when I press the ‘q’ command to quit the screen clears the text from the manpage or any other text that is viewed with less. I was wondering if there is any configuration file or something to change in order to alleviate the problem.

Thanks in advance…

It isn’t just Konsole. The same thing happens with xterm, and probably with other terminal emulators.

My understanding, which could be wrong, is that “less” switches to a different screen buffer on entry, and switches back to the standard buffer on exit. This ability is built into the terminal emulation. I’m not sure to what extent it depends on the Xwindows backend.

If you do this in your konsole window:


TERM=vt100
export TERM

then the screen will no longer clear. That’s because the terminal capability table for “vt100” does not have that buffer switching ability, while the table for “xterm” does.

In konsole settings, the “Input” tab, you can select between “xfree” emulation, “linux console” emulation and “solaris console” emulation. Perhaps that also changes how “less” behaves (not tested).

Use “more” instead of “less” and set the PAGER environment variable to “more” if you’re going to need it with other commands.

On 09/21/12 08:26, please try again pecked at the keyboard and wrote:
> Use “more” instead of “less” and set the PAGER environment variable to
> “more” if you’re going to need it with other commands.
>
>
Or just highlight the text you want to copy, press <Ctrl>c and then use
<Ctrl>v to copy to where the cursor is.

Ken

On 09/21/2012 03:14 PM, Ken Schneider wrote:

> Or just highlight the text you want to copy, press <Ctrl>c and then use
> <Ctrl>v to copy to where the cursor is.

or just pop open Konqueror and type #[manpage name]

and, then you don’t have to use less to scroll, and Konqueror gives you
links to the referenced man pages and lets you easily copy paste and and
and and you can grab a corner and make the window the size you want and
and and

and, imo it is the best man reader made, and FAR superior to

man [something] | less

but, ymmv


dd