Don't throw ClosedException on ctrl+d

Issue #5974 reported that ctrl+d was not working as expected in the
scala 2.13.{2,3} console. This was because we were throwing an exception
whenever ctrl+d was read instead of allowing the jline line reader to
handle it. I can't remember exactly why I added the throw here but I
validated that both the sbt shell and the scala console had the expected
behavior from the comments in #5974 after this change.
This commit is contained in:
Ethan Atkins 2020-10-14 20:24:48 -07:00
parent b4b688583e
commit 72991be702
1 changed files with 1 additions and 3 deletions

View File

@ -117,9 +117,7 @@ private[sbt] object JLine3 {
}
res match {
case 3 /* ctrl+c */ => throw new ClosedException
case 4 /* ctrl+d */ if term.prompt.render().endsWith(term.prompt.mkPrompt()) =>
throw new ClosedException
case r => r
case r => r
}
}
}