Results 1 to 5 of 5

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

  1. #1

    Default 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...
    Last edited by Leonardo12; 21-Sep-2012 at 04:21. Reason: Correct a word

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,498
    Blog Entries
    3

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

    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:
    Code:
    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).
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  3. #3

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

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

  4. #4

    Default Re: Why 'GNU less' clears the screen in Konsole after quiting andhow to change it?

    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

  5. #5
    dd@home.dk NNTP User

    Default Re: Why 'GNU less' clears the screen in Konsole after quiting andhow to change it?

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •