From 6103444d5d000d3cc8f337c04ef7b45aea5a746d Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Sat, 26 Sep 2020 11:51:06 -0700 Subject: [PATCH] Fix interaction service for thin client The global SimpleReader hardwires Terminal.console so it won't work with the ThinClient. --- main/src/main/scala/sbt/CommandLineUIService.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/main/scala/sbt/CommandLineUIService.scala b/main/src/main/scala/sbt/CommandLineUIService.scala index be7fa6783..319021645 100644 --- a/main/src/main/scala/sbt/CommandLineUIService.scala +++ b/main/src/main/scala/sbt/CommandLineUIService.scala @@ -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 }