git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Coloring
@ 2017-05-31 18:33 Irving Rabin
  2017-05-31 19:07 ` Coloring Samuel Lijin
  2017-05-31 21:04 ` Coloring Jeff King
  0 siblings, 2 replies; 5+ messages in thread
From: Irving Rabin @ 2017-05-31 18:33 UTC (permalink / raw)
  To: git

Folks, I am reporting an issue with coloring of the output of Git
commands, like status, diff, etc.

Specifically, if the field is supposed to be white, it doesn't mean it
should be literally 0xFFFFFF. It should be the color that I have
configured as White color for my console emulator.

I like light-screen terminals, and I configure my ANSI colors in the
way that they are clearly visible on the background and clearly
distinct between themselves. In my terminal settings background is
light-yellow, Black is black, Yellow is brown, Red is dark red,
Magenta is purple and White is dark gray. I set it once and I can use
it everywhere - all Unix commands work correctly, I can edit
highlighted source code in Vim, and all my color settings are
respected.

However Git behaves differently. When I run git diff, some of the
output is literally white on light yellow background. It is like "we
know what is White, so we ignore your settings". And it is quite
irritating.

Is there a way to make Git respect terminal settings and not to
override them with absolute colors? If so, please advise. If not, then
I guess it is a bug to fix, right?

Thanks,
Irving Rabin
Software Developer @Edmodo
408-242-1299

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coloring
  2017-05-31 18:33 Coloring Irving Rabin
@ 2017-05-31 19:07 ` Samuel Lijin
  2017-05-31 21:04 ` Coloring Jeff King
  1 sibling, 0 replies; 5+ messages in thread
From: Samuel Lijin @ 2017-05-31 19:07 UTC (permalink / raw)
  To: Irving Rabin; +Cc: git@vger.kernel.org

On Wed, May 31, 2017 at 2:33 PM, Irving Rabin <irving@edmodo.com> wrote:
>
> Folks, I am reporting an issue with coloring of the output of Git
> commands, like status, diff, etc.
>
> Specifically, if the field is supposed to be white, it doesn't mean it
> should be literally 0xFFFFFF. It should be the color that I have
> configured as White color for my console emulator.
>
> I like light-screen terminals, and I configure my ANSI colors in the
> way that they are clearly visible on the background and clearly
> distinct between themselves. In my terminal settings background is
> light-yellow, Black is black, Yellow is brown, Red is dark red,
> Magenta is purple and White is dark gray. I set it once and I can use
> it everywhere - all Unix commands work correctly, I can edit
> highlighted source code in Vim, and all my color settings are
> respected.

Can you elaborate on how it is that you redefine your terminal color
scheme? There are multiple levels at which you can do that, which will
have some bearing on the answer.

> However Git behaves differently. When I run git diff, some of the
> output is literally white on light yellow background. It is like "we
> know what is White, so we ignore your settings". And it is quite
> irritating.
>
> Is there a way to make Git respect terminal settings and not to
> override them with absolute colors? If so, please advise. If not, then
> I guess it is a bug to fix, right?
>
> Thanks,
> Irving Rabin
> Software Developer @Edmodo
> 408-242-1299

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coloring
  2017-05-31 18:33 Coloring Irving Rabin
  2017-05-31 19:07 ` Coloring Samuel Lijin
@ 2017-05-31 21:04 ` Jeff King
  2017-05-31 21:10   ` Coloring Irving Rabin
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff King @ 2017-05-31 21:04 UTC (permalink / raw)
  To: Irving Rabin; +Cc: git

On Wed, May 31, 2017 at 11:33:31AM -0700, Irving Rabin wrote:

> Specifically, if the field is supposed to be white, it doesn't mean it
> should be literally 0xFFFFFF. It should be the color that I have
> configured as White color for my console emulator.
> 
> I like light-screen terminals, and I configure my ANSI colors in the
> way that they are clearly visible on the background and clearly
> distinct between themselves. In my terminal settings background is
> light-yellow, Black is black, Yellow is brown, Red is dark red,
> Magenta is purple and White is dark gray. I set it once and I can use
> it everywhere - all Unix commands work correctly, I can edit
> highlighted source code in Vim, and all my color settings are
> respected.

Git outputs ANSI color codes, which are interpreted by your terminal.
You _can_ configure Git to send 24-bit color codes if your terminal
supports it, but by default it uses the traditional set of limited color
and attribute codes.

What does running the following snippet in your shell look like?

-- >8 --

while read name code; do
	printf '\033[%sm%s\033[m\n' "$code" "$name"
done <<-\EOF
normal
bold 1
red 31
green 32
yellow 33
blue 34
magenta 35
cyan 36
bold-red 1;31
bold-green 1;32
bold-yellow 1;33
bold-blue 1;34
bold-magenta 1;35
bold-cyan 1;36
EOF

-- 8< --

If any of the colors are not what you expect, is there a pattern? E.g.,
I wouldn't be surprised if "bold" shows up as bright white. In many
modern terminal emulators, the bold variants need to be configured
separately from the non-bold ones, and default to lighter variants of
their non-bold counterparts. The solution there would be to check your
terminal emulator config.

If it does all look as you'd expect, try adding "| less -R" to the end of
the "done <<-\EOF" line. Most of Git's output goes through that pager
(though I _think_ it's mostly just passing through the ANSI codes, so it
wouldn't have any effect).

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coloring
  2017-05-31 21:04 ` Coloring Jeff King
@ 2017-05-31 21:10   ` Irving Rabin
  2017-05-31 21:22     ` Coloring Samuel Lijin
  0 siblings, 1 reply; 5+ messages in thread
