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?

4
15 comments

What IDEA version do you use? Is it possible to provide idea.log ("Help | Show Log in...") after restarting IDE?

0
Avatar
Permanently deleted user

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.

0

Is it possible to check the issue with IDEA 2017.3 EAP: https://www.jetbrains.com/idea/nextversion/ ?

0
Avatar
Permanently deleted user

Unfortunately, no luck. Still the same unexpected output.


0

Please create new issue on YouTrack: http://youtrack.jetbrains.com/issues/IDEA , attaching screenshots with output and terminal settings.

0

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.

 

 

 

0
Avatar
Permanently deleted user

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.

1
Avatar
Permanently deleted user

Voted ;)

0
Avatar
Permanently deleted user

had same problem with colors in terminal as well, downgrading from maven 3.5.3 to maven 3.5.0 solved it for me

1
Avatar
Permanently deleted user

> 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. 

 

1
Avatar
Permanently deleted user

I can confirm, this is caused by maven 3.5.3. I have installed maven --version 3.5.0

and the problem is gone.

1

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!

2
Avatar
Permanently deleted user

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)

1
Avatar
Permanently deleted user

Maven 3.5.4 SOLVES the issue, it seems that the problem was with Maven 3.5.3.

2

Please sign in to leave a comment.