Commit 113751ea by Alexander Makarov

Fixed detection of ANSI color support on Windows

parent 52529a98
...@@ -547,9 +547,9 @@ class Console ...@@ -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 ...@@ -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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment