[Top][All Lists]

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

Re: Regression from 6.1 to 6.2 with wbkgd

From: Thomas Dickey
Subject: Re: Regression from 6.1 to 6.2 with wbkgd
Date: Sun, 1 Mar 2020 18:26:20 -0500
User-agent: NeoMutt/20170113 (1.7.2)

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

Thomas E. Dickey <address@hidden>

Attachment: signature.asc
Description: PGP signature

reply via email to

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