postgresql/src
Michael Paquier 3b77dce863 Fix command-line colorization on Windows with VT100-compatible environments
When setting PG_COLOR to "always" or "auto" in a Windows terminal
VT100-compatible, the colorization output was not showing up correctly
because it is necessary to update the console's output handling mode.
This fix allows to detect automatically if the environment is compatible
with VT100.  Hence, PG_COLOR=auto is able to detect and handle both
compatible and non-compatible environments.  The behavior of
PG_COLOR=always remains unchanged, as it enforces the use of colorized
output even if the environment does not allow it.

This fix is based on an initial suggestion from Thomas Munro.

Reported-by: Haiying Tang
Author: Juan José Santamaría Flecha
Reviewed-by: Michail Nikolaev, Michael Paquier, Haiying Tang
Discussion: https://postgr.es/m/16108-134692e97146b7bc@postgresql.org
Backpatch-through: 12
2020-03-02 15:45:34 +09:00
..
backend Handle logical decoding in multi-insert for catalog tuples 2020-03-02 10:00:37 +09:00
bin Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
common Fix command-line colorization on Windows with VT100-compatible environments 2020-03-02 15:45:34 +09:00
fe_utils Fix bug in pg_basebackup -F plain -R. 2020-02-12 09:08:22 +09:00
include Avoid failure if autovacuum tries to access a just-dropped temp namespace. 2020-02-28 20:28:34 -05:00
interfaces Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
port Assume that we have rint(). 2020-02-21 14:30:47 -05:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Fix corner-case loss of precision in numeric ln(). 2020-03-01 14:49:25 +00:00
timezone Require stdint.h 2020-02-21 09:20:32 +01:00
tools Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
tutorial Update copyrights for 2020 2020-01-01 12:21:45 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00