Commit 98eee63
committed
Fix: Prevent color-forcing env vars from being forwarded when stdout is not a TTY
This fixes a bug where FORCE_COLOR, NO_COLOR, CLICOLOR, and CLICOLOR_FORCE
were being forwarded from the host environment into containers even when
stdout was redirected. This undermined the ANSI-leak fix by causing tools
to emit ANSI escape codes despite the absence of a TTY.
The fix conditionally skips forwarding these color-forcing variables when
stdout is not a TTY, preventing ANSI codes from appearing in redirected
output (e.g., 'lando composer show > file.txt').
User-provided environment variables (via userEnv parameter) still override
this behavior, preserving explicit user intent.1 parent 3ccf16c commit 98eee63
2 files changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
67 | 88 | | |
68 | 89 | | |
69 | 90 | | |
| |||
88 | 109 | | |
89 | 110 | | |
90 | 111 | | |
91 | | - | |
| 112 | + | |
92 | 113 | | |
93 | 114 | | |
94 | 115 | | |
95 | | - | |
| 116 | + | |
| 117 | + | |
96 | 118 | | |
97 | 119 | | |
98 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
0 commit comments