Skip to content

Commit

Permalink
Merge pull request #7097 from antograssiot/conEmu
Browse files Browse the repository at this point in the history
enable colors for windows ConEmu user
  • Loading branch information
markstory committed Jul 23, 2015
2 parents e19f621 + 94b2ea2 commit 6c53f8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/Cake/Console/ConsoleOutput.php
Expand Up @@ -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))
) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Log/Engine/ConsoleLog.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Log/Engine/ConsoleLogTest.php
Expand Up @@ -139,7 +139,7 @@ public function testDefaultOutputAs() {
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;
Expand Down

0 comments on commit 6c53f8b

Please sign in to comment.