diff --git a/src/Console/ConsoleOutput.php b/src/Console/ConsoleOutput.php index 1c9cc2455b3..e2be53c61d2 100644 --- a/src/Console/ConsoleOutput.php +++ b/src/Console/ConsoleOutput.php @@ -154,8 +154,8 @@ 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. */ @@ -163,7 +163,7 @@ public function __construct($stream = 'php://stdout') { $this->_output = fopen($stream, 'w'); - if ((DS === '\\' && !(bool)env('ANSICON')) || + if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') || (function_exists('posix_isatty') && !posix_isatty($this->_output)) ) { $this->_outputAs = self::PLAIN; diff --git a/src/Log/Engine/ConsoleLog.php b/src/Log/Engine/ConsoleLog.php index 3f318272a48..3268f63d924 100644 --- a/src/Log/Engine/ConsoleLog.php +++ b/src/Log/Engine/ConsoleLog.php @@ -57,7 +57,7 @@ class ConsoleLog extends BaseLog */ public function __construct(array $config = []) { - if ((DS === '\\' && !(bool)env('ANSICON')) || + if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') || (function_exists('posix_isatty') && !posix_isatty($this->_output)) ) { $this->_defaultConfig['outputAs'] = ConsoleOutput::PLAIN; diff --git a/tests/TestCase/Log/Engine/ConsoleLogTest.php b/tests/TestCase/Log/Engine/ConsoleLogTest.php index 1ef216420c1..92d01891ac5 100644 --- a/tests/TestCase/Log/Engine/ConsoleLogTest.php +++ b/tests/TestCase/Log/Engine/ConsoleLogTest.php @@ -68,7 +68,7 @@ public function testlogToFileStream() */ public function testDefaultOutputAs() { - if ((DS === '\\' && !(bool)env('ANSICON')) || + if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') || (function_exists('posix_isatty') && !posix_isatty(null)) ) { $expected = ConsoleOutput::PLAIN;