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

Re: [PATCH 2/2] color: support "default" to restore fg/bg color

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 25, 2021, 22:39 UTC
Message-ID
<YXcyJBmRvIEVSiaM@camp.crustytoothpaste.net>
In-Reply-To
<504da32a95bd4a1e4368aca68b609387316ea671.1635201156.git.gitgitgadget@gmail.com>
On 2021-10-25 at 22:32:36, Robert Estelle via GitGitGadget wrote:
Show 16 quoted lines
> From: Robert Estelle <robertestelle@gmail.com>
> 
> The name "default" can now be used in foreground or background colors,
> and means to use the terminal's default color, discarding any
> explicitly-set color without affecting the other attributes. On many
> modern terminals, this is *not* the same as specifying "white" or
> "black".
> 
> Although attributes could previously be cleared like "no-bold", there
> had not been a similar mechanism available for colors, other than a full
> "reset", which cannot currently be combined with other settings.
> 
> Note that this is *not* the same as the existing name "normal", which is
> a no-op placeholder to permit setting the background without changing
> the foreground. (i.e. what is currently called "normal" might have been
> more descriptively named "inherit", "none", "pass" or similar).

I can't speak to whether this is correct, although you did mention the standard, so I assume it is, but I do think this is a good feature to have and the patch seems sane to me. Patch 2 also looked good here.

For an example of why this differs from white on black, let me mention that I use a semi-transparent terminal, where a black background is opaque black, and the default is semi-transparent. I assume other possibilities include patterned backgrounds (Enlightenment, anyone?). Whether you want to include something to this effect in the commit message is up to you, but I provide it for the interested reader.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Robert Estelle via GitGitGadgetNext: Junio C Hamano
Message 4 of 8 in “color: support "default" to restore fg/bg color”
  1. 0/2 color: support "default" to restore fg/bg colorRobert Estelle via GitGitGadget, Oct 25, 2021
  2. 1/2 color: add missing GIT_COLOR_* white/black constantsRobert Estelle via GitGitGadget, Oct 25, 2021
  3. 2/2 color: support "default" to restore fg/bg colorRobert Estelle via GitGitGadget, Oct 25, 2021
  4. brian m. carlsonOct 25, 2021
  5. Junio C HamanoOct 25, 2021
  6. Robert EstelleOct 26, 2021
  7. Junio C HamanoOct 28, 2021
  8. Robert EstelleOct 28, 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.