bug-ncurses
[Top][All Lists]
Advanced

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

Re: Regression from 6.1 to 6.2 with wbkgd


From: Marc Rechté
Subject: Re: Regression from 6.1 to 6.2 with wbkgd
Date: Mon, 2 Mar 2020 11:36:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

Le 02/03/2020 à 00:26, Thomas Dickey a écrit :
On Sun, Mar 01, 2020 at 03:58:32PM -0500, Thomas Dickey wrote:
On Sun, Mar 01, 2020 at 08:08:39AM +0100, Marc Rechté wrote:
Answers below your questions.

Note that if I revert to last 6.1 version (ncurses-6.1-7-x86_64.pkg.tar.xz),
the problem disappears.

Thanks

Le 29/02/2020 à 14:01, Thomas Dickey a écrit :
On Fri, Feb 28, 2020 at 07:36:55PM +0100, Marc Rechté wrote:
Hello,

The following code produces a window full of "€" (see attached capture)
characters with 6.2 wheras 6.1 produces a blank window.

in a quick check, I don't see that.  But since your program doesn't
call setlocale, I'm guessing that's part of what I'm missing:
...
b) what terminal program?
Gnome Terminal 3.34.2
c) what encoding is the terminal set to?
Occidental - WINDOWS-1252

this (encoding) is the relevant detail.
ncurses is sending 0x80 (which is rendered as the euro character).

going a little further, the change I made here is possibly correct:
...and given that, I can reproduce it with this version:

20181208
        + modify wbkgd() and wbkgrnd() to improve compatibility with SVr4
          curses, changing the way the window rendition is updated when the
          background character is modified (report by Valery Ushakov).

(will investigate a fix)

...and (so far) doesn't require revision.

What's happened is this:

gnome-terminal's using TERM=xterm-256color,
which includes the "rep" (repeat) capability.

The change to wbkgd manipulates the "background character",
which hasn't been set yet.  Initially (in ncurses) it's null.

In the library (EmitRange) is getting an update which consists
of a null character combined with attributes.

ncurses uses tparm internally for formatting strings,
which it passes to tputs.

Those (tparm/tputs) use null-terminated strings;
tparm transforms the null character to 0x80
to avoid truncating the result.

That used to be safe (leaving 0x80 as a "null" was done intentionally in
the 1980s), but the committee who wanted Euro saw 0x80 as "unused", and
repurposed it (in the late 1990s).

In ncurses, I'll probably make a check in the wbkgd code to avoid this
by sending a space.  Rewriting the internals to pass around strings with
embedded nulls wasn't on my short list of things to do...

As a workaround

        export TERM=vte
or
        export TERM=vte-256color

in gnome-terminal.

The recommended "vte" doesn't have "rep", though enough time has
passed since that feature was implemented that ncurses 6.2 _could_
have made that change.  Use "infocmp xterm vte" to see a list of
other problem areas waiting for someone to trip over.


OK, firstly thank you very much for attending the problem.

I tried "export TERM=vte-256color" and it fixes the problem, however I loose some features (like blink attribute).

I added "| ' '" to the attribute argument of wbkgd() calls and it fixes the problem on xterm-256color.

Marc



reply via email to

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