mirror of https://github.com/sbt/sbt.git
Stop continuous input thread if System.in is closed
The watch tests take forever on windows because wrapped.read() always returns -1 during scripted.
This commit is contained in:
parent
8f4d3f3f8e
commit
2f4c603be6
|
|
@ -288,10 +288,13 @@ private[sbt] object Continuous extends DeprecatedContinuous {
|
|||
override def run(): Unit = {
|
||||
try {
|
||||
if (!closed.get()) {
|
||||
buffer.add(wrapped.read())
|
||||
wrapped.read() match {
|
||||
case -1 => closed.set(true)
|
||||
case b => buffer.add(b)
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
case _: InterruptedException =>
|
||||
case _: InterruptedException => closed.set(true)
|
||||
}
|
||||
if (!closed.get()) run()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue