From c6ab4d843e81463f5ab88eafa8688988d5a99490 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Mon, 23 Nov 2020 13:45:17 -0800 Subject: [PATCH] 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. --- main/src/main/scala/sbt/MainLoop.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/main/src/main/scala/sbt/MainLoop.scala b/main/src/main/scala/sbt/MainLoop.scala index 1943bc083..384b05cf2 100644 --- a/main/src/main/scala/sbt/MainLoop.scala +++ b/main/src/main/scala/sbt/MainLoop.scala @@ -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))