groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] italics run past where they should


From: Alejandro Colomar
Subject: Re: [BUG] italics run past where they should
Date: Wed, 17 Aug 2022 15:08:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2

Hi Branden,

On 8/17/22 14:12, G. Branden Robinson wrote:
Hi Alex,

Good news--I finally see a problem.

At 2022-08-17T13:49:35+0200, Alejandro Colomar wrote:
I made the reproducer smaller, so that it's reasier to investigate.  I
produced a one-liner file, and then script(1)ed the reproduction of
the bug (I made the terminal shorter, 80x3, to get less blank lines
from less(1)):

In the future, when sending around a typescript that includes
screen-clearing escape sequences, it might be a good idea to capture
timing information.  Modern script(1) supports this, or you can use the
classic tool beloved of NetHack players, ttyrec(1).

Attached you'll find the offense line, and the typescript log.

Yes, I see trouble.

Script started on 2022-08-17 13:47:53+02:00 [TERM="xterm-256color" TTY="/dev/pts/4" 
COLUMNS="80" LINES="3"]
ESC[?2004hESC]0;alx@asus5775: 
~/tmp^GESC[01;32malx@asus5775ESC[00m:ESC[01;34m~/tmpESC[00m$ less -R 
offense_line.out
ESC[?2004l^MESC[?1049hESC[22;0;0tESC[?1hESC=^M       ESC[1mint 
syscall(SYS_membarrier, int ESC[4mESC[22mcmdESC[24mESC[1m, unsigned int 
ESC[4mESC[22mflagsESC[24mESC[1m, int 
ESESC[4mESC[22mcpu_idESC[24mESC[1m);ESC[0mESC[m

Okay, that looks like a riot of noise, but the important thing is that
we can see around "cmd" pair of CSI escape sequences, 22 m and 24 m.

As discussed earlier in the thread, "22" restores the "intensity" to
"normal" (i.e., in this case, turns bold off) and "24" turns off
underlining.  A CSI 1 m sequence, which turns bold back on, follows.

ESC[7moffense_line.out 
(END)ESC[27mESC[K^MESC[K/ESC[KcESC[KmESC[Kd^MESC[K...skipping...

This is you doing your search.

        ESC[1mint syscall(SYS_membarrier, int 
ESC[4mESC[22mESC[7mcmdESC[27mESC[1m, unsigned int 
ESC[4mESC[22mflagsESC[24mESC[1m, int 
ESC[4mESC[22mcpu_idESC[24mESC[1m);ESC[0mESESC[m

This is the same line from the document, with the match now highlighted.

We see that after CSI 22 m, the pager has interpolated a CSI 7 m
sequence before the match and a CSI 27 m afterward.  This makes sense;
again as discussed before, these are "inverse" and "positive"
respectively.

But where's the CSI 24 m sequence we originally had?

This is the bug.

It seems the bug is only present in less 590. I compiled from source less 581.2 and a few previous to that, and they don't have it, and less 608, which is also free of the bug.

It seems to be the same issue reported here:
<https://github.com/gwsw/less/issues/265>.

It's curious that batcat had the same bug at the same time.
I reported it here:

<https://github.com/sharkdp/bat/issues/2278>

Cheers,

Alex


--
Alejandro Colomar
<http://www.alejandro-colomar.es/>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]