From: Andrew Burgess <aburgess@redhat.com>
To: jakob.schaeffeler@tum.de, gdb-patches@sourceware.org
Cc: "Jakob Schäffeler" <jakob.schaeffeler@tum.de>
Subject: Re: [PATCH v2] gdb/tui: Fix unexpected reuse of color pairs
Date: Tue, 21 Jul 2026 12:09:35 +0100 [thread overview]
Message-ID: <87ldb4ppjk.fsf@redhat.com> (raw)
In-Reply-To: <20260509212744.2071791-1-jakob.schaeffeler@tum.de>
jakob.schaeffeler@tum.de writes:
> From: Jakob Schäffeler <jakob.schaeffeler@tum.de>
>
> TUI translates ANSI styling sequences to curses color pairs.
> Currently, this process uses COLOR_PAIR, which only returns values
> from 0 to 255 which results in unexpected reuse of color pairs.
> This patch avoids calling COLOR_PAIR(pair) to be able to
> render more than 256 color pairs.
> For this, the wattron call is replaced with wcolor_set.
> This also results in last_color_pair no longer being needed since we
> set the color directly with wcolor_set and do not need
> wattron/off pairs any longer.
> This results in SHRT_MAX different color pairs to be available.
> To get all 65535 color pairs, init_pair is replaced with
> init_extended_pair, which takes an int instead of a short.
> Since this is not available with ncurses versions older than 6.1,
> a configure check was added.
> This patch was tested with make check-gdb TESTS="gdb.tui/*.exp"
> Additionally, I tested this with the python extension from the
> bug report.
Thank you for the revisions. I fixed a trailing white space issue in
the code, and reworded the commit message a bit to (I think) make some
things clearer. I then pushed this patch.
I did look at possibly using the Python code from the bug to create a
test case, but that will require extending GDB's terminal emulation to
support the extended set of colours, which feels like a big task, so I
left that for now.
Thanks,
Andrew
prev parent reply other threads:[~2026-07-21 11:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 8:03 [PATCH] " jakob.schaeffeler
2026-05-08 9:23 ` Andrew Burgess
2026-05-08 9:55 ` Jakob Schäffeler
2026-07-20 11:19 ` Jakob Schäffeler
2026-05-09 21:27 ` [PATCH v2] " jakob.schaeffeler
2026-07-21 11:09 ` Andrew Burgess [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ldb4ppjk.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jakob.schaeffeler@tum.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox