From c71978c0b3398c0b7cd58b2f7aea7dd582ecb32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 23 May 2026 12:01:21 +0200 Subject: [PATCH] core: fix option weechat.look.color_real_white not applied when color is "white" on 16+ colors terminals (closes #1742) --- CHANGELOG.md | 1 + src/gui/curses/gui-curses-window.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9db20bac0..75f1a63e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ SPDX-License-Identifier: GPL-3.0-or-later ### Fixed +- core: fix option weechat.look.color_real_white not applied when color is "white" on 16+ colors terminals ([#1742](https://github.com/weechat/weechat/issues/1742)) - fset: remove error displayed in core buffer when clicking with the mouse below the last option displayed ## Version 4.9.0 (2026-03-29) diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index b9857fea9..dfc3a2412 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -373,7 +373,8 @@ gui_window_set_weechat_color (WINDOW *window, int num_color) * if not real white, we use default terminal foreground instead of * white if bold attribute is set */ - if ((fg == COLOR_WHITE) && (gui_color[num_color]->attributes & A_BOLD) + if (((fg == COLOR_WHITE + 8) + || ((fg == COLOR_WHITE) && (gui_color[num_color]->attributes & A_BOLD))) && !CONFIG_BOOLEAN(config_look_color_real_white)) { fg = -1; @@ -443,7 +444,8 @@ gui_window_set_custom_color_fg (WINDOW *window, int fg) * if not real white, we use default terminal foreground instead of * white if bold attribute is set */ - if ((fg == COLOR_WHITE) && (attributes & A_BOLD) + if (((fg == COLOR_WHITE + 8) + || ((fg == COLOR_WHITE) && (attributes & A_BOLD))) && !CONFIG_BOOLEAN(config_look_color_real_white)) { fg = -1; @@ -536,7 +538,8 @@ gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg, * if not real white, we use default terminal foreground instead of * white if bold attribute is set */ - if ((fg == COLOR_WHITE) && (attributes & A_BOLD) + if (((fg == COLOR_WHITE + 8) + || ((fg == COLOR_WHITE) && (attributes & A_BOLD))) && !CONFIG_BOOLEAN(config_look_color_real_white)) { fg = -1;