From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gCJGA0OWAWfUhgIAWB0awg (envelope-from ) for ; Sat, 05 Oct 2024 15:40:51 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=pwca+OEM; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 076CE1E355; Sat, 5 Oct 2024 15:40:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B42BF1E05C for ; Sat, 5 Oct 2024 15:40:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 40DF2385EC17 for ; Sat, 5 Oct 2024 19:40:49 +0000 (GMT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id F09F73858D20 for ; Sat, 5 Oct 2024 19:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F09F73858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F09F73858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728157226; cv=none; b=O/VaHw1aYKmaKBzxRAdZG/OKlkYVmb2uY1mM5e1nCEsG75QraEpLUUgOvwGNcEXKAtHm/lCXsZ5EgLrLKCwvdC/6gCOHXRHTRp8SqXn+Gkfi8EhsXx9KY6pd0RoqlWvCICXeRf57/rFFbzry9hGY33NBnc7IJeQZIq0sz9YMG7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728157226; c=relaxed/simple; bh=yfxrdfziCYNBrpjLOCFuMOEhIwDpjLkTaxHCcdVuUIo=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=BE30VDbBP6umH/sH6X3H8yBd8HjAdwUxPrIfsYhKFnhWpmLHksoIawZrrUKh8XI9alGwvQZNv+03V53Y6/4yK+cSNtGRYzFy5sTwpAMFV53aWmHyy5PlKLL0uZUFXLWM/5aYc0YagEQg421herNZZKLLJV5/AbJ/GG7DKWqBVPs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxAda-0006iC-I7; Sat, 05 Oct 2024 15:40:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Gicu08Zv6gqYmn8cVNl1kiAFsoCc8lO1feA5TYf/Xe8=; b=pwca+OEMOKfr cLaBBQghTdbeyL5r8PnByqa1tXvBM2ywnf5XjcZFrN5RVKkKnCrKNSkjMSx1IpOzKWlk3ymwXHXxz 9vGpDUIZL/fHRVZtKHgztSTjfQlOSQOnctxWceUE7GMYgl2ajoWOAjYD71DcDVw0bJvWWtoG+JwZ4 pkFI6m4m2s5Bhjql2lPWjxGnLHEL1HPbM6Bpw0ht0wQzs1g6R/L795B9SnXwIp/4psOY/TIMbLka8 2S8eabUe5M/I2EiNL1bdE+tNOmzbWyd7iFSrBlTbrY5kyMSKhGCml+gRCYAjDqFm42f//ntZxDmUc hmTv4rSs2YEATqNDr1HFoA==; Date: Sat, 05 Oct 2024 22:40:20 +0300 Message-Id: <86ttdquymz.fsf@gnu.org> From: Eli Zaretskii To: Andrei Pikas Cc: tom@tromey.com, gdb-patches@sourceware.org In-Reply-To: <0f744f95-372b-48e2-b1f9-5f8dfc47c5b0@mail.api.win> (message from Andrei Pikas on Sat, 5 Oct 2024 22:11:12 +0300) Subject: Re: [PATCH v7] Add an option with a color type. References: <87mskb1f83.fsf@tromey.com> <20240914190452.423367-1-gdb@mail.api.win> <86seu1eav1.fsf@gnu.org> <0f744f95-372b-48e2-b1f9-5f8dfc47c5b0@mail.api.win> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > Date: Sat, 5 Oct 2024 22:11:12 +0300 > Cc: tom@tromey.com, gdb-patches@sourceware.org > From: Andrei Pikas > > > 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?