From: Mark Nudelman <markn@greenwoodsoftware.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bill Lear <rael@zopyra.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Jakub Narebski <jnareb@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [Announce] GIT v1.5.0-rc2
Date: Wed, 24 Jan 2007 09:54:48 -0800 [thread overview]
Message-ID: <45B79D68.6040200@greenwoodsoftware.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0701231157430.32200@woody.linux-foundation.org>
On 1/23/2007 12:32 PM, Linus Torvalds wrote:
> I think "less" is actually seriously buggy with -F.
>
> There are two bugs:
>
> - it will always screw up the screen and move to the end. It does this
> even if you use -FX which should disable any init sequences, so it's
> not about that problem.
>
> - if you resize the terminal while less is waiting for input, less
> will exit entirely without even showing the output. This is very
> noticeable if you do something like "git diff" on a big and cold-cache
> tree and git takes a few seconds to think, and then you resize the
> window while it's preparing. Boom. No output AT ALL.
>
> Both bugs are easily seen with this simple command line
>
> clear ; (sleep 5 ; echo Hello) | less -F
>
> where you would EXPECT that the "Hello" would show up at the first line of
> the screen (since we cleared the screen and moved to the top left corner),
> but in fact it doesn't.
>
> And try resizing the terminal to make it bigger during the five-second
> pause, and now you'll see less not show the "Hello" at _all_. It's just
> gone (this is true even if the output was _more_ than a screen: try with
>
> (sleep 10 ; yes ) | less -F
>
> and resize the screen, and it will exit silently after 10 seconds - never
> showing any output at all! Even though the output is obviously bigger than
> a screen..
>
> Tested with Kterm, gnome-terminal and xterm. They all behave the same for
> me.
>
> I don't know exactly what the bug is, but I find the "eof" handling very
> confusing in the less sources. It makes me suspect that there is something
> that gets confused by the partial read, sets EOF (since we're on the last
> line), and then thinks that it should quit, since EOF is set.
>
> I dunno. Mark?
>
> Linus
Hi Linus,
The first issue that you mention (that we move to the bottom of the
screen before printing the first line) is behavior that has always
existed in less. It's not the init sequence that's doing it; less
deliberately moves to lowerleft before printing any output that is
intended to go at the bottom of the screen, including both file data and
the prompt. This was a design decision from the first version of less,
and I've never been brave enough to try to find all the places that
would be affected by changing this. For example, less tries to keep
track of exactly what's displayed on the screen at all times, and it's
harder to do this if we don't know whether some output scrolled the
screen or not. It may or may not be a big job to make all the changes
that would be required. I will move this up the priority list and take
a look at it for the next release of less.
BTW, this issue is documented as enhancement request #112 at
http://www.greenwoodsoftware.com/less/bugs.html.
Your second issue is definitely a bug. Less's handling of -F and eof in
general is indeed rather baroque and confusing, and probably needs a
complete revision. Some of the complexity comes from being portable to
many (not necessarily Unix-like) systems. But in this case, I think the
early exit is happening because less makes the decision about whether to
quit due to -F based on the state of the input when the first prompt
occurs. When less receives SIGWIND, it repaints the screen and
*reprompts*. So if it gets this signal before the first screen is
completely filled, it tries to prompt, somehow gets confused and thinks
that the partially filled screen is evidence of a short file, and exits.
I will add this to the bug list and try to fix it in the next release.
--Mark
next prev parent reply other threads:[~2007-01-24 17:59 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-21 8:56 [Announce] GIT v1.5.0-rc2 Junio C Hamano
2007-01-21 9:40 ` Jakub Narebski
2007-01-21 10:52 ` Junio C Hamano
2007-01-21 11:08 ` Johannes Schindelin
2007-01-23 18:12 ` Bill Lear
2007-01-23 19:12 ` Johannes Schindelin
2007-01-23 20:12 ` Bill Lear
2007-01-23 20:22 ` Uwe Kleine-König
2007-01-23 20:31 ` Bill Lear
2007-01-24 10:06 ` Uwe Kleine-König
2007-01-23 20:22 ` Johannes Schindelin
2007-01-23 21:09 ` Peter Baumann
2007-01-23 21:54 ` Bill Lear
2007-01-23 20:32 ` Linus Torvalds
2007-01-24 17:54 ` Mark Nudelman [this message]
2007-01-24 18:18 ` Linus Torvalds
2007-01-24 19:21 ` Linus Torvalds
2007-01-24 23:23 ` Junio C Hamano
2007-03-27 0:07 ` Mark Nudelman
2007-01-21 11:20 ` Junio C Hamano
2007-01-21 13:42 ` Bill Lear
2007-01-21 13:52 ` Bill Lear
[not found] ` <20070121145805.735815@dial-up-mi-352.lombardiacom.it>
2007-01-21 15:02 ` Michael
2007-01-21 21:26 ` Johannes Schindelin
2007-01-21 21:33 ` Jakub Narebski
2007-01-21 22:01 ` Johannes Schindelin
2007-01-21 22:24 ` Jakub Narebski
2007-01-21 13:43 ` Willy Tarreau
2007-01-21 15:06 ` Jakub Narebski
2007-01-21 18:58 ` Junio C Hamano
2007-01-21 19:49 ` H. Peter Anvin
2007-01-22 17:23 ` Nicolas Pitre
2007-01-21 20:01 ` Horst H. von Brand
2007-01-22 1:27 ` Junio C Hamano
2007-01-21 19:46 ` Horst H. von Brand
2007-01-21 20:51 ` Junio C Hamano
2007-01-21 21:55 ` Johannes Schindelin
2007-01-21 22:45 ` Jakub Narebski
2007-01-21 22:52 ` Johannes Schindelin
2007-01-21 23:08 ` Jakub Narebski
2007-01-21 23:13 ` Johannes Schindelin
2007-01-21 23:36 ` Jakub Narebski
2007-01-22 0:55 ` Junio C Hamano
2007-01-22 6:25 ` Junio C Hamano
2007-01-23 6:47 ` [PATCH 1/2] Refactor the pack header reading function out of receive-pack.c Junio C Hamano
2007-01-23 6:47 ` [PATCH 2/2] Allow fetch-pack to decide keeping the fetched pack without exploding Junio C Hamano
2007-01-23 10:32 ` Johannes Schindelin
2007-01-23 10:55 ` Jakub Narebski
2007-01-23 11:07 ` code movements in diffs, was " Johannes Schindelin
2007-01-23 16:01 ` Nicolas Pitre
2007-01-25 1:14 ` [PATCH] fetch-pack: remove --keep-auto and make it the default Junio C Hamano
2007-01-25 8:23 ` Johannes Schindelin
2007-01-25 21:32 ` Junio C Hamano
2007-01-25 23:46 ` Johannes Schindelin
2007-01-26 3:05 ` Junio C Hamano
2007-01-26 3:30 ` [PATCH] Allow non-developer to clone, checkout and fetch easier Junio C Hamano
2007-01-26 14:20 ` Alex Riesen
2007-01-26 8:37 ` [PATCH] fetch-pack: remove --keep-auto and make it the default Johannes Sixt
2007-01-25 1:14 ` [PATCH] Consolidate {receive,fetch}.unpackLimit Junio C Hamano
2007-01-25 3:32 ` Nicolas Pitre
2007-01-25 5:14 ` Shawn O. Pearce
2007-01-23 16:15 ` [PATCH 2/2] Allow fetch-pack to decide keeping the fetched pack without exploding Linus Torvalds
2007-01-23 16:28 ` David Kågedal
2007-01-23 16:43 ` Johannes Schindelin
2007-01-23 17:22 ` Jakub Narebski
2007-01-22 18:08 ` [Announce] GIT v1.5.0-rc2 Carl Worth
2007-01-22 19:28 ` Junio C Hamano
2007-01-23 1:01 ` Carl Worth
2007-01-22 18:22 ` Jakub Narebski
2007-01-22 18:46 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45B79D68.6040200@greenwoodsoftware.com \
--to=markn@greenwoodsoftware.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=rael@zopyra.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).