All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: "Aneesh Kumar" <aneesh.kumar@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: less -F ubuntu dapper.
Date: Sat, 21 Oct 2006 20:01:10 +0400	[thread overview]
Message-ID: <20061021200110.6aef96a4.vsu@altlinux.ru> (raw)
In-Reply-To: <cc723f590610210623sbee2075i5f2fd441cceb84ae@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2232 bytes --]

On Sat, 21 Oct 2006 18:53:35 +0530 Aneesh Kumar wrote:

> -F option for less in ubuntu Dapper is broken. It doesn't display
> anyting if the file can be displayed in one page.

Same here in ALT Linux (less-382-alt2).  The problem appears only
when the terminal supports alternate screen, and less uses it.

BTW, try this (needs bash or zsh):

  (for ((i=0; i < 20; ++i)) do echo $i; sleep 0.1; done) | less -F

You'll see that the text appears on the screen while the loop
outputs it, but disappears once the output finishes.  If you use
"less -FX" instead, the text will not disappear, but in this case
less will not use the alternate screen, which is inconvenient when
the text is large (e.g., when you browse the text, parts of it
will be put into the scrollback buffer).

Because less must start displaying the text immediately after it
got some data, it cannot decide whether to use the alternate
screen depending on the text size.  Therefore, if you want to use
the -F option on a terminal with alternate screen, you need to
turn off the alternate screen support with -X.  But less cannot do
this automatically, because it does not really know about the
alternate screen (the -X option disables termcap initialization
and deinitialization strings, which can do arbitrary things, and
may actually be required on some obscure terminals).

It should be possible to add yet another option to less to make it
initially display the text on the alternate screen, and on EOF, if
the text fits on the screen, turn off the alternate screen,
_redisplay the text_ and exit.  However, this option will have
even more assumptions about the terminal than -X (if the terminal
does not turn on alternate screen in its termcap initialization
string, there will be a horrible mess on screen), and you will get
flicker when the text is displayed multiple times.

> Because of this the recent chages to
> 96a035d1db9082d244867033020d0ceb571cf94e results in commands
> like git show not showing the changes.

Adding the -X option might break some terminals (and will irritate
users which used alternate screen before), so apparently the only
way to fix this breakage is to remove the -F option again...

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-10-21 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-21 13:23 less -F ubuntu dapper Aneesh Kumar
2006-10-21 16:01 ` Sergey Vlasov [this message]
2006-10-21 16:47   ` A Large Angry SCM

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=20061021200110.6aef96a4.vsu@altlinux.ru \
    --to=vsu@altlinux.ru \
    --cc=aneesh.kumar@gmail.com \
    --cc=git@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.