VS Code: Julia Env different in status bar and REPL


As title already says, why does VC Code show two different activatated envs? I want to work in Oceananigans instead of in v1.5 but the REPL doesnt change.

Yeah, that’s a bit unfortunate. I think you can click on the Project.toml in the sidebar and select Julia: Activate this environment. Although that only works in the built-in REPL, not when opening one from your shell like in the screenshot; you need to type e.g. activate . in that case or start Julia with julia project=..


Thanks, but that doesnt work. I did Julia: Activate this environment but then my env switched to ‘benchmarks’.
The other suggestions have been leading to errors so far.
Why is there the difference between the status bar and REPL at all? Is this a VS Code bug?

I mean you have to select the right environment, no? So don’t click on benchmarks, click on Oceananigns.jl.

What errors are you seeing?

Because the two aren’t synced at the moment (and never will be for any non-integrated REPL sessions like you’re running in the screenshot).

Your first suggestion worked, I didnt realize there were several project.toml files in the sidebar. Sorry for the confusion.

I have one more question. When running a file, the panel used to show the output in the “Terminal” tab. Now its switching automatically to “terminal”. Why is this? All those problems occured since the last VS Code update.

No worries.

Can you share a screenshot/gif of what’s happening? I haven’t seen/heard of anything like this before. Also, what VSCode version are you using right now?

So when I`m running a file I expect the output to be in the terminal behind “julia>”. Instead the panel switches automatically to “output”.
I guess practically it doesnt make much of a difference since the information is the same. But I have to switch back manually every time I want to operate in julia.

That command isn’t from the Julia extension. You’ll want to use Julia: Execute File in REPL instead.

Huh, thanks. But that wasnt always the case was it? I am rather new to Julia and VS Code but the last two weeks I was running the files without the extra command.

The version btw is:

Version: 1.54.3
Commit: 2b9aebd5354a3629c3aba0a5f5df49f43d6689f8
Date: 2021-03-16T00:31:32.470Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
OS: Linux x64 5.4.101-1-MANJARO

The command got renamed and moved into the context menu. Apart from that nothing changed (although you might’ve installed another extension that provides the “Run Code” command).

Thank you