-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with PATH expansion in VSCode subprocess on macOS #194736
Comments
@joaomoreno I think you're best equip to handle this issue? but feel free to reassign to whoever. |
I can't repro this. To know more, please do the following:
|
@joaomoreno the entire point of long repro is to not start VS Code from the terminal, but from an app launched from macOS. As I said in the bug:
|
@jbevain Using |
@joaomoreno I'm afraid it's not exactly the same as it exhibits a different behavior as it appears the second instance of the
If I close all VSC instances, and do
Things are visibility different as the main Code process seems to inherits the PATH from the Terminal. Whereas if I launch Code manually from the Finder, I get:
So there is a difference. |
Thanks for testing! Very interesting, I was unaware of differences here. Last I saw this (when I did the macOS integration years ago), Can you try just once more with: |
Version: 1.84.0-insider With
|
Hi @joaomoreno, we're seeing a growing number of customer reports on this. I think I've provided all the info that was needed including a way to create a self-contained repro. How could we get this looked at? Thanks! |
Same here guys. Just installed unity + vscode and have this message about missing net sdk. |
I came here from microsoft/vscode-dotnettools#532 as well – and I'm glad I did! I've been banging my head against the " How I Usually Open Unity ProjectsI generally open my Unity Projects is with the following:
![]() If the project isn't already open, Visual Studio Code will open up a new window and load the project. When this happens, I get all the "I can't find How to Open Unity Projects Without the Issue
Regardless, if I open the project in VS Code in this manner, everything works as expected. |
@jbevain, sorry for the silence here. Let's try to figure this one out. First of all, I can't get your Swift sample to work. It launches VS Code but fails to open each workspace properly, even after triple checking that I've changed both workspace paths to something that exists. I really couldn't figure out why... In any case, can I ask you for one more piece of info?
What's the |
Hey @joaomoreno, thanks for bumping this, happy new year, looking forward to having a resolution for this.
That happened to me before I turned the sandbox off. See step 2 of the repro? We could also try the real world scenario with Unity, but it's going to be a slightly longer setup, I'd encourage you to reach out to my email at work to help get you setup.
In that case: The main Visual Studio App inherits the PATH of the Finder (so just /usr/bin:/bin)
Just before calling |
🤦 Sorry about that. It runs correctly now! And I can repro! Funny: it seems to only affect the |
Nice! Good luck :) |
Got it! 🥳 |
This bug has been fixed in the latest release of VS Code Insiders! @jbevain, you can help us out by commenting If things still don't seem right, please ensure you're on version 8172579 of Insiders (today's or later - you can use Happy Coding! |
/verified |
Does this issue occur when all extensions are disabled?: Yes
This one was tricky to investigate and is impacting the
Unity extension
andC#
&C# Dev Kit
scenario. In that scenario, VS Code is started from one application using the macOSopen
command. This reproduces without requiring Unity and with no extension installed. This seems to be a macOS only issue.When opening
Visual Studio Code
either from the macOS Finder or throughopen
, the VS Code application will expand the PATH of itsCode Helper
subprocess so that extensions that depend on something in the path of the terminal will find it.So in my case, if I start VS Code from the Finder, the processes will look like this:
This is expected and good. Extensions can find
dotnet
in the PATH.The issue is that now, if I want to open another workspace in the same instance (but launched from another application), the PATH doesn't get expanded in the second workspace and I get:
So in my second workspace,
dotnet
will not be found in the PATH.For this to happen, VS Code must be started from an application launched from the Finder (and not from the Terminal, otherwise it will inherit the PATH of the Terminal)
Steps to Reproduce:
Modify the variables
workspace1
andworkspace2
to point to 2 different workspaces.Build the project, I personally use
xcodebuild
in command line.Close all VS Code instances.
Start the .app from the Finder, it will be in
build/Release
if you built from the command line by default.Press the
Click to Launch!
buttonAs you can see from the code, the .app will:
ps eww 44049
(Your pid may vary)
The text was updated successfully, but these errors were encountered: