[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 386289b 1/2: Fix 8-color PuTTY -nw sessions broken by a recent co
From: |
Eli Zaretskii |
Subject: |
master 386289b 1/2: Fix 8-color PuTTY -nw sessions broken by a recent commit |
Date: |
Thu, 11 Nov 2021 09:57:25 -0500 (EST) |
branch: master
commit 386289bdc8461898b05f318b77e0bedf2509537d
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix 8-color PuTTY -nw sessions broken by a recent commit
* src/term.c (init_tty): Fix the change which introduced support
for the terminfo Tc flag. The code as installed broke colors in
PuTTY -nw sessions, because 'tigetflag' returned -1, which is
non-zero, so it was treated as the sign that true color is
supported. But if the value returned by 'tigetflag' is -1, it means
the capability is not a boolean one, so that's not to be used as a
valid support for 24-bit color. (Bug#44950)
---
src/term.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/term.c b/src/term.c
index d86ae12..51fcef6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4155,7 +4155,7 @@ use the Bourne shell command 'TERM=...; export TERM'
(C-shell:\n\
/* Fall back to xterm+direct (semicolon version) if Tc is set
(de-facto standard introduced by tmux) or if requested by
the COLORTERM environment variable. */
- else if (tigetflag("Tc")
+ else if ((tigetflag("Tc") != -1)
|| ((bg = getenv("COLORTERM")) != NULL
&& strcasecmp(bg, "truecolor") == 0))
{