git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] color: allow colors to be prefixed with "reset"

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 26, 2021, 21:42 UTC
Message-ID
<xmqqee87xy39.fsf@gitster.g>
In-Reply-To
<pull.1117.git.git.1635210227532.gitgitgadget@gmail.com>
"Robert Estelle via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 21 quoted lines
> From: Robert Estelle <robertestelle@gmail.com>
>
> "reset" was previously treated as a standalone special color name
> representing `\e[m`. Now, it can apply to other color properties,
> allowing exact specifications without implicit attribute inheritance.
>
> For example, "reset green" now renders `\e[;32m`, which is interpreted
> as "reset everything; then set foreground to green". This means the
> background and other attributes are also reset to their defaults.
>
> Previously, this was impossible to represent in a single color:
> "reset" could be specified alone, or a color with attributes, but some
> thing like clearing a background color were impossible.
>
> There is a separate change that introduces the "default" color name to
> assist with that, but even then, the above could only to be represented
> by explicitly disabling each of the attributes:
>   green default no-bold no-dim no-italic no-ul no-blink no-reverse no-strike
>
> Signed-off-by: Robert Estelle <robertestelle@gmail.com>
> ---

Unlike the "default" patch, I quite do not see the point of the example(s). Instead of saying "reset green", can't we already say "set bg to default, and set fg to green", thanks to the other one? Or does "default" do too little to deserve a name that implies "go back to default", e.g. by not defeating the 'blink' attribute that was set earlier?

Previous: Robert Estelle via GitGitGadgetNext: Robert Estelle
Message 2 of 3 in “color: allow colors to be prefixed with "reset"”
  1. color: allow colors to be prefixed with "reset"Robert Estelle via GitGitGadget, Oct 26, 2021
  2. Junio C HamanoOct 26, 2021
  3. Robert EstelleOct 27, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.