postgresql/src/common
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
..
unicode Add support for automatically updating Unicode derived files 2020-01-09 10:08:14 +01:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
Makefile Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
base64.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
config_info.c Simplify passing of configure arguments to pg_config 2020-02-10 19:23:41 +01:00
controldata_utils.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
d2s.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
d2s_full_table.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
d2s_intrinsics.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
encnames.c Rationalize code placement between wchar.c, encnames.c, and mbutils.c. 2020-01-16 18:08:21 -05:00
exec.c Clean up some code, comments and docs referring to Windows 2000 and older 2020-02-19 13:20:33 +09:00
f2s.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
fe_memutils.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
file_perm.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
file_utils.c Change client-side fsync_fname() to report errors fatally 2020-02-24 16:51:26 +01:00
hashfn.c Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
ip.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jsonapi.c Move jsonapi.c and jsonapi.h to src/common. 2020-01-29 10:22:51 -05:00
keywords.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
kwlookup.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
link-canary.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
logging.c Fix command-line colorization on Windows with VT100-compatible environments 2020-03-02 15:45:34 +09:00
md5.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_lzcompress.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgfnames.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
protocol_openssl.c Move OpenSSL routines for min/max protocol setting to src/common/ 2020-01-17 10:06:17 +09:00
psprintf.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
relpath.c Add declaration-level assertions for compile-time checks 2020-02-03 14:48:42 +09:00
restricted_token.c Fix some memory leaks and improve restricted token handling on Windows 2020-01-27 11:02:05 +09:00
rmtree.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
ryu_common.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
saslprep.c Move wchar.c and encnames.c to src/common/. 2020-01-16 15:58:55 -05:00
scram-common.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sha2.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sha2_openssl.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
string.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
stringinfo.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
unicode_norm.c Fix typo 2020-02-19 21:08:47 +01:00
username.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
wait_error.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
wchar.c Rationalize code placement between wchar.c, encnames.c, and mbutils.c. 2020-01-16 18:08:21 -05:00