forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3b77dce
committed
Fix command-line colorization on Windows with VT100-compatible environments
When setting PG_COLOR to "always" or "auto" in a Windows terminalVT100-compatible, the colorization output was not showing up correctlybecause it is necessary to update the console's output handling mode.This fix allows to detect automatically if the environment is compatiblewith VT100. Hence, PG_COLOR=auto is able to detect and handle bothcompatible and non-compatible environments. The behavior ofPG_COLOR=always remains unchanged, as it enforces the use of colorizedoutput even if the environment does not allow it.This fix is based on an initial suggestion from Thomas Munro.Reported-by: Haiying TangAuthor: Juan José Santamaría FlechaReviewed-by: Michail Nikolaev, Michael Paquier, Haiying TangDiscussion:https://postgr.es/m/16108-134692e97146b7bc@postgresql.orgBackpatch-through: 121 parent12c5cad commit3b77dce
1 file changed
+49
-1
lines changedLines changed: 49 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
35 | 72 |
| |
36 | 73 |
| |
37 | 74 |
| |
| |||
40 | 77 |
| |
41 | 78 |
| |
42 | 79 |
| |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
43 | 91 |
| |
44 | 92 |
| |
45 | 93 |
| |
| |||
50 | 98 |
| |
51 | 99 |
| |
52 | 100 |
| |
53 |
| - | |
| 101 | + | |
54 | 102 |
| |
55 | 103 |
| |
56 | 104 |
| |
|
0 commit comments
Comments
(0)