From 95761b2ea1b3b540023cd17c9352380251dc1c79 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 20 Apr 2019 23:51:13 -0400 Subject: [PATCH] Undo cursor tweaks around prompt --- .../main/scala/sbt/internal/util/LineReader.scala | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala b/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala index 549ded4d6..bdebf8deb 100644 --- a/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala +++ b/internal/util-complete/src/main/scala/sbt/internal/util/LineReader.scala @@ -57,20 +57,12 @@ abstract class JLine extends LineReader { else readLineDirectRaw(prompt, mask) - private[this] val console = ConsoleOut.systemOut private[this] def readLineDirectRaw(prompt: String, mask: Option[Char]): Option[String] = { val newprompt = handleMultilinePrompt(prompt) - val result = mask match { + mask match { case Some(m) => Option(reader.readLine(newprompt, m)) case None => Option(reader.readLine(newprompt)) } - - // since the task progress scrolls the logs upward, and expects the cursors to be on - // the last text line, this moves the cursor up to complensate for user hitting return. - val CursorUp1 = s"\u001B[A" - if (ConsoleAppender.showProgress) console.print(CursorUp1) - else () - result } private[this] def handleMultilinePrompt(prompt: String): String = { @@ -87,7 +79,7 @@ abstract class JLine extends LineReader { private[this] def handleProgress(prompt: String): String = { import ConsoleAppender._ - if (showProgress) s"$ScrollUp$DeleteLine" + prompt + if (showProgress) s"$DeleteLine" + prompt else prompt }