How can colored terminal output be disabled for sbt/play?

12,970

Solution 1

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" "$@"

Solution 2

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

Solution 3

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
Share:
12,970
Mark Hibberd
Author by

Mark Hibberd

Updated on June 14, 2022

Comments

  • Mark Hibberd
    Mark Hibberd almost 2 years

    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 a command line switch or system property.