Stefan Gloutnikov
Stefan Gloutnikov

Reputation: 448

Can the IntelliJ IDEA run tab have color?

I am running a spring boot application inside IntelliJ IDEA and noticed a difference if I run it via the run tab (run menu) and via manual command from the terminal tab.

If I run it through a maven run target (play button), I do not see any colors inside the 'run' tab. If I run it via 'mvn spring-boot:run from the 'terminal' tab I see the pretty color highlights. The maven run configuration also runs the same command, spring-boot:run.

Application started from the play button/run configuration (run tab): run tab Application started from the terminal tab via mvn spring-boot:run (terminal tab): terminal tab

Upvotes: 8

Views: 3309

Answers (4)

Alessandro Alessandra
Alessandro Alessandra

Reputation: 1065

You can obtain the very same output also in the Community Edition with the previously mentioned option:

-Dspring.output.ansi.enabled=always

Simply go to "Run" -> "Edit Configurations..." and add the option in the "VM options:" field for your main class.

Upvotes: 0

jkwuc89
jkwuc89

Reputation: 1415

Inside build.gradle, add the following block to get colorized log output when running your Spring Boot app inside IntelliJ IDEA via gradle bootRun.

bootRun {
    jvmArgs = ["-Dspring.output.ansi.enabled=ALWAYS"]
}

Upvotes: 9

Andreas Wederbrand
Andreas Wederbrand

Reputation: 40001

In IDEA 2017.1 EAP I'm getting colours even if I'm just running the application with the standard run command

Colours in IDEA

Edit: Might be that Community edition doesn't support Spring Boot at all (https://www.jetbrains.com/idea/features/editions_comparison_matrix.html)

enter image description here

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 402095

It's supported for the Spring Boot Run/Debug configuration type. It explicitly passes

-Dspring.output.ansi.enabled=always

JVM option enabling the color output.

As far as I know, ANSI colors support is not available when you run it in IntelliJ IDEA using Maven or Gradle configurations in the built-in console. Feature request is welcome.

Upvotes: 6

Related Questions