Skip to content

Commit

Permalink
Revert run switching on 1.x
Browse files Browse the repository at this point in the history
**Problem**
client-side run apparently won't work for Scala.JS,
so forcing sbtn users to client-side run will break the Scala.JS users.

**Solution**
This reverts the client-side run on sbt 1.x, while retaining the
mechanism for sbt 2.x usages via sbtn.
Now, if `run / connectInput := true` is true, stdout will not display on sbtn.
  • Loading branch information
eed3si9n committed Mar 3, 2025
1 parent f43030a commit ad0b5ed
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions main/src/main/scala/sbt/internal/server/NetworkChannel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,6 @@ final class NetworkChannel(
self.onCancellationRequest(execId, crp)
}

// Take over commandline for network channel
private val networkCommand: PartialFunction[String, String] = {
case cmd if cmd.split(" ").head.split("/").last == "run" =>
s"clientJob $cmd"
}
override protected def appendExec(commandLine: String, execId: Option[String]): Boolean =
if (clientCanWork && networkCommand.isDefinedAt(commandLine))
super.appendExec(networkCommand(commandLine), execId)
else super.appendExec(commandLine, execId)

override private[sbt] def onCommandLine(cmd: String): Boolean =
if (clientCanWork && networkCommand.isDefinedAt(cmd))
appendExec(networkCommand(cmd), None)
else super.onCommandLine(cmd)

protected def setInitializeOption(opts: InitializeOption): Unit = initializeOption.set(opts)

// Returns true if sbtn has declared with canWork: true
Expand Down

0 comments on commit ad0b5ed

Please sign in to comment.