Subject: Re: Man pages have colors? A deep dive into groff

From: Junio C Hamano <[email-masked]>
Date: Tue, 18 May 2021 23:27:33 +0900

Jeff King <[email-masked]> writes:

> On Mon, May 17, 2021 at 11:27:23PM -0500, Felipe Contreras wrote:
>
>> > So in short, the color.pager is about "is the pager capable of
>> > colors?"
>> 
>> That's not the case.
>> 
>> Even the documentation says so:
>> 
>>   color.pager::
>>     A boolean to enable/disable colored output when the pager is in
>>     use (default is true).
>
> I think that documentation misses the reason you'd want to use it.

Thanks for digging and I agree that this one is quite bad---no
wonder it misled to the "why not color.pager?" question.

The configuration is solely used to disable (because it defaults to
true) colors when pager is in use and the configurations on the
application side (i.e. color.ui and friends) specify "auto".  We
should update the description.

> And so likewise, we would want to avoid turning on colors if the user
> has set color.pager=false. Usually this is done automatically because
> want_color() checks, which knows if we are using the pager or not.