mirror of https://github.com/sbt/sbt.git
Rethrow InterruptedException instead of ClosedException
There are cases where sbt will incorrectly shutdown if the jline reader is interrupted while filling the input buffer. To fix this we can throw an InterruptedException instead of a ClosedException. The repro for this was start `sbt`, input `~compile` and while sbt was starting up, open a source file with vim using the metals bsp integration. sbt server would end up shutting down everytime after a single compilation iteration.
This commit is contained in:
parent
d46d5dfff5
commit
c24e7da844
|
|
@ -172,7 +172,7 @@ private[sbt] object JLine3 {
|
|||
if (buffer.isEmpty && !peek) fillBuffer()
|
||||
(if (peek) buffer.peek else buffer.take) match {
|
||||
case null => -2
|
||||
case i => if (i == -3) throw new ClosedException else i
|
||||
case i => if (i == -3) throw new InterruptedException else i
|
||||
}
|
||||
}
|
||||
override def peek(timeout: Long): Int = buffer.peek() match {
|
||||
|
|
|
|||
Loading…
Reference in New Issue