mirror of https://github.com/sbt/sbt.git
Merge pull request #5854 from eatkins/jline-reader
Use DumbTerminal if sbt.log.noformat=true
This commit is contained in:
commit
3bee2cff9a
|
|
@ -75,7 +75,7 @@ private[sbt] object JLine3 {
|
|||
}
|
||||
}
|
||||
private[sbt] def apply(term: Terminal): JTerminal = {
|
||||
if (System.getProperty("jline.terminal", "") == "none")
|
||||
if (System.getProperty("jline.terminal", "") == "none" || !Terminal.formatEnabledInEnv)
|
||||
new DumbTerminal(term.inputStream, term.outputStream)
|
||||
else wrapTerminal(term)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -768,14 +768,17 @@ object Terminal {
|
|||
// older Scala, since it shaded classes but not the system property
|
||||
private[this] def fixTerminalProperty(): Unit = {
|
||||
val terminalProperty = "jline.terminal"
|
||||
val newValue = System.getProperty(terminalProperty) match {
|
||||
case "jline.UnixTerminal" => "unix"
|
||||
case null if System.getProperty("sbt.cygwin") != null => "unix"
|
||||
case "jline.WindowsTerminal" => "windows"
|
||||
case "jline.AnsiWindowsTerminal" => "windows"
|
||||
case "jline.UnsupportedTerminal" => "none"
|
||||
case x => x
|
||||
}
|
||||
val newValue =
|
||||
if (!formatEnabledInEnv) "none"
|
||||
else
|
||||
System.getProperty(terminalProperty) match {
|
||||
case "jline.UnixTerminal" => "unix"
|
||||
case null if System.getProperty("sbt.cygwin") != null => "unix"
|
||||
case "jline.WindowsTerminal" => "windows"
|
||||
case "jline.AnsiWindowsTerminal" => "windows"
|
||||
case "jline.UnsupportedTerminal" => "none"
|
||||
case x => x
|
||||
}
|
||||
if (newValue != null) {
|
||||
System.setProperty(terminalProperty, newValue)
|
||||
()
|
||||
|
|
|
|||
Loading…
Reference in New Issue