From 494755f0f72331c610c8c537f830f8cd70344f90 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Fri, 14 Jun 2019 16:38:18 -0700 Subject: [PATCH] Clear meta build state on session save The `session save` command has the side effect of modifying a "*.sbt" file so we don't want to warn about changes or automatically reload when we return to the shell. Setting the hasCheckedMetaBuild attribute key to false is sufficient to prevent this. Ref: https://github.com/sbt/sbt/issues/4813 --- main/src/main/scala/sbt/MainLoop.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/src/main/scala/sbt/MainLoop.scala b/main/src/main/scala/sbt/MainLoop.scala index b3e0f10b9..3f4f48217 100644 --- a/main/src/main/scala/sbt/MainLoop.scala +++ b/main/src/main/scala/sbt/MainLoop.scala @@ -18,6 +18,7 @@ import sbt.internal.util.{ ErrorHandling, GlobalLogBacking } import sbt.io.{ IO, Using } import sbt.protocol._ import sbt.util.Logger +import sbt.nio.Keys._ import scala.annotation.tailrec import scala.util.control.NonFatal @@ -185,6 +186,8 @@ object MainLoop { try { def process(): State = { val newState = Command.process(exec.commandLine, state) + if (exec.commandLine.contains("session")) + newState.get(hasCheckedMetaBuild).foreach(_.set(false)) val doneEvent = ExecStatusEvent( "Done", channelName,