Feature request: sbtn should reevaluate env variables

Given a hello world application that reads out an environment variable and prints it out:

@main def Main(args: String*): Unit =

when I run:

FOO=BAR bloop run my-project

I correctly see BAR, however when I run

FOO=BAR sbtn run

I see null.

In fact the behavior is flaky. It depends on how the server was started. If the server was not running to begin with, then yes

FOO=BAR sbtn run

will indeed print out BAR and the subsequent requests as well. However as soon as we change it to

FOO=NOT_BAR sbtn run

we will keep seeing the incorrect BAR.

1 Like

I also opened an issue since I’m not sure whether it’s an issue or a feature request sbtn should reevaluate env variables · Issue #7012 · sbt/sbt · GitHub