mirror of https://github.com/sbt/sbt.git
Use the new FullReader
This commit is contained in:
parent
a94107e673
commit
e7456b5653
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 _ =>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue