diff --git a/build.sbt b/build.sbt index 20f0b16fa..4f6c079c1 100644 --- a/build.sbt +++ b/build.sbt @@ -43,7 +43,7 @@ def commonSettings: Seq[Setting[_]] = Seq[SettingsDefinition]( testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"), javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"), incOptions := incOptions.value.withNameHashing(true), - crossScalaVersions := Seq(scala211, scala210), + crossScalaVersions := Seq(scala211), bintrayPackage := (bintrayPackage in ThisBuild).value, bintrayRepository := (bintrayRepository in ThisBuild).value, mimaDefaultSettings, diff --git a/main-command/src/main/scala/sbt/internal/ConsoleChannel.scala b/main-command/src/main/scala/sbt/internal/ConsoleChannel.scala index 8bf214365..5b0c99497 100644 --- a/main-command/src/main/scala/sbt/internal/ConsoleChannel.scala +++ b/main-command/src/main/scala/sbt/internal/ConsoleChannel.scala @@ -14,17 +14,15 @@ private[sbt] final class ConsoleChannel extends CommandChannel { case Some(pf) => pf(s) case None => "> " } - val reader = new FullReader(history, s.combinedParser) + val reader = new FullReader(history, s.combinedParser, JLine.HandleCONT, true) override def run(): Unit = { - try { - val line = reader.readLine(prompt) - line match { - case Some(cmd) => append(Exec(CommandSource.Human, cmd)) - case None => append(Exec(CommandSource.Human, "exit")) - } - } catch { - case e: InterruptedException => + // This internally handles thread interruption and returns Some("") + val line = reader.readLine(prompt) + line match { + case Some(cmd) => append(Exec(CommandSource.Human, cmd)) + case None => append(Exec(CommandSource.Human, "exit")) } + askUserThread = None } } @@ -33,21 +31,21 @@ private[sbt] final class ConsoleChannel extends CommandChannel { def publishStatus(status: CommandStatus, lastSource: Option[CommandSource]): Unit = if (status.canEnter) { askUserThread match { - case Some(x) if x.isAlive => // + case Some(x) => // case _ => val x = makeAskUserThread(status) - x.start askUserThread = Some(x) + x.start } } else { - shutdown() lastSource match { case Some(src) if src != CommandSource.Human => - val s = status.state - s.remainingCommands.headOption map { - System.out.println(_) + askUserThread match { + case Some(x) => + shutdown() + case _ => } - case _ => // + case _ => } }