From 94b2ea29a6c289cbcf83fecb8617f2de704e568d Mon Sep 17 00:00:00 2001 From: antograssiot Date: Thu, 23 Jul 2015 05:48:34 +0200 Subject: [PATCH] enable colors for windows ConEmu user backport of #7090 --- lib/Cake/Console/ConsoleOutput.php | 6 +++--- lib/Cake/Log/Engine/ConsoleLog.php | 2 +- lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Console/ConsoleOutput.php b/lib/Cake/Console/ConsoleOutput.php index d1fb2b9bd..f80ae343e 100644 --- a/lib/Cake/Console/ConsoleOutput.php +++ b/lib/Cake/Console/ConsoleOutput.php @@ -153,15 +153,15 @@ class ConsoleOutput { /** * Construct the output object. * - * Checks for a pretty console environment. Ansicon allows pretty consoles - * on Windows, and is supported. + * Checks for a pretty console environment. Ansicon and ConEmu allows + * pretty consoles on Windows, and is supported. * * @param string $stream The identifier of the stream to write output to. */ public function __construct($stream = 'php://stdout') { $this->_output = fopen($stream, 'w'); - if ((DS === '\\' && !(bool)env('ANSICON')) || + if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') || $stream === 'php://output' || (function_exists('posix_isatty') && !posix_isatty($this->_output)) ) { diff --git a/lib/Cake/Log/Engine/ConsoleLog.php b/lib/Cake/Log/Engine/ConsoleLog.php index e76172957..3c716946e 100644 --- a/lib/Cake/Log/Engine/ConsoleLog.php +++ b/lib/Cake/Log/Engine/ConsoleLog.php @@ -48,7 +48,7 @@ class ConsoleLog extends BaseLog { */ public function __construct($config = array()) { parent::__construct($config); - if ((DS === '\\' && !(bool)env('ANSICON')) || + if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') || (function_exists('posix_isatty') && !posix_isatty($this->_output)) ) { $outputAs = ConsoleOutput::PLAIN; diff --git a/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php b/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php index c9a06b7fc..8bfd5a2ab 100644 --- a/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php +++ b/lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php @@ -139,7 +139,7 @@ class ConsoleLogTest extends CakeTestCase { TestCakeLog::config('test_console_log', array( 'engine' => 'TestConsole', )); - if ((DS === '\\' && !(bool)env('ANSICON')) || + if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') || (function_exists('posix_isatty') && !posix_isatty(null)) ) { $expected = ConsoleOutput::PLAIN;