public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Display text file using less in Cygwin terminal or xterm incorrect when lines are longer than window width
Date: Sat, 7 Aug 2021 13:33:43 -0600	[thread overview]
Message-ID: <a4efd32a-fb9a-cf86-e0b9-c41438ecf98a@SystematicSw.ab.ca> (raw)
In-Reply-To: <f89f36a9b6c260b0c602336473a37c216f04a0c8.camel@mindspring.com>

On 2021-08-06 23:28, C Linus Hicks via Cygwin wrote:
> I have used Cygwin and CygwinX for many years and this problem has 
> persisted for many of those years, I can't remember the last time
> this worked. >
> Using vim in an xterm or terminal window displays text in a file
> properly.
> 
> The problem with less is easy to reproduce, but there are several 
> different problems:
> 
> Create a text file with the following characteristics:
> 
> 1. Several lines are longer then your terminal window is wide, even 
>    several times as wide.
> 2. The file has fewer lines then your terminal window.
> 
> In this case, when you first open the file with less, assuming all 
> the lines will fit in your window you will see the entire file in the
> bottom of your window. If you hit the 'g' key, it will jump to the
> top, but one or more lines at the top will be missing.

Works Just Fine For Me!

With files as described, and LESS/-OPEN/-CLOSE unset, running 
/usr/bin/less, the first file is displayed with the end of its bottom 
line on the bottom line of the window, just above the less status line; 
pressing Home/End displays start of top line at top, or end of bottom 
line at bottom of window, "G" displays end of bottom line at bottom of 
window; no lines or characters missing;
subsequent files in same run after :n, displayed with start of top line 
at top of window; pressing Home/End displays start of top line at top, 
or end of bottom line at bottom of window, "G" displays end of bottom 
line at bottom of window; no lines or characters missing.

With settings below, first file displayed with start of top line at top 
of window; pressing Home/End displays start of top line at top, or end 
of bottom line at bottom of window, "G" displays end of bottom line at 
bottom of window; no lines or characters missing.

> If you add more lines to the file but still with fewer lines then 
> lines in your display window, but the number of lines that should be
> displayed when wrapped is greater than your window, then you will get
> different behavior. And if your file has more lines than than the
> window, still different.
 >
> I can't find any reports or maybe I just gave up searching because 
> the hits don't address my issue, and using less on my Linux machine
> doesn't have these problems.

I get the same behaviour with no/same settings and no issues under Linux.

> Is there a setting I am missing, or is this just a bug?

As requested for problem reporting, please attach the file with the 
output from "cygcheck -hrsv" as text, if nothing below helps.

Make sure everything is up to date with no package issues: see output 
from above.

Are you running under Cygwin 64, or 32 with no rebase issues, and no 
other issues shown in /var/log/setup.log.full?

$ less --version
less 581.2 (PCRE2 regular expressions)
Copyright (C) 1984-2021  Mark Nudelman
...
$ set | egrep LESS\|TERM 
                            LESS='-c -R -M -PM?P%Pb\% %lb/%L.?p %pb\% 
%bb/%B.?f %f.?m %i/%m.?x %x.'
LESSCLOSE='/usr/local/bin/lesspipe %s %s'
LESSOPEN='| /usr/local/bin/lesspipe %s'
TERM=xterm-256color
TERM_PROGRAM=mintty
TERM_PROGRAM_VERSION=3.5.0
$ cygcheck -c less libncursesw10 libpcre2_8_0 cygwin
Cygwin Package Information
Package              Version            Status
cygwin               3.2.0-1            OK
less                 581.2-1            OK
libncursesw10        6.1-1.20190727     OK
libpcre2_8_0         10.37-1            OK
$ head /proc/version
CYGWIN_NT-10.0-19042 version 3.2.0-340.x86_64 (corinna@calimero) (gcc 
version 9.3.0 20200312 (Fedora Cygwin 9.3.0-1) (GCC) ) 2021-03-29 08:42 UTC

Debian 32 VM:

$ less --version
less 487 (GNU regular expressions)
Copyright (C) 1984-2016  Mark Nudelman
...
$ set | egrep LESS\|TERM
COLORTERM=truecolor
LESS='-c -R -M -PM?P%Pb\% %lb/%L.?p %pb\% %bb/%B.?f %f.?m %i/%m.?x %x.'
LESSCLOSE='/usr/bin/lesspipe %s %s'
LESSOPEN='| /usr/bin/lesspipe %s'
TERM=xterm-256color
$ apt list less libncursesw6 libpcre2-8-0
Listing... Done
less/stable,stable,stable,stable,stable,stable,stable,now 487-0.1+b1 
i386 [installed,automatic]
libncursesw6/stable,stable,stable,stable,stable,stable,stable,now 
6.1+20181013-2+deb10u2 i386 [installed,automatic]
libpcre2-8-0/stable,stable,stable,stable,stable,stable,stable,now 
10.32-5 i386 [installed,automatic]
$ head /proc/version
Linux version 5.4.0-0.bpo.2-686-pae (debian-kernel@lists.debian.org) 
(gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 5.4.8-1~bpo10+1 
(2020-01-07)

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

  reply	other threads:[~2021-08-07 19:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07  5:28 Display text file using less in Cygwin terminal or xterm incorrect when lines are longer then " C Linus Hicks
2021-08-07 19:33 ` Brian Inglis [this message]
2021-08-09 19:17   ` Display text file using less in Cygwin terminal or xterm incorrect when lines are longer than " C Linus Hicks
2021-08-14  1:47     ` C Linus Hicks
2021-08-14  1:56       ` Takashi Yano
2021-08-14  2:48       ` Takashi Yano
2021-08-14  3:27         ` C Linus Hicks
2021-08-14  3:44           ` Takashi Yano
2021-08-14  3:46           ` C Linus Hicks
2021-08-14  3:59             ` Takashi Yano
2021-08-14  4:05               ` C Linus Hicks
2021-08-14  4:35                 ` Takashi Yano
2021-08-14 14:31                   ` C Linus Hicks
2021-08-14  4:37                 ` Brian Inglis
2021-08-14 14:39                   ` C Linus Hicks

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=a4efd32a-fb9a-cf86-e0b9-c41438ecf98a@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).