New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colours broken on latest ncurses 6.0 - patch 20170401 #528

Closed
Earnestly opened this Issue Apr 4, 2017 · 13 comments

Comments

Projects
None yet
7 participants
@Earnestly

Earnestly commented Apr 4, 2017

newsbeuter 2.10-7159e
System: Linux 4.10.8-2-ARCH (x86_64)
Compiler: g++ 6.3.1 20170306
ncurses: ncurses 6.0.20170401 (compiled with 6.0)
libcurl: libcurl/7.53.1 OpenSSL/1.1.0e zlib/1.2.11 libpsl/0.17.0 (+libicu/58.2) libssh2/1.8.0 (compiled with 7.53.1)
SQLite: 3.18.0 (compiled with 3.18.0)
libxml2: compiled with 2.9.4

It's hard to explain but essentially the colours have changed since ncurses 20170401 which itself touched a lot of colour code:

Author: Thomas E. Dickey <dickey@invisible-island.net>
Date:   Sun Apr 2 01:27:53 2017 +0000

    ncurses 6.0 - patch 20170401
    
    + minor fixes for vt100+4bsd, e.g., delay in sgr for consistency -TD
    + add smso for env230, to match sgr -TD
    + remove p7/protect from sgr in fbterm -TD
    + drop setf/setb from fbterm; setaf/setab are enough -TD
    + make xterm-pcolor sgr consistent with other capabilities -TD
    + add rmxx/smxx ECMA-48 strikeout extension to tmux and xterm-basic
      (discussion with Nicholas Marriott)
    + add test-programs sp_tinfo and extended_color
    + modify no-leaks code for lib_cur_term.c to account for the tgetent()
      cache.
    + modify setupterm() to save original tty-modes so that erasechar()
      works as expected.  Also modify _nc_setupscreen() to avoid redundant
      calls to get original tty-modes.
    + modify set_curterm() to update ttytype[] data used by longname().
    + modify wattr_set() and wattr_get() to return ERR if win-parameter is
      null, as documented.
    + improve cast used for null-pointer checks in header macros, to
      reduce compiler warnings.
    + modify several functions, using the reserved "opts" parameter to pass
      color- and pair-values larger than 16-bits:
      + getcchar(), setcchar(), slk_attr_set(), vid_puts(), wattr_get(),
        wattr_set(), wchgat(), wcolor_set().
      + Other functions call these with the corresponding altered behavior,
        including chgat(), mvchgat(), mvwchgat(), slk_color_on(),
        slk_color_off(), vid_attr().
    + add new functions for manipulating color- and pair-values larger
      than 16-bits.  These are extended_color_content(),
      extended_pair_content(), extended_slk_color(), init_extended_color(),
      init_extended_pair(), and the corresponding sp-funcs.

For example, the main issue seems to be the foreground colours now being the same colour as the background making them essentially invisible.

Here is a screenshot of the help screen inside newsbeuter:

newsbeuter

@Minoru

This comment has been minimized.

Show comment
Hide comment
@Minoru

Minoru Apr 5, 2017

Collaborator

Don't have any suggestions or estimates at this point. We don't even use ncurses itself—we employ STFL which does it for us. Looks like this one's going to be a tricky one to fix :(

Collaborator

Minoru commented Apr 5, 2017

Don't have any suggestions or estimates at this point. We don't even use ncurses itself—we employ STFL which does it for us. Looks like this one's going to be a tricky one to fix :(

@Earnestly

This comment has been minimized.

Show comment
Hide comment
@Earnestly

Earnestly Apr 5, 2017

For the moment I can workaround the issue by explicitly defining some colours:

color info white black
color article white black
color listnormal white black
color background white black

Earnestly commented Apr 5, 2017

For the moment I can workaround the issue by explicitly defining some colours:

color info white black
color article white black
color listnormal white black
color background white black

Earnestly pushed a commit to Earnestly/dotfiles that referenced this issue Apr 21, 2017

