-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit e64ea14
Use ANSI color codes on Windows as well
Windows' console supports ANSI escape sequences since Windows 10.
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
PHP enables this by default since PHP 7.2.
https://www.php.net/manual/en/function.sapi-windows-vt100-support.php
On older PHP versions, the output with --colors will not be correct,
but this is already the case when using this option.
PHP CodeSniffer special-cased Windows in this code in 2014
(bfd095d).
This workaround is no longer needed today in 2024.
Note that the --colors option was already supported on Windows.
This only affects inline highlighting in error and debug messages.
Also document problems with printing Unicode characters to Windows
console before PHP 7.1.
https://www.php.net/manual/en/migration71.windows-support.php
Perhaps this workaround can be removed too one day.1 parent d02c686 commit e64ea14
3 files changed
+15
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | + | ||
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
519 | - | ||
520 | - | ||
521 | - | ||
522 | - | ||
523 | 519 | | |
524 | 520 | | |
525 | 521 | | |
| |||
584 | 580 | | |
585 | 581 | | |
586 | 582 | | |
587 | - | ||
588 | - | ||
589 | - | ||
590 | - | ||
591 | - | ||
583 | + | ||
592 | 584 | | |
593 | 585 | | |
594 | 586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | - | ||
271 | - | ||
270 | + | ||
272 | 271 | | |
273 | 272 | | |
274 | 273 | | |
| |||
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
281 | - | ||
282 | - | ||
283 | - | ||
284 | - | ||
285 | - | ||
286 | - | ||
287 | - | ||
288 | - | ||
289 | - | ||
290 | - | ||
291 | - | ||
292 | - | ||
293 | - | ||
294 | - | ||
295 | - | ||
296 | - | ||
280 | + | ||
281 | + | ||
282 | + | ||
297 | 283 | | |
298 | - | ||
299 | - | ||
300 | - | ||
284 | + | ||
285 | + | ||
286 | + | ||
301 | 287 | | |
302 | - | ||
303 | - | ||
304 | - | ||
288 | + | ||
289 | + | ||
290 | + | ||
305 | 291 | | |
292 | + | ||
293 | + | ||
306 | 294 | | |
307 | 295 | | |
308 | 296 | | |
309 | - | ||
297 | + | ||
310 | 298 | | |
311 | 299 | | |
312 | 300 | | |
| |||
0 commit comments