Permalink
Browse files

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).
  • Loading branch information...
stof authored and fabpot committed Sep 26, 2015
1 parent 8df5d94 commit 12743d10359841c28204a4c561df159b511c5552
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Symfony/Component/Console/Output/StreamOutput.php
@@ -89,7 +89,7 @@ protected function doWrite($message, $newline)
*
* 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 @@ protected function hasColorSupport()
{
// @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);

0 comments on commit 12743d1

Please sign in to comment.