Re-fix console and JLine bug

Fixes #3482 take 3

There are two bugs related REPL and JLine.
1. JLine getting disabled (up arrow not working) on the second run of `console` task.
2. Typed characters not showing up even on the `console` task.

The first issue was fixed by #4054 which added `t.init`. When I noticed the second problem, I fixed it in #4082 (adds `t.restore`) but undid the first fix. This attempts to fix both the issues.
This commit is contained in:
Eugene Yokota 2018-04-25 16:55:26 -04:00
parent 334789c919
commit a798c4adff
1 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,8 @@ final class Console(compiler: AnalyzingCompiler) {
implicit log: Logger): Try[Unit] = {
def console0() =
compiler.console(classpath, options, initialCommands, cleanupCommands, log)(loader, bindings)
JLine.usingTerminal { _ =>
JLine.usingTerminal { t =>
t.init
Run.executeTrapExit(console0, log)
}
}