Commit 3da1077
committed
bug #53707 [Console] Fix color support for TTY output (theofidry)
This PR was merged into the 5.4 branch.
Discussion
----------
[Console] Fix color support for TTY output
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues | Fix #53693
| License | MIT
Prior to symfony/symfony#53576, the output being a TTY was sufficient to consider the output as supporting colors. This is not enough but as a result, we are missing some additional checks.
This PR:
- Adds a check for the `COLORTERM` environment variable. From what I've found it does not look this variable is ever set if there is no color support.
- Adds a check for the `screen-*` `TERM` values. Similar to the check we already for `xterm`, you have `screen-256color`, `screen-256color-bce`, `screen.xterm-256color` or more.
Commits
-------
22efcd028b [Console] Fix color support1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
113 | 125 | | |
114 | 126 | | |
115 | 127 | | |
| |||
0 commit comments