Fix interaction service for thin client

The global SimpleReader hardwires Terminal.console so it won't work with
the ThinClient.
This commit is contained in:
Ethan Atkins 2020-09-26 11:51:06 -07:00
parent a79ef52f74
commit 6103444d5d
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import sbt.internal.util.{ SimpleReader, Terminal }
trait CommandLineUIService extends InteractionService {
override def readLine(prompt: String, mask: Boolean): Option[String] = {
val maskChar = if (mask) Some('*') else None
SimpleReader.readLine(prompt, maskChar)
SimpleReader(Terminal.get).readLine(prompt, maskChar)
}
// TODO - Implement this better.
override def confirm(msg: String): Boolean = {
@ -21,7 +21,7 @@ trait CommandLineUIService extends InteractionService {
(in == "y" || in == "yes")
}
}
SimpleReader.readLine(msg + " (yes/no): ", None) match {
SimpleReader(Terminal.get).readLine(msg + " (yes/no): ", None) match {
case Some(Assent()) => true
case _ => false
}