bug-ncurses
[Top][All Lists]
Advanced

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

Re: Display difference between ncurses version 5.7 and version 6.0.0.201


From: Rich Burridge
Subject: Re: Display difference between ncurses version 5.7 and version 6.0.0.20170708
Date: Thu, 20 Jul 2017 07:23:44 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/20/2017 02:16 AM, Thomas Dickey wrote:
On Wed, Jul 19, 2017 at 06:19:09AM -0700, Rich Burridge wrote:
On 07/19/2017 01:22 AM, Thomas Dickey wrote:
On Tue, Jul 18, 2017 at 06:51:49PM -0700, Rich Burridge wrote:
On 07/18/2017 06:45 PM, Rich Burridge wrote:
...
Any red flags for you with this terminfo file?
I did diff the Solaris one against the Ubunto one and got:

$ gdiff -urN solaris-terminfo.txt linux-terminfo.txt
--- solaris-terminfo.txt    2017-07-18 18:56:24.204081755 +0000
+++ linux-terminfo.txt    2017-07-18 18:55:00.479256768 +0000
@@ -1,18 +1,18 @@
-$ /usr/gnu/bin/infocmp xterm-color
-#       Reconstructed via infocmp from file:
/usr/gnu/share/terminfo/x/xterm-color
-xterm-color|nxterm|generic color xterm,
+infocmp xterm-color
+#    Reconstructed via infocmp from file: /lib/terminfo/x/xterm-color
+xterm-color|generic "ANSI" color xterm (X Window System),
     am, km, mir, msgr, xenl,
     colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
That's simple: don't use "xterm-color".

http://invisible-island.net/ncurses/ncurses.faq.html#xterm_color

The screenshot seemed to show that you're using some version of
gnome-terminal.  For anything "recent" (since around 2000), and probably
any version of Solaris that you're using, it copies the "bce" feature
done in Linux console (early 1990s) and XFree86 xterm (mid-1990s).

When an application clears the screen, the terminal will fill in with
the currently-set colors.  Depending on the details, that might be
the color you expect, or it might be the (uncolored) default colors
for the terminal.
Okay thanks, but what should I use (on Solaris)?

I tried:

  $ TERM=xterm-256color python test_userscreen.py

and get the same result. Trussing it shows that it is using:

  /usr/gnu/share/terminfo/x/xterm-256color
Checking a newly-installed 11.3 system, that has "bce".

Note that 11.3 has ncurses version 5.7 on it, and we don't see the
problem there. I'm testing this with ncurses version 6.0-20170408
on what will be the next version of Solaris (11.4).


I've also reduced that Python script to:

$ cat test_userscreen.py
#!/usr/bin/python

import curses

initscr = curses.initscr()
curses.start_color()
curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)
default = curses.color_pair(1) | curses.A_BOLD
curses.init_pair(5, curses.COLOR_WHITE, curses.COLOR_CYAN)
list_field = curses.color_pair(5) | curses.A_BOLD
initscr.clear()

window = curses.newwin(1, 15, 0, 2)
window.bkgd(ord(' '), default)
window.addstr(0, 0, "Root password:")
window.bkgd(ord(' '), list_field)
window.noutrefresh()
curses.doupdate()
while True:
    pass



to make it easier to test (and see what's going on).

I also note that I can make the following change:

--- test_userscreen.py.prev  2017-07-19 09:49:21.178953967 +0000
+++ test_userscreen.py  2017-07-19 09:49:40.603137692 +0000
@ -12,8 +12,7 @@

 window = curses.newwin(1, 15, 0, 2)
 window.bkgd(ord(' '), default)
-window.addstr(0, 0, "Root password:")
-window.bkgd(ord(' '), list_field)
+window.addstr(0, 0, "Root password:", list_field)
 window.noutrefresh()
 curses.doupdate()
 while True:


and the problem goes away, but unfortunately I have
not been successful in applying a similar change to the larger
Python application, due to the multiple places that it's calling
bkgd and the numerous places where it clears and sets colors
(not to mention the whole nested OO approach to writing the
ncurses code, that they've taken).

I tried copying the compiled xterm-color terminfo file from the
Solaris 11.3 system (i.e. one build with ncurses 5.7), to the
11.4 system, but I still see the problem. It does suggest that there
is a difference in the ncurses version 5.7 vs 6.0-20170408 code
that is causing the difference.


But unless ncurses had been compiled to use extended colors,
that wouldn't work properly.  (The package manager doesn't
show any development headers for "ncurses", so I'd suspect
that it's a minimal package without any customization).

I just rebuilt ncurses version 6.0-20170408 on my 11.4 system,
configured with --enable-ext-colors and installed that, and then
tried:

  $ TERM=xterm-256color python test_userscreen.py
  $ stty sane
  $ TERM=xterm-color python test_userscreen.py
  $ stty sane
  $ TERM=xterm-new python test_userscreen.py
  $ stty sane
  $

and none of them produced the desired result (what we see on 11.3 with
ncurses version 5.7).



It does have "xterm-new" (promising), but checking the version
on gnome-terminal, that's 2.30.2 with copyright date 2007.
It's likely that's still using the obsolete function-key definitions,
so I'd look at the "gnome" entry.

You can verify function-keys for a given terminal description
(menu n, f, k) using tack (for which there's a package).
tack has an ok test for bce, but it's not exhaustive.



reply via email to

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