From bb2566c17dfd98cb1d6e7ec3d6a09dcac7d245f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Haso=C5=88?= Date: Wed, 12 Sep 2012 11:29:58 +0200 Subject: [PATCH] [Console] Console colorization is also provided by ConEmu on Windows --- src/Symfony/Component/Console/CHANGELOG.md | 5 +++++ src/Symfony/Component/Console/Output/StreamOutput.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/CHANGELOG.md b/src/Symfony/Component/Console/CHANGELOG.md index 79449d8237..1a0457fc3d 100644 --- a/src/Symfony/Component/Console/CHANGELOG.md +++ b/src/Symfony/Component/Console/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +2.1.2 +----- + + * added support for colorization on Windows via ConEmu + 2.1.0 ----- diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index e00d0655cd..bf869fa19f 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -95,7 +95,7 @@ class StreamOutput extends Output * * Colorization is disabled if not supported by the stream: * - * - windows without ansicon + * - windows without ansicon and ConEmu * - non tty consoles * * @return Boolean true if the stream supports colorization, false otherwise @@ -104,7 +104,7 @@ class StreamOutput extends Output { // @codeCoverageIgnoreStart if (DIRECTORY_SEPARATOR == '\\') { - return false !== getenv('ANSICON'); + return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); } return function_exists('posix_isatty') && @posix_isatty($this->stream);