From: Eli Zaretskii <eliz@gnu.org>
To: Andrei Pikas <gdb@mail.api.win>
Cc: tom@tromey.com, gdb-patches@sourceware.org
Subject: Re: [PATCH v7] Add an option with a color type.
Date: Sat, 05 Oct 2024 22:40:20 +0300 [thread overview]
Message-ID: <86ttdquymz.fsf@gnu.org> (raw)
In-Reply-To: <0f744f95-372b-48e2-b1f9-5f8dfc47c5b0@mail.api.win> (message from Andrei Pikas on Sat, 5 Oct 2024 22:11:12 +0300)
> Date: Sat, 5 Oct 2024 22:11:12 +0300
> Cc: tom@tromey.com, gdb-patches@sourceware.org
> From: Andrei Pikas <gdb@mail.api.win>
>
> > Regardless, were these changes tested in the MinGW port of GDB? It
> > emulates Posix terminal handling of colors via SGR escape sequences,
> > and I wonder whether these changes might somehow break styling support
> > in the MinGW port.
> No, I can't build gdb with MinGW.
> The same escape sequences \033[30m ... \033[37m will be used
> for the basic eight colors as before. This patch only adds the possibility
> for the user to setup another colors in addition to the basic. But they
> are not used by default, so the styling will not be broken.
And if the user wants to add a color, what do they need to do after
these changes?
> > +@item $_colorsupport
> > +@vindex $_colorsupport@r{, convenience variable}
> > +Comma-separated list of color space names supported by terminal. Names could
> > +be any of @samp{monochrome}, @samp{ansi_8color}, @samp{aixterm_16color},
> > +@samp{xterm_256color}, @samp{rgb_24bit}. E.g., for plain linux terminal the
> > +value could be @samp{monochrome,ansi_8color} and for terminal with truecolor
> > +support it could be
> > +@samp{monochrome,ansi_8color,aixterm_16color,xterm_256color,rgb_24bit}.
> > What does this return for the MS-Windows terminal? aixterm_16color?
> > IOW, will any 16-color terminal return aixterm_16color? I think this
> > should be documented, and perhaps we should remove the "aix" part from
> > the name (since it is not necessarily specific to AIX).
> tgetnum("Co") returns 8 in msys and 256 in cmd.exe because
> TERM=xterm in msys and TERM is unset in cmd.exe.
> When I set TERM=xterm or set TERM=ansi it returns 8.
But the MS-Windows console supports 16 colors, not 8.
> monochrome color space is enabled always.
> ansi_8color is enabled when tgetnum("Co") returns >= 8.
> aixterm_16color is enabled when tgetnum("Co") returns >= 16.
> xterm_256color is enabled when tgetnum("Co") returns >= 256.
> rgb_24bit is enabled when COLORTERM=truecolor or 24bit.
> I will document that it depends on "Co" termcap, TERM and COLORTERM
> in the next patch version.
The "Co" capability on Windows is emulated, as Windows doesn't really
support this stuff. So relying on what you get from tgetnum in
various cases, like with MSYS, will likely produce results you cannot
rely upon.
> I don't think that "aix" part should be removed. Because there is no
> standard
> for the escape sequences \033[90m ... \033[97m. They where first used in the
> aixterm and it is the only way to refer them unambiguously. Any other
> terminal
> in theory may invent it's own 16 colors and escape sequences for them.
Then I guess we will need a new name for the Windows terminal?
next prev parent reply other threads:[~2024-10-05 19:40 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-16 11:40 [PATCH v4] " Andrei Pikas
2022-10-16 13:45 ` Eli Zaretskii via Gdb-patches
2022-10-16 16:03 ` [PATCH v5] " Andrei Pikas
2022-10-16 16:22 ` Eli Zaretskii via Gdb-patches
2022-10-16 16:28 ` [PATCH v6] " Andrei Pikas
2022-10-16 16:45 ` Eli Zaretskii via Gdb-patches
2024-04-19 19:33 ` Tom Tromey
2024-04-19 19:52 ` Andrei Pikas
2024-04-19 20:19 ` Tom Tromey
2024-04-20 18:24 ` Tom Tromey
2024-04-20 18:32 ` Andrei Pikas
2024-05-11 15:17 ` Andrei Pikas
2024-05-13 19:02 ` Tom Tromey
2024-05-21 9:00 ` Andrei Pikas
2024-09-13 20:16 ` Tom Tromey
2024-09-14 18:06 ` Andrei Pikas
2024-09-14 19:38 ` Tom Tromey
2024-09-14 19:43 ` Andrei Pikas
2024-09-14 19:04 ` [PATCH v7] " Andrei Pikas
2024-09-15 5:37 ` Eli Zaretskii
2024-10-05 19:11 ` Andrei Pikas
2024-10-05 19:40 ` Eli Zaretskii [this message]
2024-10-04 17:55 ` Tom Tromey
2024-10-05 17:55 ` Andrei Pikas
2024-10-05 19:27 ` [PATCH v8] " Andrei Pikas
2024-10-06 5:40 ` Eli Zaretskii
2024-12-13 21:01 ` Tom Tromey
2024-12-13 21:23 ` Andrei Pikas
2024-12-14 7:59 ` Eli Zaretskii
2025-01-12 20:34 ` Tom Tromey
2025-02-03 16:23 ` Tom de Vries
2025-02-04 0:24 ` Tom Tromey
2025-02-04 14:24 ` Tom de Vries
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=86ttdquymz.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=gdb@mail.api.win \
--cc=tom@tromey.com \
/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