Browse Source

Fixed detection of ANSI color support on Windows

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
113751ea45
  1. 6
      framework/yii/helpers/base/Console.php

6
framework/yii/helpers/base/Console.php

@ -547,9 +547,9 @@ class Console
} }
/** /**
* Returns true if the stream supports colorization. ANSI colors is disabled if not supported by the stream. * Returns true if the stream supports colorization. ANSI colors are disabled if not supported by the stream.
* *
* - windows without asicon * - windows without ansicon
* - not tty consoles * - not tty consoles
* *
* @param mixed $stream * @param mixed $stream
@ -558,7 +558,7 @@ class Console
public static function streamSupportsAnsiColors($stream) public static function streamSupportsAnsiColors($stream)
{ {
return DIRECTORY_SEPARATOR == '\\' return DIRECTORY_SEPARATOR == '\\'
? null !== getenv('ANSICON') ? getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON'
: function_exists('posix_isatty') && @posix_isatty($stream); : function_exists('posix_isatty') && @posix_isatty($stream);
} }

Loading…
Cancel
Save