mirror of https://github.com/sbt/sbt.git
Don't stop watch input thread on bad input
In a continuous build in sbt 1.4.0-RC1, if the user enters an invalid option, it causes the input thread to exit which means the watch would no longer accept input commands (including <enter> to exit). This fixes that behavior.
This commit is contained in:
parent
cc0445db4e
commit
1e448bb403
|
|
@ -788,7 +788,7 @@ private[sbt] object Continuous extends DeprecatedContinuous {
|
||||||
try {
|
try {
|
||||||
interrupted.set(false)
|
interrupted.set(false)
|
||||||
terminal.inputStream.read match {
|
terminal.inputStream.read match {
|
||||||
case -1 => Watch.Ignore
|
case -1 => throw new InterruptedException
|
||||||
case 3 => Watch.CancelWatch // ctrl+c on windows
|
case 3 => Watch.CancelWatch // ctrl+c on windows
|
||||||
case byte => inputHandler(byte.toChar.toString)
|
case byte => inputHandler(byte.toChar.toString)
|
||||||
}
|
}
|
||||||
|
|
@ -800,7 +800,7 @@ private[sbt] object Continuous extends DeprecatedContinuous {
|
||||||
action match {
|
action match {
|
||||||
case Watch.Ignore =>
|
case Watch.Ignore =>
|
||||||
val stop = interrupted.get || Thread.interrupted
|
val stop = interrupted.get || Thread.interrupted
|
||||||
if ((!Terminal.systemInIsAttached || alternative.isDefined) && !stop) impl()
|
if (!stop) impl()
|
||||||
else None
|
else None
|
||||||
case r => Some(r)
|
case r => Some(r)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue