Fix supershell line interlacing with logs

In 3b09ff6af7, we stopped adding a clear
screen after curser after each log line. This inadvertently caused
supershell lines to get interlaced with log lines. This can be fixed by
writing a ClearScreenAfterCursor after every newline character that we
write to stdout.

As a bonus, I had also long noticed that supershell log lines would get
interlaced with the serverTestProj/test output and this change fixes
that as well.
This commit is contained in:
Ethan Atkins 2020-11-18 11:17:13 -08:00
parent 22885e4cba
commit 85d17889b6
1 changed files with 4 additions and 1 deletions

View File

@ -100,7 +100,10 @@ private[sbt] final class ProgressState(
toWrite ++= (DeleteLine + ClearScreenAfterCursor + CursorLeft1000).getBytes("UTF-8")
case _ =>
}
toWrite ++= bytes
bytes.foreach { b =>
if (b == 10) toWrite ++= ClearScreenAfterCursor.getBytes("UTF-8")
toWrite += b
}
toWrite ++= ClearScreenAfterCursor.getBytes("UTF-8")
if (bytes.endsWith(lineSeparatorBytes)) {
if (progressLines.get.nonEmpty) {