git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* less -F ubuntu dapper.
@ 2006-10-21 13:23 Aneesh Kumar
  2006-10-21 16:01 ` Sergey Vlasov
  0 siblings, 1 reply; 3+ messages in thread
From: Aneesh Kumar @ 2006-10-21 13:23 UTC (permalink / raw)
  To: Git Mailing List

-F option for less in ubuntu Dapper is broken. It doesn't display
anyting if the file can be displayed in one page. Because of this the
recent chages to
96a035d1db9082d244867033020d0ceb571cf94e results in commands like git
show not showing the changes.

https://launchpad.net/distros/ubuntu/+source/less/+bug/67381


-aneesh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: less -F ubuntu dapper.
  2006-10-21 13:23 less -F ubuntu dapper Aneesh Kumar
@ 2006-10-21 16:01 ` Sergey Vlasov
  2006-10-21 16:47   ` A Large Angry SCM
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Vlasov @ 2006-10-21 16:01 UTC (permalink / raw)
  To: Aneesh Kumar; +Cc: Git Mailing List

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: less -F ubuntu dapper.
  2006-10-21 16:01 ` Sergey Vlasov
@ 2006-10-21 16:47   ` A Large Angry SCM
  0 siblings, 0 replies; 3+ messages in thread
From: A Large Angry SCM @ 2006-10-21 16:47 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Sergey Vlasov, Aneesh Kumar

Sergey Vlasov wrote:
> 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.

Suse 9.3 has the same problem.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-21 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-21 13:23 less -F ubuntu dapper Aneesh Kumar
2006-10-21 16:01 ` Sergey Vlasov
2006-10-21 16:47   ` A Large Angry SCM

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).