From 4f9fe2af6446d75aeb94f88c2738360e773c8aea Mon Sep 17 00:00:00 2001
From: tpetillot
Date: Wed, 26 Jan 2022 16:19:15 +0100
Subject: [PATCH] fix: propagate `InterruptedException` from JLine.readLine
Motivation:
Cannot exit from InteractionService.readLine
Modification:
Remove try/catch of InterruptedException mapped to None in JLine.readLine
---
.../src/main/scala/sbt/internal/util/LineReader.scala | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala b/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala
index d52903d87..fbc86b725 100644
--- a/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala
+++ b/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala
@@ -178,13 +178,7 @@ abstract class JLine extends LineReader {
protected[this] lazy val in: InputStream = Terminal.wrappedSystemIn
override def readLine(prompt: String, mask: Option[Char] = None): Option[String] =
- try {
- unsynchronizedReadLine(prompt, mask)
- } catch {
- case _: InterruptedException =>
- // println("readLine: InterruptedException")
- Option("")
- }
+ unsynchronizedReadLine(prompt, mask)
private[this] def unsynchronizedReadLine(prompt: String, mask: Option[Char]): Option[String] =
readLineWithHistory(prompt, mask) map { x =>