Using Mingw as terminal doesn't display ANSI colors in Maven output
Answered
I use the Git Bash(MINGW64) terminal in IntelliJ instead of the CMD terminal. When I run this terminal from IntelliJ and start a mvn command from the terminal, the ansi color codes are displayed instead of the collors. And offcourse, I want some pretty colors. ;-)
What I tried:
- running the cmd terminal: colors worked.
- running the Git Bash terminal from the Windows Start menu: colors worked.
- comparing the environment differences between starting the terminal from IntelliJ and Windows Start menu: no noticable differences.
The command I use to start the terminal: "C:\Program Files\Git\bin\sh.exe" --login -i
Am I missing something or should I make an issue for this?
Please sign in to leave a comment.
What IDEA version do you use? Is it possible to provide idea.log ("Help | Show Log in...") after restarting IDE?
I'm using 2017.2.5 and there appears nothing new in the logs when I open a terminal or when I execute a command in it.
Is it possible to check the issue with IDEA 2017.3 EAP: https://www.jetbrains.com/idea/nextversion/ ?
Unfortunately, no luck. Still the same unexpected output.

Please create new issue on YouTrack: http://youtrack.jetbrains.com/issues/IDEA , attaching screenshots with output and terminal settings.
I have the exact same problem, so far from what I discovered it looks like a problem with sh.exe
When opening the sh.exe even without intellij and using mvn commands there is the same problem with the colors. when opening it through
So far I didn't found the solution yet so please update here if you finds one.
Unfortunately it's same in my terminal. I use MINGW64 shell with IntelliJ IDEA 2017.3.4 (Ultimate).
Does anybody solve this issue? Thank you.
Please vote and follow this issue: https://youtrack.jetbrains.com/issue/IDEA-154153
Voted ;)
had same problem with colors in terminal as well, downgrading from maven 3.5.3 to maven 3.5.0 solved it for me
> Does anybody solve this issue? Thank you.
Nothing to do with IntelliJ. Rather a regression bug in Jansi bundled with (latest) Maven. I worked around the problem by replacing jansi-1.17.jar in Maven's lib folder with https://mvnrepository.com/artifact/org.fusesource.jansi/jansi-native/1.8. Now it works altough I still get black-and-white instead of colour. However, at least this nasty escape sequences are gone.
I can confirm, this is caused by maven 3.5.3. I have installed maven --version 3.5.0
and the problem is gone.
You can also fix maven 3.5.3 by removing jansi-1.17.jar from the lib directory and replacing it with jansi-1.17.1.jar - worked for me!
1.17.1.jar version of jansi worked and fix this issue for Intellij (reference for downloading jansi1.17.1 - https://fusesource.github.io/jansi/download.html)
Maven 3.5.4 SOLVES the issue, it seems that the problem was with Maven 3.5.3.