From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Wrx0NDQLTGPwPw0AWB0awg (envelope-from ) for ; Sun, 16 Oct 2022 09:46:28 -0400 Received: by simark.ca (Postfix, from userid 112) id C3B9B1E112; Sun, 16 Oct 2022 09:46:28 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=uL6RzFjc; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4D6321E0D5 for ; Sun, 16 Oct 2022 09:46:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8AD5938582A1 for ; Sun, 16 Oct 2022 13:46:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AD5938582A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665927986; bh=m6JsW6AFKTNmNHljEBiYFmiHXXQxpPaWGUJv936WCN0=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uL6RzFjcSTrZnc1cZk10M8MF5hr8QFojBT6xKFqMZPyXRTj0YcB8YG5/zdnjnIB1D CvDzVCLzx2zuM74F2cjCKlEN6mgF9RVS8H0BJ3eFobmdFYX3JD8ww8Th9mgxWZH0To 229wRXnuHlX+3xAmBHaVz+cLMP3he8APzlGxH3Ns= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 938503858D3C for ; Sun, 16 Oct 2022 13:46:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 938503858D3C Received: from fencepost.gnu.org ([2001:470:142:3::e]:45990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok3xn-0003r7-RS; Sun, 16 Oct 2022 09:45:59 -0400 Received: from [87.69.77.57] (port=1390 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok3xY-0002am-Bc; Sun, 16 Oct 2022 09:45:57 -0400 Date: Sun, 16 Oct 2022 16:45:30 +0300 Message-Id: <83mt9v51c5.fsf@gnu.org> To: Andrei Pikas In-Reply-To: <20221016114036.6246-1-gdb@mail.api.win> (message from Andrei Pikas on Sun, 16 Oct 2022 14:40:36 +0300) Subject: Re: [PATCH v4] Add an option with a color type. References: <20221016114036.6246-1-gdb@mail.api.win> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Cc: gdb@mail.api.win, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > From: Andrei Pikas > Date: Sun, 16 Oct 2022 14:40:36 +0300 > Cc: Andrei Pikas > > Colors can be specified as "none" for terminal's default color, as a name of > one of the eight standard colors of ISO/IEC 6429 "black", "red", "green", etc., > as an RGB hexadecimal tripplet #RRGGBB for 24-bit TrueColor, or as an > integer from 0 to 255. Integers 0 to 7 are the synonyms for the standard > colors. Integers 8-15 are used for the so-called bright colors from the > aixterm extended 16-color palette. Integers 16-255 are the indexes into xterm > extended 256-color palette (usually 6x6x6 cube plus gray ramp). In > general, 256-color palette is terminal dependent and sometimes can be > changed with OSC 4 sequences, e.g. "\033]4;1;rgb:00/FF/00\033\\". > > It is the responsibility of the user to verify that the terminal supports > the specified colors. Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index d2efe2a0a58..00173c09227 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS The NEWS part is OK. > +@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 Please follow "E.g." either by a comma or by @:, so that TeX wouldn't mistakenly decide that the sentence ends there, and typeset it accordingly. > @table @code > @item set style filename background @var{color} > -Set the background to @var{color}. Valid colors are @samp{none} > -(meaning the terminal's default color), @samp{black}, @samp{red}, > -@samp{green}, @samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan}, > -and@samp{white}. > +Set the background to @var{color}. @var{color} can be @samp{none} > +(meaning the terminal's default color), a name of one of the eight standard > +colors of ISO/IEC 6429, index from 0 to 255 into terminal's color > +palette or a hexadecimal RGB triplet in @samp{#RRGGBB} format for > +24-bit TrueColor. > + > +Valid color names are @samp{black}, @samp{red}, @samp{green}, > +@samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan}, and > +@samp{white}. > + > +Integers 0 to 7 are the synonyms for the standard colors. Integers 8-15 are > +used for the so-called bright colors from the aixterm extended 16-color > +palette. Integers 16-255 are the indexes into xterm extended 256-color palette > +(usually 6x6x6 cube plus gray ramp). In general, 256-color palette is terminal > +dependent and sometimes can be changed with OSC 4 sequences, e.g. > +"\033]4;1;rgb:00/FF/00\033\\". > + > +It is the responsibility of the user to verify that the terminal supports > +the specified colors. > > @item set style filename foreground @var{color} > -Set the foreground to @var{color}. Valid colors are @samp{none} > -(meaning the terminal's default color), @samp{black}, @samp{red}, > -@samp{green}, @samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan}, > -and@samp{white}. > +Set the foreground to @var{color}. @var{color} can be @samp{none} > +(meaning the terminal's default color), a name of one of the eight standard > +colors of ISO/IEC 6429, index from 0 to 255 into terminal's color > +palette or a hexadecimal RGB triplet in @samp{#RRGGBB} format for > +24-bit TrueColor. > + > +Valid color names are @samp{black}, @samp{red}, @samp{green}, > +@samp{yellow}, @samp{blue}, @samp{magenta}, @samp{cyan}, and > +@samp{white}. > + > +Integers 0 to 7 are the synonyms for the standard colors. Integers 8-15 are > +used for the so-called bright colors from the aixterm extended 16-color > +palette. Integers 16-255 are the indexes into xterm extended 256-color palette > +(usually 6x6x6 cube plus gray ramp). In general, 256-color palette is terminal > +dependent and sometimes can be changed with OSC 4 sequences, e.g. > +"\033]4;1;rgb:00/FF/00\033\\". > + > +It is the responsibility of the user to verify that the terminal supports > +the specified colors. This includes the same text twice very close to one another. I suggest to leave only the first part, and for "set style filename foreground" just say that the COLOR can be given in the same ways as for the background. > +@deffn {Scheme Procedure} color-escape-sequence color is_foreground > +Return string to change terminal's color to this. > + > +@var{is_foreground} if this color should be applied to foreground or background The last sentence reads strangely and seems incomplete: did you perhaps forgot some words there? > +@defun Color.escape_sequence (@var{self}, @var{is_foreground}) > +Returns string to change terminal's color to this. > + > +@var{is_foreground} if this color should be applied to foreground or background > +@end defun Same here. > +@findex COLORSPACE_XTERM_256COLOR > +@findex gdb.COLORSPACE_XTERM_256COLOR > +@item gdb.COLORSPACE_XTERM_256COLOR > +Palette with 256 colors. First 16 are from COLORSPACE_AIXTERM_16COLOR. Next > +216 colors are 6x6x6 RGB cube. And last 24 colors forms grayscale ramp. ^^^^^ "form", in plural. Thanks.