postgresql/src/common
Michael Paquier 3b5709e664 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:46:24 +09:00
..
unicode Make script output more pgindent compatible 2019-06-24 22:50:56 +02:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
Makefile Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
base64.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
config_info.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
controldata_utils.c Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
d2s.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
d2s_full_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
d2s_intrinsics.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
exec.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
f2s.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
fe_memutils.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_perm.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_utils.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
ip.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
keywords.c Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
kwlookup.c Use perfect hashing, instead of binary search, for keyword lookup. 2019-01-09 19:47:46 -05:00
link-canary.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
logging.c Fix command-line colorization on Windows with VT100-compatible environments 2020-03-02 15:46:24 +09:00
md5.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_lzcompress.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
pgfnames.c Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
psprintf.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
relpath.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
restricted_token.c Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
rmtree.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
ryu_common.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
saslprep.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
scram-common.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
sha2.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
sha2_openssl.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
string.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
unicode_norm.c Fix typo 2020-02-19 21:09:47 +01:00
username.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
wait_error.c Update copyright for 2019 2019-01-02 12:44:25 -05:00