summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2017-02-08 16:05:03 +0100
committerAntoine Gourlay <antoine@gourlay.fr>2017-02-21 15:39:26 +0100
commit6411170ede09ace8e5f1f018dcf5661846ed7d27 (patch)
tree986f4f46a7e4de16850c654f19cc39721d9a7717 /src/reflect
parent76bfb9e0e5f38ce264f2a03490731f5865fa468f (diff)
downloadscala-6411170ede09ace8e5f1f018dcf5661846ed7d27.tar.gz
scala-6411170ede09ace8e5f1f018dcf5661846ed7d27.tar.bz2
scala-6411170ede09ace8e5f1f018dcf5661846ed7d27.zip
SD-256 enable colored output by default on unix
`scala.color` now has 3 states: `true`, `false` and `auto` (the default). `auto` allows colors if not on windows and if the shell is interactive (as in, both stdin and stdout are a tty). The autodetect works as expected when run via SBT too, and it can always be overriden on the CLI or via JAVA_OPTS.
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/TypeDebugging.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/TypeDebugging.scala b/src/reflect/scala/reflect/internal/TypeDebugging.scala
index e9050b4e33..58359e66d9 100644
--- a/src/reflect/scala/reflect/internal/TypeDebugging.scala
+++ b/src/reflect/scala/reflect/internal/TypeDebugging.scala
@@ -59,7 +59,7 @@ trait TypeDebugging {
object typeDebug {
import scala.Console._
- private val colorsOk = sys.props contains "scala.color"
+ private val colorsOk = scala.util.Properties.coloredOutputEnabled
private def inColor(s: String, color: String) = if (colorsOk && s != "") color + s + RESET else s
private def inBold(s: String, color: String) = if (colorsOk && s != "") color + BOLD + s + RESET else s