Fix watch shell option

When a user returns to the shell with 's' in recent versions of sbt, the
prompt is not initially displayed. This ends up being because MainLoop
was incorrectly setting the terminal prompt to Prompt.Watch when it
exited watch. I realized in debugging the issue that it didn't make
sense to restort the terminal prompt to the initial value before task
evaluation. By removing that logic, the 's' option option started
working correctly again.
This commit is contained in:
Ethan Atkins 2020-11-23 13:45:17 -08:00
parent 3a7ab8cf5e
commit c6ab4d843e
1 changed files with 0 additions and 2 deletions

View File

@ -222,11 +222,9 @@ object MainLoop {
val (restoreTerminal, termState) = channelName.flatMap(exchange.channelForName) match {
case Some(c) =>
val prevTerminal = ITerminal.set(c.terminal)
val prevPrompt = c.terminal.prompt
// temporarily set the prompt to running during task evaluation
c.terminal.setPrompt(Prompt.Running)
(() => {
if (c.terminal.prompt != Prompt.Watch) c.terminal.setPrompt(prevPrompt)
ITerminal.set(prevTerminal)
c.terminal.flush()
}) -> progressState.put(Keys.terminalKey, Terminal(c.terminal))