idea-sbt-plugin
idea-sbt-plugin copied to clipboard
Support for ANSI Colour sequences
Apologies if this has been covered before - I could only see a reference to test colouring.
I have added a logback converter to colourise the WARN and ERROR messages in logs in my project when using SBT. This is really great, but when I view the logs in the console of the idea-sbt-plugin I just see the raw ANSI code sequences.
I know that IDEA's own console supports ANSI colour sequences, it would be great if the idea-sbt-plugin did as well.
"I know that IDEA's own console supports ANSI colour sequences" I didn't know that. Looks like it isn't supported across the board, though:
http://youtrack.jetbrains.net/issue/IDEA-68679 http://youtrack.jetbrains.net/issue/IDEA-69880
I'll poke through the sources and see if I can find a way. Would be great to use this for SBT colorization rather that the current hack.
Many thanks for looking into it. Hopefully work on the IntelliJ side will make this easier to enable soon.
Stuart.
Jason Zaugg wrote:
"I know that IDEA's own console supports ANSI colour sequences" I didn't know that. Looks like it isn't supported across the board, though:
http://youtrack.jetbrains.net/issue/IDEA-68679 http://youtrack.jetbrains.net/issue/IDEA-69880
I'll poke through the sources and see if I can find a way. Would be great to use this for SBT colorization rather that the current hack.
Reply to this email directly or view it on GitHub: https://github.com/orfjackal/idea-sbt-plugin/issues/51#issuecomment-2746532
Jason Zaugg mailto:[email protected] 15 November 2011 3:47pm "I know that IDEA's own console supports ANSI colour sequences" I didn't know that. Looks like it isn't supported across the board, though:
http://youtrack.jetbrains.net/issue/IDEA-68679 http://youtrack.jetbrains.net/issue/IDEA-69880
I'll poke through the sources and see if I can find a way. Would be great to use this for SBT colorization rather that the current hack.
Reply to this email directly or view it on GitHub: https://github.com/orfjackal/idea-sbt-plugin/issues/51#issuecomment-2746532
This would also be nice for scalatest output
Is it still relevant since it is supported by Grep Console plugin?
@krasa SBT Console plugin seems to strip ANSI color codes, so your Grep Console cannot see them. =(
@retronym Maybe there could be an option somewhere in SBT Console's settings to turn this stripping off? =)
The plugin sets -Dsbt.nologformat=true
(or something like that) to instruct SBT not to colorize the output.
@retronym setting this to false
in https://github.com/orfjackal/idea-sbt-plugin/blob/756a2ed6b70024f6ab71aed7310f973d17f825b8/sbt-plugin/src/main/java/net/orfjackal/sbt/runner/SbtRunner.java#L55 (or removing this line altogether) doesn't make the plugin output ANSI codes for me. I've tried changing jline.terminal
to jline.UnixTerminal
, with no success either.
SBT documentation, http://www.scala-sbt.org/release/docs/faq.html#how-do-i-disable-ansi-codes-in-the-output, says:
Sometimes sbt doesn't detect that ansi codes aren't supported and you get output that looks like:
So it seems SBT is doing some checks on its own and may decide to not output ANSI color codes even if -Dsbt.log.noformat=true
. =(