how to stop less clear on exit - Linux

This is a discussion on how to stop less clear on exit - Linux ; I have not been able to figure out how to stop less (and man) from clearing the screen on exit. I am using putty comming in via ssh. from a windows pc. Related, problem is how to get man pages ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: how to stop less clear on exit

  1. how to stop less clear on exit

    I have not been able to figure out how to stop less (and man)
    from clearing the screen on exit. I am using putty comming
    in via ssh. from a windows pc.

    Related, problem is how to get man pages to format
    correctly, I have all these A (with a tilde or hat or something)
    which I think should be bullets, but can't tell. Any suggestions?

    thanks
    eric



  2. Re: how to stop less clear on exit

    Eric Taylor writes:

    > I have not been able to figure out how to stop less (and man)
    > from clearing the screen on exit. I am using putty comming
    > in via ssh. from a windows pc.


    The terminal type emulated by putty, and whatever the term setting on your
    remote shell is, needs to have the switch (to an alternate screen)
    capability. The screen is not cleared on exit from less et al, but those
    utilities simply switch to the alternate screen, print to it, and switch
    back to the original.

    > Related, problem is how to get man pages to format correctly, I have all
    > these A (with a tilde or hat or something) which I think should be
    > bullets, but can't tell. Any suggestions?


    Your lang encoding, your term encoding and the man file must all agree, or
    you may have problems like that.

    -- HASM

  3. Re: how to stop less clear on exit

    Great, i found a setting to stop switching to alternate screen
    which fixed the first problem. thanks.

    Also fixed the other problem with export JLESSCHARSET=latin1
    thanks


    HASM wrote:

    > Eric Taylor writes:
    >
    > > I have not been able to figure out how to stop less (and man)
    > > from clearing the screen on exit. I am using putty comming
    > > in via ssh. from a windows pc.

    >
    > The terminal type emulated by putty, and whatever the term setting on your
    > remote shell is, needs to have the switch (to an alternate screen)
    > capability. The screen is not cleared on exit from less et al, but those
    > utilities simply switch to the alternate screen, print to it, and switch
    > back to the original.
    >
    > > Related, problem is how to get man pages to format correctly, I have all
    > > these A (with a tilde or hat or something) which I think should be
    > > bullets, but can't tell. Any suggestions?

    >
    > Your lang encoding, your term encoding and the man file must all agree, or
    > you may have problems like that.
    >
    > -- HASM



  4. Re: how to stop less clear on exit

    HASM wrote:
    > capability. The screen is not cleared on exit from less et al, but those
    > utilities simply switch to the alternate screen, print to it, and switch
    > back to the original.
    >

    Huh, I'll have to look out for that. I had a problem once and I was sure that
    "less" was clearing the screen, but "more" wasn't. However I have just tested
    and they are both working fine.

    I have discovered this though:

    "more" exits cleanly, whilst less stops with a horrible "EOF", and you have to
    press a key to exit.

    I was thinking of removing the "more" package from my system, and replacing it
    with a symlink to "less". Unfortunately, "more" is part of a suite at the
    moment, so I need to do some repackaging.

    Hey there are some clearscreen options for less. I haven't read through this
    lot, or done any further testing, but maybe there is an enviromental or
    something setting the switches.

    Regards,

    Mark.

    --
    Mark Hobley
    393 Quinton Road West
    QUINTON
    Birmingham
    B32 1QE

    Telephone: (0121) 247 1596
    International: 0044 121 247 1596

    Email: markhobley at hotpop dot donottypethisbit com

    http://markhobley.yi.org/


  5. Re: how to stop less clear on exit

    After takin' a swig o' grog, Mark Hobley belched out this bit o' wisdom:

    > I have discovered this though:


    less has more

  6. Re: how to stop less clear on exit

    markhobley@hotpop.deletethisbit.com (Mark Hobley) writes:

    > "more" exits cleanly, whilst less stops with a horrible "EOF", and you
    > have to press a key to exit.


    Set an environment variable
    LESS=-e
    or add "e" to whatever you LESS env is currently. Mine is
    LESS=-adefims
    but that's just me. Or you could use -E. From man less:

    -e or --quit-at-eof
    Causes less to automatically exit the second time it reaches
    end-of-file. By default, the only way to exit less is via the "q"
    command.

    -E or --QUIT-AT-EOF
    Causes less to automatically exit the first time it reaches end-
    of-file.


    > I was thinking of removing the "more" package from my system, and
    > replacing it with a symlink to "less". Unfortunately, "more" is part of a
    > suite at the moment, so I need to do some repackaging.


    Just aliasing more to less will do, more or less, what you want.


    > Hey there are some clearscreen options for less. I haven't read through this
    > lot, or done any further testing, but maybe there is an enviromental or
    > something setting the switches.


    -c or --clear-screen
    Causes full screen repaints to be painted from the top line down. By
    default, full screen repaints are done by scrolling from the bottom of
    the screen.

    -C or --CLEAR-SCREEN
    The -C option is like -c, but the screen is cleared before it is
    repainted.

    -- HASM

  7. Re: how to stop less clear on exit

    Mark Hobley wrote:
    >
    > "more" exits cleanly, whilst less stops with a horrible
    > "EOF", and you have to press a key to exit.
    >

    The EOF is GOOOD. It stops 'less' from exiting so that you
    can search backwards and forwards without fear of dropping
    off the end of the file.

    Cheers,

    Cliff

    --

    Barzoomian the Martian - http://barzoomian.blogspot.com

+ Reply to Thread