Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't colorize output in Git Bash terminal #2888

Closed
wzup opened this issue Jun 16, 2017 · 3 comments
Closed

Doesn't colorize output in Git Bash terminal #2888

wzup opened this issue Jun 16, 2017 · 3 comments
Labels
type: question support question

Comments

@wzup
Copy link

wzup commented Jun 16, 2017

bash.exe
Apparently colors work right:

mingw64__c_2017-06-16 12 47 10

git-bash.exe
Doesn't colorize output:

mingw64_ 2017-06-16 12 48 13

Why is it happening? How to fix it? I use git-bash.exe in my work, so it wold be great if you explain how to fix the issue.

@ScottFreeCode
Copy link
Contributor

I don't know the exact criteria off the top of my head, but there are heuristics such as is-a-tty that Mocha (and most colored commandline programs) use to tell when it's safe to provide color by default; in some cases those end up ambiguous or just incorrect and the program has to play it safe. Without looking into it more deeply I couldn't tell you for sure whether that's happening here, or whether there's a bug in git-bash, or in Mocha.

However! What I can say right now is that Mocha has a --colors option (or maybe it's --color; try both and see which one works) to override that and try to use color anyway.

@GuillaumeLeclerc
Copy link

I think it can be fixed just by:

export TERM=xterm-256color

@peterjmartinson
Copy link

I use mintty 2.0.3 via Git for Windows, and was having this problem. As @ScottFreeCode pointed out, mocha --colors solved this issue for me.

@boneskull boneskull added the type: question support question label Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question support question
Projects
None yet
Development

No branches or pull requests

5 participants