From: Irving Rabin @ 2017-05-31 21:10 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Thanks Jeff, my problem has been resolved by Samuel Lijin.
My terminal settings didn't set bold which remained white. I fixed it
and my problem was gone!
This issue is closed. Is there any way to retire it?
Irving Rabin
Software Developer @Edmodo
408-242-1299





On Wed, May 31, 2017 at 2:04 PM, Jeff King <peff@peff.net> wrote:
> On Wed, May 31, 2017 at 11:33:31AM -0700, Irving Rabin wrote:
>
>> Specifically, if the field is supposed to be white, it doesn't mean it
>> should be literally 0xFFFFFF. It should be the color that I have
>> configured as White color for my console emulator.
>>
>> I like light-screen terminals, and I configure my ANSI colors in the
>> way that they are clearly visible on the background and clearly
>> distinct between themselves. In my terminal settings background is
>> light-yellow, Black is black, Yellow is brown, Red is dark red,
>> Magenta is purple and White is dark gray. I set it once and I can use
>> it everywhere - all Unix commands work correctly, I can edit
>> highlighted source code in Vim, and all my color settings are
>> respected.
>
> Git outputs ANSI color codes, which are interpreted by your terminal.
> You _can_ configure Git to send 24-bit color codes if your terminal
> supports it, but by default it uses the traditional set of limited color
> and attribute codes.
>
> What does running the following snippet in your shell look like?
>
> -- >8 --
>
> while read name code; do
>         printf '\033[%sm%s\033[m\n' "$code" "$name"
> done <<-\EOF
> normal
> bold 1
> red 31
> green 32
> yellow 33
> blue 34
> magenta 35
> cyan 36
> bold-red 1;31
> bold-green 1;32
> bold-yellow 1;33
> bold-blue 1;34
> bold-magenta 1;35
> bold-cyan 1;36
> EOF
>
> -- 8< --
>
> If any of the colors are not what you expect, is there a pattern? E.g.,
> I wouldn't be surprised if "bold" shows up as bright white. In many
> modern terminal emulators, the bold variants need to be configured
> separately from the non-bold ones, and default to lighter variants of
> their non-bold counterparts. The solution there would be to check your
> terminal emulator config.
>
> If it does all look as you'd expect, try adding "| less -R" to the end of
> the "done <<-\EOF" line. Most of Git's output goes through that pager
> (though I _think_ it's mostly just passing through the ANSI codes, so it
> wouldn't have any effect).
>
> -Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Coloring
  2017-05-31 21:10   ` Coloring Irving Rabin
@ 2017-05-31 21:22     ` Samuel Lijin
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Lijin @ 2017-05-31 21:22 UTC (permalink / raw)
  To: Irving Rabin; +Cc: Jeff King, git@vger.kernel.org

On Wed, May 31, 2017 at 5:10 PM, Irving Rabin <irving@edmodo.com> wrote:
>
> Thanks Jeff, my problem has been resolved by Samuel Lijin.
> My terminal settings didn't set bold which remained white. I fixed it
> and my problem was gone!

Specifically, Irving's terminal rendered bold text as white. No bug here :)

> This issue is closed. Is there any way to retire it?

That's pretty much it.

> Irving Rabin
> Software Developer @Edmodo
> 408-242-1299
>
>
>
>
>
> On Wed, May 31, 2017 at 2:04 PM, Jeff King <peff@peff.net> wrote:
> > On Wed, May 31, 2017 at 11:33:31AM -0700, Irving Rabin wrote:
> >
> >> Specifically, if the field is supposed to be white, it doesn't mean it
> >> should be literally 0xFFFFFF. It should be the color that I have
> >> configured as White color for my console emulator.
> >>
> >> I like light-screen terminals, and I configure my ANSI colors in the
> >> way that they are clearly visible on the background and clearly
> >> distinct between themselves. In my terminal settings background is
> >> light-yellow, Black is black, Yellow is brown, Red is dark red,
> >> Magenta is purple and White is dark gray. I set it once and I can use
> >> it everywhere - all Unix commands work correctly, I can edit
> >> highlighted source code in Vim, and all my color settings are
> >> respected.
> >
> > Git outputs ANSI color codes, which are interpreted by your terminal.
> > You _can_ configure Git to send 24-bit color codes if your terminal
> > supports it, but by default it uses the traditional set of limited color
> > and attribute codes.
> >
> > What does running the following snippet in your shell look like?
> >
> > -- >8 --
> >
> > while read name code; do
> >         printf '\033[%sm%s\033[m\n' "$code" "$name"
> > done <<-\EOF
> > normal
> > bold 1
> > red 31
> > green 32
> > yellow 33
> > blue 34
> > magenta 35
> > cyan 36
> > bold-red 1;31
> > bold-green 1;32
> > bold-yellow 1;33
> > bold-blue 1;34
> > bold-magenta 1;35
> > bold-cyan 1;36
> > EOF
> >
> > -- 8< --
> >
> > If any of the colors are not what you expect, is there a pattern? E.g.,
> > I wouldn't be surprised if "bold" shows up as bright white. In many
> > modern terminal emulators, the bold variants need to be configured
> > separately from the non-bold ones, and default to lighter variants of
> > their non-bold counterparts. The solution there would be to check your
> > terminal emulator config.
> >
> > If it does all look as you'd expect, try adding "| less -R" to the end of
> > the "done <<-\EOF" line. Most of Git's output goes through that pager
> > (though I _think_ it's mostly just passing through the ANSI codes, so it
> > wouldn't have any effect).
> >
> > -Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-31 21:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 18:33 Coloring Irving Rabin
2017-05-31 19:07 ` Coloring Samuel Lijin
2017-05-31 21:04 ` Coloring Jeff King
2017-05-31 21:10   ` Coloring Irving Rabin
2017-05-31 21:22     ` Coloring Samuel Lijin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).