From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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> From: Eli Zaretskii To: Andrei Pikas Cc: gdb-patches@sourceware.org, gdb@mail.api.win 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-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Sun, 16 Oct 2022 13:46:08 -0000 > 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.