8000 Disable CLI color for Windows 10 greater than 10.0.10586 by mlocati · Pull Request #19660 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Disable CLI color for Windows 10 greater than 10.0.10586 #19660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
8000
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Disable CLI color for Windows 10 greater than 10.0.10586
  • Loading branch information
mlocati committed Aug 18, 2016
commit d83838cb93c86e762e9abcbd196531648f77c30a
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private static function hasColorSupport()
{
if ('\\' === DIRECTORY_SEPARATOR) {
return
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
0 === version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to use version_compare anymore for an exact version match

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to use version_compare anymore for an exact version match

Agreed: pull request updated, thanks

|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Output/StreamOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected function doWrite($message, $newline)
*
* Colorization is disabled if not supported by the stream:
*
* - Windows before 10.0.10586 without Ansicon, ConEmu or Mintty
* - Windows not 10.0.10586 without Ansicon, ConEmu or Mintty
Copy link
Member
@nicolas-grekas nicolas-grekas Aug 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about: Windows != 10.0.10586 without Ansicon, ConEmu nor Mintty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, for me != and not are synonymous...

8000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for me != means "different than", which reads better imho than "not"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since for you it's so relevant, I updated this PR 😉

* - non tty consoles
*
* @return bool true if the stream supports colorization, false otherwise
Expand All @@ -94,7 +94,7 @@ protected function hasColorSupport()
{
if (DIRECTORY_SEPARATOR === '\\') {
return
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
0 === version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/VarDumper/Dumper/CliDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ protected function supportsColors()

if ('\\' === DIRECTORY_SEPARATOR) {
static::$defaultColors = @(
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
0 === version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM')
Expand Down
0