mirror of
https://github.com/sbt/sbt.git
synced 2026-08-22 06:07:24 +02:00
Disable color by default if formatting is disabled
If a user runs with -Dsbt.log.format=false or -Dsbt.log.noformat=true, we should disable color by default. Running with -Dsbt.color=true should make this possible.
This commit is contained in:
@@ -317,7 +317,7 @@ object Terminal {
|
|||||||
props
|
props
|
||||||
.map(_.color)
|
.map(_.color)
|
||||||
.orElse(isColorEnabledProp)
|
.orElse(isColorEnabledProp)
|
||||||
.getOrElse((hasConsole && !isDumbTerminal && logFormatEnabled.getOrElse(true)) || isCI)
|
.getOrElse(logFormatEnabled.getOrElse(true) && ((hasConsole && !isDumbTerminal) || isCI))
|
||||||
}
|
}
|
||||||
private[this] lazy val isColorEnabledProp: Option[Boolean] =
|
private[this] lazy val isColorEnabledProp: Option[Boolean] =
|
||||||
sys.props.get("sbt.color").orElse(sys.props.get("sbt.colour")).flatMap(parseLogOption)
|
sys.props.get("sbt.color").orElse(sys.props.get("sbt.colour")).flatMap(parseLogOption)
|
||||||
|
|||||||
Reference in New Issue
Block a user