1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-09 18:21:05 +03:00
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
..
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2019-05-22 12:55:34 -04:00
2019-01-02 12:44:25 -05:00
2019-05-22 12:55:34 -04:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2019-05-22 13:04:48 -04:00
2019-05-22 13:04:48 -04:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2019-05-22 12:55:34 -04:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2019-05-22 12:55:34 -04:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00
2020-02-19 21:09:47 +01:00
2019-01-02 12:44:25 -05:00
2019-01-02 12:44:25 -05:00