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

From: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
To: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Cc: "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-18 22:39:39
Message-ID: CANtu0oj2z_t9d5SrTLqgZ_mOoiiAheTFp3spP7urUFiuK90=uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hello everyone.

> Please find attached a version that supports older Mingw versions and SDKs.

I have checked the patch source code and it seems to be working. But a
few moments I want to mention:

I think it is not good idea to mix the logic of detecting the fact of
TTY with enabling of the VT100 mode. Yeah, it seems to be correct for
current case but a little confusing.
Maybe is it better to detect terminal using *isatty* and later call
*enable_vt_mode*?

Also, it seems like if GetConsoleMode returns
ENABLE_VIRTUAL_TERMINAL_PROCESSING flag already set - we could skip
SetConsoleMode call (not a big deal of course).

Thanks,
Michail.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-02-18 22:58:03 Re: gen_random_uuid() is immutable in Pg 13devel
Previous Message Peter Geoghegan 2020-02-18 20:34:01 Re: gen_random_uuid() is immutable in Pg 13devel

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-02-18 22:55:39 Re: Transactions involving multiple postgres foreign servers, take 2
Previous Message Andrew Dunstan 2020-02-18 22:39:20 Re: ssl passphrase callback