Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform - Mailing list pgsql-hackers

From Juan José Santamaría Flecha
Subject Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform
Date
Msg-id CAC+AXB0LSzuE7veUrw0-N=cxKEV_hfZTT_RaPMfMeRY3co-RQA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform  (Michail Nikolaev <michail.nikolaev@gmail.com>)
Responses Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform  (Michail Nikolaev <michail.nikolaev@gmail.com>)
Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers


On Sat, Feb 22, 2020 at 9:09 PM Michail Nikolaev <michail.nikolaev@gmail.com> wrote:

I am not sure it is good idea to mix both patches because it adds some
confusion and makes it harder to merge each.
Maybe is it better to update current patch the way to reuse some
function later in [1]?

The patch was originaly reported for Windows, but looking into Peter's patch, I think this issue affects other systems unless we use stricter logic to detect a colorable terminal when using the "auto" option. Probably, the way to go is leaving this patch as WIN32 only and thinking about a future patch.
 
Also, regarding comment
> It is disabled by default, so it must be enabled to use color outpout.

It is not true for new terminal, for example. Maybe it is better to
rephrase it to something like: "Check if TV100 support if enabled and
attempt to enable if not".

The logic I have seen on new terminals is that VT100 is supported but disabled. Would you find clearer? "Attempt to enable VT100 sequence processing. If it is not possible consider it as unsupported."

Please find attached a patch addressing these comments.

Regards,

Juan José Santamaría Flecha
Attachment

pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Error on failed COMMIT
Next
From: Pavel Stehule
Date:
Subject: Re: plan cache overhead on plpgsql expression