enable colors for windows ConEmu user

backport of #7090
This commit is contained in:
antograssiot 2015-07-23 05:48:34 +02:00
parent e19f621314
commit 94b2ea29a6
3 changed files with 5 additions and 5 deletions

View file

@ -153,15 +153,15 @@ class ConsoleOutput {
/** /**
* Construct the output object. * Construct the output object.
* *
* Checks for a pretty console environment. Ansicon allows pretty consoles * Checks for a pretty console environment. Ansicon and ConEmu allows
* on Windows, and is supported. * pretty consoles on Windows, and is supported.
* *
* @param string $stream The identifier of the stream to write output to. * @param string $stream The identifier of the stream to write output to.
*/ */
public function __construct($stream = 'php://stdout') { public function __construct($stream = 'php://stdout') {
$this->_output = fopen($stream, 'w'); $this->_output = fopen($stream, 'w');
if ((DS === '\\' && !(bool)env('ANSICON')) || if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') ||
$stream === 'php://output' || $stream === 'php://output' ||
(function_exists('posix_isatty') && !posix_isatty($this->_output)) (function_exists('posix_isatty') && !posix_isatty($this->_output))
) { ) {

View file

@ -48,7 +48,7 @@ class ConsoleLog extends BaseLog {
*/ */
public function __construct($config = array()) { public function __construct($config = array()) {
parent::__construct($config); parent::__construct($config);
if ((DS === '\\' && !(bool)env('ANSICON')) || if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') ||
(function_exists('posix_isatty') && !posix_isatty($this->_output)) (function_exists('posix_isatty') && !posix_isatty($this->_output))
) { ) {
$outputAs = ConsoleOutput::PLAIN; $outputAs = ConsoleOutput::PLAIN;

View file

@ -139,7 +139,7 @@ class ConsoleLogTest extends CakeTestCase {
TestCakeLog::config('test_console_log', array( TestCakeLog::config('test_console_log', array(
'engine' => 'TestConsole', 'engine' => 'TestConsole',
)); ));
if ((DS === '\\' && !(bool)env('ANSICON')) || if ((DS === '\\' && !(bool)env('ANSICON') && env('ConEmuANSI') !== 'ON') ||
(function_exists('posix_isatty') && !posix_isatty(null)) (function_exists('posix_isatty') && !posix_isatty(null))
) { ) {
$expected = ConsoleOutput::PLAIN; $expected = ConsoleOutput::PLAIN;