#59568 less -F or less -E unuseable on an xterm or rxvt

Package:
less
Source:
less
Description:
pager program similar to more
Submitter:
Manoj Srivastava
Date:
2025-03-31 13:36:06 UTC
Severity:
normal
Tags:
#59568#5
Date:
2000-03-03 18:55:19 UTC
From:
To:
Hi,

	According to the man page, less -F is supposed to exit if the
 file can fit on oe screen, and less -E exit with hitting the EOF.

#59568#8
Date:
2000-07-20 18:25:21 UTC
From:
To:
Hello,

To add to your bug report I would like to point out that the author
has this topic as a FAQ. Thanks.

from http://home.flash.net/~marknu/less/#tite

  Can less leave the screen alone when it quits?

   When less quits, it sends the "te" termcap string to the terminal.
   Exactly what that does depends on the system you are using, the type
   of terminal, and your version of termcap. On some systems, it does
   nothing; on others it restores the screen to the state it was in when
   less started, thus erasing from the screen the last page of the file
   which less was viewing. If you don't like the behavior of "te" on your
   system, you can disable the sending of the "te" string by invoking
   less with the -X option. If you want "te" to do something different
   (for example, restore the screen if it's not doing that already),
   you'll have to figure out how to override the default termcap on your
   system. Unfortunately, this is done differently on different systems,
   so you'll have to check the documentation for your system.

#59568#37
Date:
2003-05-02 15:30:58 UTC
From:
To:
less has the same bug with -F for me under PuTTY.  It works if TERM is
set to "linux", but not if set to "xterm".

#59568#42
Date:
2014-09-04 23:52:14 UTC
From:
To:
I recently ran into this same bug. In my case, it caused a lot of
confusion because a coworker developed a domain-specific "diff" script
that invoked "less -F". On his machine, (Fedora), the script was
showing differences, while on my Debian system, no differences were
displayed.

We tracked the problem down to the -F option to less, and then
wondered at the difference in the same version of less on our two
systems.

A bit of investigation later revealed the following patch which Fedora
carries that fixes the -F option to behave better. I would love to see
this patch accepted upstream (and carried by Debian in the meantime):

http://pkgs.fedoraproject.org/cgit/less.git/plain/less-444-Foption.v2.patch?id=47da4db53ff5f00cfa893e05c9995959b8491242