Re: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform
Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
From: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
To: Michail Nikolaev <michail.nikolaev@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, "Tang, Haiying" <tanghy.fnst@cn.fujitsu.com>,
Thomas Munro <thomas.munro@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-02-24T17:56:05Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- v4-0001-command-line-colorization-on-windows.patch (application/octet-stream) patch v4-0001
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
Commits
-
Fix command-line colorization on Windows with VT100-compatible environments
- 3b5709e664c4 12.3 landed
- 3b77dce863d9 13.0 landed