Don't use ProxyTerminal in background job

If we use the ProxyTerminal in the background jobs, the logs
would be spread across different terminals, switching from active
client to active client. We want the logs to stick
to the client that started the job.
This commit is contained in:
Adrien Piquerez 2022-08-04 15:59:25 +02:00
parent 6bcda6684a
commit 592086b889
2 changed files with 2 additions and 1 deletions

View File

@ -438,6 +438,7 @@ object Terminal {
override def toString: String = s"ProxyTerminal(current = $t)"
}
private[sbt] def get: Terminal = ProxyTerminal
private[sbt] def current: Terminal = activeTerminal.get
private[sbt] def withIn[T](in: InputStream)(f: => T): T = {
val original = inputStream.get

View File

@ -149,7 +149,7 @@ object LogManager {
task: ScopedKey[_],
context: LoggerContext
): ManagedLogger = {
val console = screen(task, state)
val console = ConsoleAppender("bg-" + ConsoleAppender.generateName(), ITerminal.current)
LogManager.backgroundLog(data, state, task, console, relay(()), context)
}
}