8000 Disable CLI color for Windows 10 greater than 10.0.10586 · symfony/symfony@255c59f · GitHub
[go: up one dir, main page]

Skip to content

Commit 255c59f

Browse files
mlocatinicolas-grekas
authored andcommitted
Disable CLI color for Windows 10 greater than 10.0.10586
1 parent 39cd984 commit 255c59f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private static function hasColorSupport()
161161
{
162162
if ('\\' === DIRECTORY_SEPARATOR) {
163163
return
164-
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
164+
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
165165
|| false !== getenv('ANSICON')
166166
|| 'ON' === getenv('ConEmuANSI')
167167
|| 'xterm' === getenv('TERM');

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function doWrite($message, $newline)
8383
*
8484
* Colorization is disabled if not supported by the stream:
8585
*
86-
* - Windows before 10.0.10586 without Ansicon, ConEmu or Mintty
86+
* - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty
8787
* - non tty consoles
8888
*
8989
* @return bool true if the stream supports colorization, false otherwise
@@ -92,7 +92,7 @@ protected function hasColorSupport()
9292
{
9393
if (DIRECTORY_SEPARATOR === '\\') {
9494
return
95-
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
95+
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
9696
|| false !== getenv('ANSICON')
9797
|| 'ON' === getenv('ConEmuANSI')
9898
|| 'xterm' === getenv('TERM');

src/Symfony/Component/VarDumper/Dumper/CliDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ protected function supportsColors()
449449

450450
if ('\\' === DIRECTORY_SEPARATOR) {
451451
static::$defaultColors = @(
452-
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
452+
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
453453
|| false !== getenv('ANSICON')
454454
|| 'ON' === getenv('ConEmuANSI')
455455
|| 'xterm' === getenv('TERM')

0 commit comments

Comments
 (0)
0