What environment variables are passed to FSI when running a script with Run Script? #2022
Replies: 4 comments 11 replies
-
Hello @somelinguist, Ionide does nothing special to run the code using ionide-vscode-fsharp/src/Components/ScriptRunner.fs Lines 40 to 44 in 37a241b In general, when updating your With VSCode, it is a little tricky to have the terminal session refreshed because the parent process which handles VSCode keep running from the same state it was when spawned. From my experience, this is why you need to reload VSCode for it to pick up the changes. However this behaviour is not always consistent, for example if I create a new terminal instance from inside VSCode sometimes it has been refreshed sometimes not. I can't give specific examples of this problem with VSCode because it didn't happen to me since sometime now as I moved to some other project which don't have this limitations. |
Beta Was this translation helpful? Give feedback.
-
@MangelMaxime Thanks for the info. Previously looking through the list it seemed like several were not being passed. However, I did some more thorough checking with my script and figured out that actually only one variable looks like it is being stripped, the one I need, of course! The specific one I need is What's really strange however, I fee like this might have actually been working last week, because I hadn't noticed it before yesterday. |
Beta Was this translation helpful? Give feedback.
-
It looks like it might be more complicated than I thought. I thinking using I don't think I'd be able to pull off that. I did think of trying one other things, however, I'm running into the error below when trying build Ionide locally following the instructions at https://github.com/ionide/ionide-vscode-fsharp/blob/main/CONTRIBUTING.md#first-time-build
I've tried running it a few times, but still the same. If I run It's been a while since I've used paket, but searching for that error makes it looks like it might have been because I had old versions of the dotnet sdk installed in addition to the current. However, I've since removed everything but 8.0.100 and restarted my system, but I still get the same errors. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
Ok, I'm still not able to build Ionide locally, but I tried my idea by editing the javascript of the installed extension, and it worked. It turns out that ionide-vscode-fsharp/src/Components/ScriptRunner.fs Lines 30 to 38 in 37a241b I changed it to run So I my new thought is: Would it be reasonable to just add a new setting to manually configure which shell to run? The defaults could still be the same. |
Beta Was this translation helpful? Give feedback.
-
What environment variables are passed to FSI when running ascript with
Run script
?Running the script below has different output via the
Run script
command vsdotnet fsi script.fsx
in the integrated terminal. Testing with dotnet 8.0.100, Ionide 7.20.3, vscode 1.90.2 on macOS 14.5It seems like at least some variables exported from my
.zshrc
are passed when usingRun script
, but not all of them. Changes to to values in.zshrc
that do show up withRun script
don't always seem to be picked up on the next run, but some are after restarting vscode.When running
dotnet fsi script.fsx
in the integrated terminal, variables exported from.zshrc
are printed, and changes in.zshrc
show up after starting a new session as expected.Does the
Run script
command actually use my.zshrc
? Does it filter out certain variables? Is there something I can do to make it consistent with the integrated terminal?Beta Was this translation helpful? Give feedback.
All reactions