Re: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, "Tang, Haiying" <tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform
Date: 2020-02-24 17:56:05
Message-ID: CAC+AXB0LSzuE7veUrw0-N=cxKEV_hfZTT_RaPMfMeRY3co-RQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sat, Feb 22, 2020 at 9:09 PM Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)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 Content-Type Size
v4-0001-command-line-colorization-on-windows.patch application/octet-stream 1.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fan Liu 2020-02-25 01:57:25 RE: [Bus error] huge_pages default value (try) not fall back
Previous Message Merlin Moncure 2020-02-24 16:34:03 Re: DB running out of memory issues after upgrade

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-02-24 17:56:55 Re: plan cache overhead on plpgsql expression
Previous Message David Fetter 2020-02-24 17:53:34 Re: Error on failed COMMIT