Skip to content

Commit

Permalink
enable colors for windows ConEmu user
Browse files Browse the repository at this point in the history
http://conemu.github.io/
This is used in Cmder for example.
  • Loading branch information
antograssiot committed Jul 22, 2015
1 parent 2bb3880 commit bfa1cd0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Console/ConsoleOutput.php
Expand Up @@ -154,16 +154,16 @@ 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') ||
(function_exists('posix_isatty') && !posix_isatty($this->_output))
) {
$this->_outputAs = self::PLAIN;
Expand Down
2 changes: 1 addition & 1 deletion src/Log/Engine/ConsoleLog.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Log/Engine/ConsoleLogTest.php
Expand Up @@ -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;
Expand Down

0 comments on commit bfa1cd0

Please sign in to comment.