Disable CLI color for Windows 10 greater than 10.0.10586
This commit is contained in:
parent
39cd984d7b
commit
255c59f670
@ -161,7 +161,7 @@ class DeprecationErrorHandler
|
|||||||
{
|
{
|
||||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||||
return
|
return
|
||||||
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
|
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM');
|
|| 'xterm' === getenv('TERM');
|
||||||
|
@ -83,7 +83,7 @@ class StreamOutput extends Output
|
|||||||
*
|
*
|
||||||
* Colorization is disabled if not supported by the stream:
|
* Colorization is disabled if not supported by the stream:
|
||||||
*
|
*
|
||||||
* - Windows before 10.0.10586 without Ansicon, ConEmu or Mintty
|
* - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty
|
||||||
* - non tty consoles
|
* - non tty consoles
|
||||||
*
|
*
|
||||||
* @return bool true if the stream supports colorization, false otherwise
|
* @return bool true if the stream supports colorization, false otherwise
|
||||||
@ -92,7 +92,7 @@ class StreamOutput extends Output
|
|||||||
{
|
{
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return
|
return
|
||||||
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
|
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM');
|
|| 'xterm' === getenv('TERM');
|
||||||
|
@ -449,7 +449,7 @@ class CliDumper extends AbstractDumper
|
|||||||
|
|
||||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||||
static::$defaultColors = @(
|
static::$defaultColors = @(
|
||||||
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
|
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM')
|
|| 'xterm' === getenv('TERM')
|
||||||
|
Reference in New Issue
Block a user