From 12743d10359841c28204a4c561df159b511c5552 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 26 Sep 2015 13:46:24 +0200 Subject: [PATCH] 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). --- src/Symfony/Component/Console/Output/StreamOutput.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index 86fe1827e9..70623681dc 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -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);