Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: dog - man's best friend.
Date: Fri, 24 Feb 2012 00:04:31
Message-Id: CAEH5T2MUqSuFG+pU=zPDiLsFErHwiBFY-y8WTwqnMPAJu+3fGg@mail.gmail.com
In Reply to: [gentoo-user] Re: dog - man's best friend. by Harry Putnam
1 On Thu, Feb 23, 2012 at 5:24 PM, Harry Putnam <reader@×××××××.com> wrote:
2 > Kevin Monceaux <Kevin@××××××××××.net> writes:
3 >
4 >> On Thu, Feb 23, 2012 at 08:42:00PM +0000, Alan Mackenzie wrote:
5 >>
6 >>> (a) using less, and have it take just 10 screen lines; (b) using cat etc.,
7 >>> and have the interesting part scroll away.
8 >>
9 >> (c) use less -F and less will automatically exit if the entire file can fit
10 >> on one screen.  One can export LESS='-F' to have less always do the above.
11 >
12 > Maybe I'm seeing behavior that is not supposed to happen, but if I say
13 > echo '## ONE LINE' > test
14 >
15 > And then say less -F test
16 >
17 > I do not get to see the one line.   I don't think that's what Alan
18 > was looking for is it?
19
20 It is caused by "alternate screen" handling in your terminal emulator.
21 You can disable alternate screen in your terminal (if possible), or
22 remove the smcup and rmcup directives from your termcap file.
23
24 As a test, you can try this:
25
26 export TERM=vt220
27 less -F test
28
29 it should display the one line file.
30
31 Or you can use the -X option of less like Willie said which inhibits
32 less from using the alternate screen.
33
34 But I think it may still be a bug in less, because when it's not in
35 "pager mode" we shouldn't be using the alternate screen anyway. Taking
36 a look at the bug list on the less website, I don't see anything.
37 Might be worth submitting.

Replies

Subject Author
[gentoo-user] Re: dog - man's best friend. Harry Putnam <reader@×××××××.com>