From a798c4adffb66b631c6965bf53a999037f05323b Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 25 Apr 2018 16:55:26 -0400 Subject: [PATCH] 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. --- main-actions/src/main/scala/sbt/Console.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main-actions/src/main/scala/sbt/Console.scala b/main-actions/src/main/scala/sbt/Console.scala index 61bfb9e47..9bc20d676 100644 --- a/main-actions/src/main/scala/sbt/Console.scala +++ b/main-actions/src/main/scala/sbt/Console.scala @@ -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) } }