RE: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform
Tang, Haiying <tanghy.fnst@cn.fujitsu.com>
From: "Tang, Haiying" <tanghy.fnst@cn.fujitsu.com>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>, Thomas Munro <thomas.munro@gmail.com>
Cc: PG Bug reporting form <noreply@postgresql.org>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-11-15T04:23:01Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- v1-0001-command-line-colorization-on-windows.patch (application/octet-stream) patch v1-0001
- Test_result.png (image/png)
>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.santamaria@gmail.com> Sent: Wednesday, November 13, 2019 4:00 AM To: Thomas Munro <thomas.munro@gmail.com> Cc: PG Bug reporting form <noreply@postgresql.org>; PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>; Tang, Haiying/唐 海英 <tanghy.fnst@cn.fujitsu.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.munro@gmail.com<mailto:thomas.munro@gmail.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
Commits
-
Fix command-line colorization on Windows with VT100-compatible environments
- 3b5709e664c4 12.3 landed
- 3b77dce863d9 13.0 landed