threads / bug / 53885

BUG: Cannot use bright colors

Subject: BUG: Cannot use bright colors

## tl;dr

3 messages between Jul 20, 2020 and Jul 20, 2020.

replies: 2people: 3as markdown or json

Martian Chronicles· Jul 20, 2020, 16:29 UTC · lore
Cannot configure git to use brightred, neither on Windows nor on Ubuntu. 
Steps to reproduce: 
1. Create ~/.gitconfig with the two lines (or add to them to this file, if it exists):
[color.status]
        untracked = brightred
2. run `git status` from a directory with untracked files
Expected: output in brightred
Actual on Linux:
error: invalid color value: brightred fatal: bad config variable 'color.status.untracked' in file '/home/<username>/.gitconfig' at line 2 
Actual on windows:
 brightred=normal=white.
SZEDER Gábor· Jul 20, 2020, 16:55 UTC · re: Martian Chronicles · lore

Re: BUG: Cannot use bright colors

On Mon, Jul 20, 2020 at 07:29:52PM +0300, Martian Chronicles wrote:
Show 17 quoted lines
> Cannot configure git to use brightred, neither on Windows nor on Ubuntu. 
> 
> Steps to reproduce: 
> 
> 1. Create ~/.gitconfig with the two lines (or add to them to this file, if it exists):
> 
> [color.status]
>         untracked = brightred
> 
> 2. run `git status` from a directory with untracked files
> 
> Expected: output in brightred
> Actual on Linux:
> error: invalid color value: brightred fatal: bad config variable 'color.status.untracked' in file '/home/<username>/.gitconfig' at line 2 
> 
> Actual on windows:
>  brightred=normal=white.

Bright colors are supported since v2.26.0. What Git version did you try?

Jeff King· Jul 20, 2020, 17:13 UTC · re: SZEDER Gábor · lore

Re: BUG: Cannot use bright colors

On Mon, Jul 20, 2020 at 06:55:35PM +0200, SZEDER Gábor wrote:
Show 21 quoted lines
> On Mon, Jul 20, 2020 at 07:29:52PM +0300, Martian Chronicles wrote:
> > Cannot configure git to use brightred, neither on Windows nor on Ubuntu. 
> > 
> > Steps to reproduce: 
> > 
> > 1. Create ~/.gitconfig with the two lines (or add to them to this file, if it exists):
> > 
> > [color.status]
> >         untracked = brightred
> > 
> > 2. run `git status` from a directory with untracked files
> > 
> > Expected: output in brightred
> > Actual on Linux:
> > error: invalid color value: brightred fatal: bad config variable 'color.status.untracked' in file '/home/<username>/.gitconfig' at line 2 
> > 
> > Actual on windows:
> >  brightred=normal=white.
> 
> Bright colors are supported since v2.26.0.  What Git version did you
> try?

It sounds like two different versions. :) If Git isn't complaining about the color name on Windows, then it's probably sending out the correct ANSI codes. But whether those do anything you can see depends on your terminal emulator. I don't know what options there are on Windows.

For the Windows console, there's an extra stdio layer that handles these ANSI codes. It looks like compat/mingw.c's set_attr() would need to be updated, but from reading it, I'm not sure it would even support these extra colors. Probably "bold red" is the best you could do.

-Peff

← back to recent threads