mirror of https://github.com/sbt/sbt.git
Merge pull request #5966 from eatkins/piped-output-fix
Remove ansi control characters from piped output
This commit is contained in:
commit
aec55af083
|
|
@ -91,9 +91,9 @@ private[sbt] final class ProgressState(
|
||||||
printStream: PrintStream,
|
printStream: PrintStream,
|
||||||
hasProgress: Boolean
|
hasProgress: Boolean
|
||||||
): Unit = {
|
): Unit = {
|
||||||
val canClearPrompt = currentLineBytes.get.isEmpty
|
|
||||||
addBytes(terminal, bytes)
|
|
||||||
if (hasProgress) {
|
if (hasProgress) {
|
||||||
|
val canClearPrompt = currentLineBytes.get.isEmpty
|
||||||
|
addBytes(terminal, bytes)
|
||||||
val toWrite = new ArrayBuffer[Byte]
|
val toWrite = new ArrayBuffer[Byte]
|
||||||
terminal.prompt match {
|
terminal.prompt match {
|
||||||
case a: Prompt.AskUser if a.render.nonEmpty && canClearPrompt =>
|
case a: Prompt.AskUser if a.render.nonEmpty && canClearPrompt =>
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ object Terminal {
|
||||||
private[sbt] def withStreams[T](isServer: Boolean)(f: => T): T =
|
private[sbt] def withStreams[T](isServer: Boolean)(f: => T): T =
|
||||||
// In ci environments, don't touch the io streams unless run with -Dsbt.io.virtual=true
|
// In ci environments, don't touch the io streams unless run with -Dsbt.io.virtual=true
|
||||||
if (System.getProperty("sbt.io.virtual", "") == "true" || (logFormatEnabled.getOrElse(true) && !isCI)) {
|
if (System.getProperty("sbt.io.virtual", "") == "true" || (logFormatEnabled.getOrElse(true) && !isCI)) {
|
||||||
hasProgress.set(isServer)
|
hasProgress.set(isServer && formatEnabledInEnv)
|
||||||
consoleTerminalHolder.set(newConsoleTerminal())
|
consoleTerminalHolder.set(newConsoleTerminal())
|
||||||
activeTerminal.set(consoleTerminalHolder.get)
|
activeTerminal.set(consoleTerminalHolder.get)
|
||||||
try withOut(withIn(f))
|
try withOut(withIn(f))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue