Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeception bash color output does not display

I have been testing with Codeception and PhantomJS for a while, but when ever i have to debug and run

    vendor/bin/codecept run --debug

with colors set to true all i get is:

    Modules: ←[33mWebDriver, AcceptanceHelper←[39m

and so on... So for some reason the color is just outputed in a raw format and is not working at all. Colors usually work. like when i use "ls --color" it just works. My System is Windows 7 i'm using the "git bash" and i have also tried the regular "cmd" "powershell" and "cygqwin". Neither one of them seem to work with codeceoptions output. So what is the problem? I'm clueless :(

like image 999
MasterOfCake Avatar asked Sep 28 '22 14:09

MasterOfCake


2 Answers

in bash, try running

export TERM=ansi 

or

export TERM=xterm

before running your program

or, to test color output from the shell itself:

echo -e "\e[41m\e[32mCOLOR\e[0m"

if that does work than it is the program, not the environment

finally, you might just need a better console. try conemu, it has excellent ansi color support and i use it for cmd powershell bash perl and ssh sessions :) http://sourceforge.net/projects/conemu/

like image 134
ダルセン テイス Avatar answered Oct 06 '22 08:10

ダルセン テイス


Your application (Codeception) was not adapted to Windows console, which doesn't support ANSI colorizing. To enable ANSI colors you may choose one of the following options:

  • ConEmu is the Windows local terminal with ANSI capabilities and many other features like tabs, splits, preconfigured shell tasks, ... Also, it's the only terminal which able to "replace" default Windows console. Yep, I'm the author.
  • Some applications may work properly in mintty (bundled with cygwin or msys). Many native Windows console tools can't work properly in this terminal, but may be your app will be fine.
  • There is AnsiCon project. It enables ANSI colorizing in standard Windows console.

BTW, bash's ls (cygwin or msys) was adapted to Windows console API, so it doesn't post ANSI to terminal, unless terminal has done special initialization of POSIX subsystem. ConEmu can do this initialization via cygwin/msys connector.

like image 1
Maximus Avatar answered Oct 06 '22 08:10

Maximus