mirror of https://github.com/sbt/sbt.git
Merge pull request #6807 from eed3si9n/bport/6803
[1.6.x] fix: propagate `InterruptedException` from JLine.readLine
This commit is contained in:
commit
611b8cf01b
|
|
@ -178,13 +178,7 @@ abstract class JLine extends LineReader {
|
||||||
protected[this] lazy val in: InputStream = Terminal.wrappedSystemIn
|
protected[this] lazy val in: InputStream = Terminal.wrappedSystemIn
|
||||||
|
|
||||||
override def readLine(prompt: String, mask: Option[Char] = None): Option[String] =
|
override def readLine(prompt: String, mask: Option[Char] = None): Option[String] =
|
||||||
try {
|
unsynchronizedReadLine(prompt, mask)
|
||||||
unsynchronizedReadLine(prompt, mask)
|
|
||||||
} catch {
|
|
||||||
case _: InterruptedException =>
|
|
||||||
// println("readLine: InterruptedException")
|
|
||||||
Option("")
|
|
||||||
}
|
|
||||||
|
|
||||||
private[this] def unsynchronizedReadLine(prompt: String, mask: Option[Char]): Option[String] =
|
private[this] def unsynchronizedReadLine(prompt: String, mask: Option[Char]): Option[String] =
|
||||||
readLineWithHistory(prompt, mask) map { x =>
|
readLineWithHistory(prompt, mask) map { x =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue