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

From: "Tang, Haiying" <tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com>
To: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: PG Bug reporting form <noreply(at)postgresql(dot)org>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform
Date: 2019-11-15 04:23:01
Message-ID: 43AA0560298D1A4893896FDC52840EA1D9C74F7D@G08CNEXMBPEKD03.g08.fujitsu.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

>In order to make it work both things are needed, setting the console mode and a terminal that supports it.

Your patch worked fine on windows which supports VT100. But the bug still happened when set PG_COLOR="always" at Windows Terminal that not support VT100. Please see the attached file “Test_result.png” for the NG result. (I used win7 for this test)

To fix the above bug, I made some change to your patch. The new one works fine on my win7(VT100 not support) and win10(VT100 support).

Also, in this new patch(v1), I added some doc change for Windows not support Colorization. Please find the attached patch for so.

Regards,
Tang

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Sent: Wednesday, November 13, 2019 4:00 AM
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: PG Bug reporting form <noreply(at)postgresql(dot)org>; PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>; Tang, Haiying/唐 海英 <tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com>
Subject: Re: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform

On Tue, Nov 12, 2019 at 9:39 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com<mailto:thomas(dot)munro(at)gmail(dot)com>> wrote:

... I wonder if it works if you use the new Windows Terminal, and I
wonder if it would work on the older thing if we used the
SetConsoleMode() flag it mentions.

In order to make it work both things are needed, setting the console mode and a terminal that supports it. Please find attached a patch for so.

Regards,

Juan José Santamaría Flecha

Attachment Content-Type Size
v1-0001-command-line-colorization-on-windows.patch application/octet-stream 1.6 KB
Test_result.png image/png 86.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2019-11-15 04:41:12 Re: BUG #16079: Question Regarding the BUG #16064
Previous Message Michael Paquier 2019-11-15 03:21:41 Re: REINDEX CONCURRENTLY unexpectedly fails

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-11-15 04:41:12 Re: BUG #16079: Question Regarding the BUG #16064
Previous Message Daniel Wood 2019-11-15 03:38:19 Re: 'Invalid lp' during heap_xlog_delete