mirror of https://github.com/sbt/sbt.git
Merge pull request #6017 from eatkins/log-format-color
Set color by default only if log format enabled
This commit is contained in:
commit
078b9c69c5
|
|
@ -314,7 +314,10 @@ object Terminal {
|
|||
private[this] def useColorDefault: Boolean = {
|
||||
// This approximates that both stdin and stdio are connected,
|
||||
// so by default color will be turned off for pipes and redirects.
|
||||
props.map(_.color).orElse(isColorEnabledProp).getOrElse((hasConsole && !isDumbTerminal) || isCI)
|
||||
props
|
||||
.map(_.color)
|
||||
.orElse(isColorEnabledProp)
|
||||
.getOrElse((hasConsole && !isDumbTerminal && logFormatEnabled.getOrElse(true)) || isCI)
|
||||
}
|
||||
private[this] lazy val isColorEnabledProp: Option[Boolean] =
|
||||
sys.props.get("sbt.color").orElse(sys.props.get("sbt.colour")).flatMap(parseLogOption)
|
||||
|
|
|
|||
Loading…
Reference in New Issue