Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform - Mailing list pgsql-hackers

From Michail Nikolaev
Subject Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform
Date
Msg-id CANtu0oj2z_t9d5SrTLqgZ_mOoiiAheTFp3spP7urUFiuK90=uA@mail.gmail.com
Whole thread Raw
Responses Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform
Re: BUG #16108: Colorization to the output of command-line hasunproperly behaviors at Windows platform
List 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.



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: ssl passphrase callback
Next
From: Masahiko Sawada
Date:
Subject: Re: Transactions involving multiple postgres foreign servers, take 2