marios marios - 1 month ago 10
Scala Question

How to have colored REPL for 'sbt console'?

From Scala 2.11.4 onwards you can get a colored REPL by invoking

scala -Dscala.color
. My question is whether it is possible to get the same colored REPL when I call
sbt console
within my SBT project?

Answer Source

Put this into your ~/.sbt/0.13/user.sbt:

initialize ~= { _ =>
  val ansi = System.getProperty("sbt.log.noformat", "false") != "true"
  if (ansi) System.setProperty("scala.color", "true")