How can I disable the terminal color output for sbt / play?

I would like to disable color evacuation codes recorded from sbt / play. Is it possible? And if so, is there a way to do this without making changes to the configuration, that is, using the command line or the system property.

+47
scala playframework sbt
Nov 24 '10 at 12:56
source share
5 answers

You can simply set the sbt.log.noformat system property to true . If you want, for example, use SBT inside Vim, you can create a script as follows:

 #!/bin/bash java -Dsbt.log.noformat=true $JAVA_OPTS -jar "${HOME}/bin/sbt-launch.jar" "$@" 
+48
Nov 24 '10 at 16:49
source share

Starting with version 0.13.8 (and possibly earlier), you can simply use the -no-colors option for sbt. eg.

 sbt -no-colors test 
+28
Jul 01 '15 at
source share

It looks like your platform does not match the real jline.terminal property. I am just guessing here, but when I pass the parameter Daniel proposed on the Windows command line, I also see color escape codes.

Therefore, you must ensure that the property matches your platform, i.e. WindowsTerminal on Windows and UnixTerminal on Unix.

If this does not help, you may find yourself on an unsupported platform, in which case the website suggests using:

 -Djline.terminal=jline.UnsupportedTerminal 
+2
Nov 24 '10 at 16:32
source share

Well, you can get the colors on Windows by installing Cygwin and passing this parameter:

 -Djline.terminal=jline.UnixTerminal 

So, I looked through the jline options to find out what disables color coding.

0
Nov 24 '10 at 16:12
source share

I managed to get color output from SBT in Cygwin by adding:

 -Djline.terminal=jline.UnixTerminal 

In addition, I realized that I also need to add the following line to Cygwin.bat:

 set CYGWIN=tty ntsec 

After that, SBT gives a very nice color output. In addition, I would recommend looking at Console2, as it can connect via Cygwin, but, in my opinion, provides a much better interface:

http://sourceforge.net/projects/console/

0
Dec 11 '10 at 15:52
source share



All Articles