Re: color by default

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>, Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: color by default
Date: 2020-03-29 09:56:15
Message-ID: 2fa9de54-68cd-b29f-1ed1-b6fea806039a@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-03-26 07:36, Michael Paquier wrote:
> I am not sure that deleting all the mentions would be a good idea, as
> we'd lose track of which tool supports coloring or not, and that could
> confuse users. What about switching the existing paragraph to a
> simple sentence with a link to the new appendix you are adding? Say:
> "pg_foo supports <place_your_link_here>colorized output</>".

I didn't do this because it would create additional complications in the
man pages. But there is now an index entry, so it's possible to find
more information.

>> + <para>
>> + The actual colors to be used are configured using the environment variable
>> + <envar>PG_COLORS</envar><indexterm><primary>PG_COLORS</primary></indexterm>
>> + (note plural). The value is a colon-separated list of
>> + <literal><replaceable>key</replaceable>=<replaceable>value</replaceable></literal>
>> + pairs. The keys specify what the color is to be used for. The values are
>> + SGR (Select Graphic Rendition) specifications, which are interpreted by the
>> + terminal.
>> + </para>
>
> A reference to SGR to understand better what's the list of values
> supported would be nice?

I'm not sure how to do that. The full list of possible values is huge,
and exactly what is supported depends on the terminal.

>> + <para>
>> + The default value is <literal>error=01;31:warning=01;35:locus=01</literal>.
>> + </para>
>
> Could it be possible to have more details about what those three
> fields map to?

I have added information about that and explained the example values. I
think if you search for "Select Graphic Rendition" and look for the
example values, you can make sense of this.

Committed with those changes. This closes the commit fest item.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-03-29 09:56:51 Re: color by default
Previous Message Jürgen Purtz 2020-03-29 09:29:50 Re: Add A Glossary