Earnestly
Switching more to sh and other clean ups
cmpver: guard shebang against bad script naming
ghostfiles: pacman can now read stdin linewise
menu: group options, nothing important
mkwineprefix: don't output usage to stderr
repo-cycle-detector: switch to sh
sx: mention fgconsole dependency
xinitrc: setting DBUS_SESSION_BUS_ADDRESS isn't necessary anymore
conky: keep each item on its own logical line
i3: continue moving keybinds, testing experimental statusbar
llpp: use generic commands for browser and terminal and add backspace keybind
mpv: qualify on total bitrate to narrow down the preference
newsbeuter: manually add colours to workaround akrennmair/newsbeuter#528
nvim: sync with vim-plug
zsh: attempt to print full command-line in window title
@Yamakaky

This comment has been minimized.

Show comment
Hide comment
@Yamakaky

Yamakaky Apr 26, 2017

I also have the same problem, only the selected line is visible. See https://lut.im/4tTXlhD3e1/gQxt85jBjlHt5xDN.png. The fix by @Earnestly works.

Yamakaky commented Apr 26, 2017

I also have the same problem, only the selected line is visible. See https://lut.im/4tTXlhD3e1/gQxt85jBjlHt5xDN.png. The fix by @Earnestly works.

@protist

This comment has been minimized.

Show comment
Hide comment
@protist

protist Apr 26, 2017

I can confirm the problem and @Earnestly's fix, but one compounding issue is that white is not pure white on my default terminal, but a dull grey instead (#D3D7CF). I'm aware that I can change this in my terminal emulator's preferences, but I'm generally happy with its setting, and would prefer to hard code it for newsbeuter only.

I used to use default when applicable, which no longer works. I've now also tried color15 (#EEEEEC) and color255 (#EEEEEE), but neither is pure white (#FFFFFF).

I'm also getting some artefacts, but it's not 100% reproducible. I presume they are related to this issue. For example, with the following config

color background          black color255
color listnormal          color250 color255
color listfocus           color250 color229
color listnormal_unread   black color255
color listfocus_unread    black color229
color info                yellow blue bold
color article             black color255

I sometimes get residual listfocus_unread colouring, as per the following screenshot. Here the third item has focus, but the first item still has colouring artefacts.

artefacts

protist commented Apr 26, 2017

I can confirm the problem and @Earnestly's fix, but one compounding issue is that white is not pure white on my default terminal, but a dull grey instead (#D3D7CF). I'm aware that I can change this in my terminal emulator's preferences, but I'm generally happy with its setting, and would prefer to hard code it for newsbeuter only.

I used to use default when applicable, which no longer works. I've now also tried color15 (#EEEEEC) and color255 (#EEEEEE), but neither is pure white (#FFFFFF).

I'm also getting some artefacts, but it's not 100% reproducible. I presume they are related to this issue. For example, with the following config

color background          black color255
color listnormal          color250 color255
color listfocus           color250 color229
color listnormal_unread   black color255
color listfocus_unread    black color229
color info                yellow blue bold
color article             black color255

I sometimes get residual listfocus_unread colouring, as per the following screenshot. Here the third item has focus, but the first item still has colouring artefacts.

artefacts

brianbuccola added a commit to brianbuccola/dotfiles that referenced this issue Apr 26, 2017

Change "default" -> color15 (fg) or color0 (bg)
This is a workaround for a bug in newsbeuter/ncurses that causes
"default"-colored lines to not be displayed. See
<https://bugs.archlinux.org/task/53833> and
<akrennmair/newsbeuter#528>.
@diskotechjam

This comment has been minimized.

Show comment
Hide comment
@diskotechjam

diskotechjam Apr 26, 2017

I'm having the same issue, whenever "default" is set as the background color, only "white" displays correctly. Setting all my background colors to "black" restores usability.

color background white black
color listnormal white black
color listfocus yellow black bold
color listnormal_unread red black
color listfocus_unread yellow black bold
color info green black bold
color article white black

diskotechjam commented Apr 26, 2017

I'm having the same issue, whenever "default" is set as the background color, only "white" displays correctly. Setting all my background colors to "black" restores usability.

color background white black
color listnormal white black
color listfocus yellow black bold
color listnormal_unread red black
color listfocus_unread yellow black bold
color info green black bold
color article white black

@tomxtobin

This comment has been minimized.

Show comment
Hide comment
@tomxtobin

tomxtobin Apr 26, 2017

@protist You want color231.

tomxtobin commented Apr 26, 2017

@protist You want color231.

@protist

This comment has been minimized.

Show comment
Hide comment
@protist

protist Apr 26, 2017

Oops, thanks @tomxtobin! For some reason, that looked a bit yellowish to me at first. That works well.

protist commented Apr 26, 2017

Oops, thanks @tomxtobin! For some reason, that looked a bit yellowish to me at first. That works well.

@Minoru Minoru referenced this issue Apr 27, 2017

Closed

Text hidden #541

@Minoru

This comment has been minimized.

Show comment
Hide comment
@Minoru

Minoru Apr 27, 2017

Collaborator

I built 20170422 from source. Its own tests work fine.

Then I built libstfl—the library we use to draw the interface. its example has the same problems with colour as you report.

Collaborator

Minoru commented Apr 27, 2017

I built 20170422 from source. Its own tests work fine.

Then I built libstfl—the library we use to draw the interface. its example has the same problems with colour as you report.

@Cloudef

This comment has been minimized.

Show comment
Hide comment
@Cloudef

Cloudef Apr 29, 2017

FYI, this also affects rtorrent-pyro as well. Seems like general ncurses breakage.

Cloudef commented Apr 29, 2017

FYI, this also affects rtorrent-pyro as well. Seems like general ncurses breakage.

@Minoru

This comment has been minimized.

Show comment
Hide comment
@Minoru

Minoru Apr 29, 2017

Collaborator

@Cloudef, thanks! You actually gave me an idea to, well, search GitHub for the similar issues, and looks like the guys over at vifm/vifm#269 run into the same issue, find out the cause, devised a solution and reported it upstream. And yeah, it does look like the default colour in Ncurses is now broken.

Collaborator

Minoru commented Apr 29, 2017

@Cloudef, thanks! You actually gave me an idea to, well, search GitHub for the similar issues, and looks like the guys over at vifm/vifm#269 run into the same issue, find out the cause, devised a solution and reported it upstream. And yeah, it does look like the default colour in Ncurses is now broken.

@Minoru

This comment has been minimized.

Show comment
Hide comment
@Minoru

Minoru Apr 30, 2017

Collaborator

When built against just-released ncurses-6.0-20170429, STFL example works fine. Pretty sure that'll fix Newsbeuter too. (Testing Newsbeuter is a bit harder because it links Ncurses dynamically, not statically; so I didn't do it.)

Collaborator

Minoru commented Apr 30, 2017

When built against just-released ncurses-6.0-20170429, STFL example works fine. Pretty sure that'll fix Newsbeuter too. (Testing Newsbeuter is a bit harder because it links Ncurses dynamically, not statically; so I didn't do it.)

@Earnestly

This comment has been minimized.

Show comment
Hide comment
@Earnestly

Earnestly Apr 30, 2017

Since ncurses 6.0.20170429 I can report that things appear to have returned back to normal:

newsbeuter

I would close the issue myself but I'll leave that to you @Minoru when you're happy with the situation and others are no longer affected.

Thank you as always for working on this project o/

Earnestly commented Apr 30, 2017

Since ncurses 6.0.20170429 I can report that things appear to have returned back to normal:

newsbeuter

I would close the issue myself but I'll leave that to you @Minoru when you're happy with the situation and others are no longer affected.

Thank you as always for working on this project o/

@Minoru

This comment has been minimized.

Show comment
Hide comment
@Minoru

Minoru Apr 30, 2017

Collaborator

We can always re-open this if someone claims that it wasn't fixed. Thanks for reporting this in the first place!

Collaborator

Minoru commented Apr 30, 2017

We can always re-open this if someone claims that it wasn't fixed. Thanks for reporting this in the first place!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment