neomutt / neomutt

✉️ Teaching an Old Dog New Tricks -- IRC: #neomutt on irc.libera.chat
https://neomutt.org/
GNU General Public License v2.0
3.2k stars 307 forks source link

bug fix in release 2022-04-15 breaks transparency/terminal background highlighting. #4355

Open echarlie opened 1 month ago

echarlie commented 1 month ago

in releases prior to 2022-04-15 default means the terminal background colour is used, as described in older versions of the f1 documentation:

If your terminal supports it, the special keyword default can be used as a
transparent color. The value brightdefault is also valid. If NeoMutt is linked
against the S-Lang library, you also need to set the $COLORFGBG environment
variable to the default colors of your terminal for this to work; for example
(for Bourne-like shells):

Thus, my colour config looked like

color normal white default
color indicator brightyellow default
color index black brightyellow ~N

Expected Behaviour

My terminal (urxvt) has pseudo-transparency configured in xorg. i.e. my xresources had

URxvt*.transparent: true
URxvt*tintColor: #506560

This can also be reproduced if *.background is not also in the colour pallete.

Prior to 2022-04-15 release (i.e. when I was on debian bullseye and earlier), the default keyword used the terminal background, rather than merging multiple colour descriptions

Actual Behaviour

colours get merged. thus

color normal white default
color indicator brightyellow default
color index black brightyellow ~N

results in yellow on yellow for a New message with the cursor (unreadable), rather than yellow on terminal background.

Steps to Reproduce

set a non-standard terminal background colour. test above colour samples on releases before/after the 2022-04-15 version.

How often does this happen?

When did it start to happen?

NeoMutt Version

NeoMutt 20220429
Copyright (C) 1996-2022 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 6.1.0-22-amd64 (x86_64)
ncurses: ncurses 6.4.20221231 (compiled with 6.3.20220423)
libidn: 1.41 (compiled with 1.41)
GPGME: 1.18.0
GnuTLS: 3.7.8
libnotmuch: 5.6.0
storage: tokyocabinet

Configure options: --build=x86_64-linux-gnu --prefix=/usr {--includedir=${prefix}/include} {--mandir=${prefix}/share/man} {--infodir=${prefix}/share/info} --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules {--libdir=${prefix}/lib/x86_64-linux-gnu} --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --mandir=/usr/share/man --libexecdir=/usr/libexec --with-mailpath=/var/mail --gpgme --lua --notmuch --with-ui --gsasl --gnutls --gss --idn --mixmaster --tokyocabinet --sqlite --autocrypt --pkgconf

Compilation CFLAGS: -g -O2 -ffile-prefix-map=/build/neomutt-n0Dmud/neomutt-20220429+dfsg1=. -fstack-protector-strong -Wformat -Werror=format-security -std=c99 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include/lua5.4 -I/usr/include -DNCURSES_WIDECHAR -I/usr/include/p11-kit-1 -isystem /usr/include/mit-krb5

Default options:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug 
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color 
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop 
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar 
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash 

Compile options:
  +autocrypt +fcntl -flock -fmemopen +futimens +getaddrinfo +gnutls +gpgme 
  +gsasl +gss +hcache -homespool +idn +inotify -locales_hack +lua +mixmaster 
  +nls +notmuch -openssl +pgp +regex -sasl +smime +sqlite +sun_attachment 

MAILPATH="/var/mail"
MIXMASTER="mixmaster"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <neomutt-devel@neomutt.org>

Extra Info

gahr commented 1 month ago

@flatcap did a big overhaul of the colour-handling code. He'll be able to comment when he's back from vacation :)

echarlie commented 1 month ago

yup. I had to dig through the changelog. my workaround is just to set sensible background and foreground colours for indicator so I can at least read my email, but it's kinda ugly. I'd like to see a solution where "merge colours" and "use terminal foreground/background" are different directives, because I do see utility of merging all the colours together (the new behaviour).

gahr commented 1 month ago

Thanks - unfortunately I can't comment on that, my knowledge of the whole color merging logic is nil.

roccoblues commented 1 month ago

Some context already: https://github.com/neomutt/neomutt/issues/4095#issuecomment-1792748431

About 18 months ago, I made default mean transparent, everywhere. The recent colour refactoring made the checking a bit stricter.