I would like to disable the color escape codes logged from sbt/play. Is this possible? And if it is, is there a way to do it without making changes to the config - i.e. via
You can simply set the system property sbt.log.noformat
to true
. If you want to e.g. use SBT inside Vim you can create a script like this:
#!/bin/bash
java -Dsbt.log.noformat=true $JAVA_OPTS -jar "${HOME}/bin/sbt-launch.jar" "$@"
Since version 0.13.8
(and possibly earlier) you can now simply use the -no-colors
option to sbt. e.g.
sbt -no-colors test
This sounds like your platform does not match the actual jline.terminal property. I am just guessing here but when I pass the parameter as Daniel suggested on a Windows command line I see the color escape codes as well.
Therefore, you have to make sure the property matches your platform, i.e. WindowsTerminal on Windows and UnixTerminal on Unix.
If this does not help, then you might be on an unsupported platform in which case the website suggests to use:
-Djline.terminal=jline.UnsupportedTerminal
Well, you can get colors on Windows by installing Cygwin and passing this parameter:
-Djline.terminal=jline.UnixTerminal
So I'd look up jline parameters to see what disables color coding.
I was able to get colored output from SBT in Cygwin by adding:
-Djline.terminal=jline.UnixTerminal
Additionally I figured out that I also needed to add the following line to Cygwin.bat:
set CYGWIN=tty ntsec
After that is added SBT gives very nice colored output. Additionally I would recommend looking into Console2 as it can hook through Cygwin, but provides a much better interface in my opinion:
http://sourceforge.net/projects/console/