Detect Mintty for color support on Windows

Mintty is now the default terminal in GitBash, and it supports ANSI
colors without the need of ANSICON (it even supports 256 colors rather
than the 16 colors supported by ANSICON).
This commit is contained in:
Christophe Coevoet 2015-09-26 13:46:24 +02:00 committed by Fabien Potencier
parent 8df5d94158
commit 12743d1035
1 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class StreamOutput extends Output
*
* Colorization is disabled if not supported by the stream:
*
* - Windows without Ansicon and ConEmu
* - Windows without Ansicon, ConEmu or Mintty
* - non tty consoles
*
* @return bool true if the stream supports colorization, false otherwise
@ -98,7 +98,7 @@ class StreamOutput extends Output
{
// @codeCoverageIgnoreStart
if (DIRECTORY_SEPARATOR === '\\') {
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
}
return function_exists('posix_isatty') && @posix_isatty($this->stream);