mirror of https://github.com/sbt/sbt.git
Reset jline on exit
The console input did not work correctly after a reboot because the console was still reading from System.in.
This commit is contained in:
parent
77b1e38e41
commit
eb66906dad
|
|
@ -261,7 +261,11 @@ object Terminal {
|
|||
*/
|
||||
private[sbt] def withStreams[T](f: => T): T =
|
||||
if (System.getProperty("sbt.io.virtual", "true") == "true") {
|
||||
withOut(withIn(f))
|
||||
try withOut(withIn(f))
|
||||
finally {
|
||||
jline.TerminalFactory.reset()
|
||||
console.close()
|
||||
}
|
||||
} else f
|
||||
|
||||
private[this] object ProxyTerminal extends Terminal {
|
||||
|
|
@ -355,7 +359,7 @@ object Terminal {
|
|||
latch.countDown()
|
||||
buffer.size
|
||||
}
|
||||
override def close(): Unit = {
|
||||
override def close(): Unit = if (closed.compareAndSet(false, true)) {
|
||||
executor.shutdownNow()
|
||||
()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue