-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Things missing from PATH variable in OS X Big Sur #118460
Comments
@bwateratmsft I feel like I've seen this when I launch VS Code from the dock rather than using |
That's something we have seen as well, due to a 10+ year old bug in OS X. As far as I can tell though, lately it's not always happening due to launching from the Dock or Spotlight; and also seems way more frequent on Big Sur than before--which makes me wonder if this is more recent/widespread; i.e. some kind of regression. |
with From the issues you have linked, they seem to be on older versions that what I had mentioned. Would help if there is a minimal repro to debug further on newer versions. |
That's the kicker...we've never been able to repro this in-house. 😞 |
Next time, can you ask the users to launch vscode like
This should print some verbose logs of what is passed into the child_process calls that might add some insight to the issue |
Good idea, I'll try that next time we see the issue occur. Hopefully it won't happen soon...we took a change so that if we don't see |
I've started having this issue out of nowhere today. I'm on macOS Catalina with VS Code 1.54.1. I have a shell task that simply runs EDIT: a dirty workaround is to add EDIT2: launching from the dock or using |
@hugoiko can you provide the output from #118460 (comment) if you can repro this issue. Thanks! |
microsoft/vscode#94153 microsoft/vscode#118460 microsoft/vscode-docs@38653d4 https://code.visualstudio.com/docs/editor/integrated-terminal The VSCode integrated terminal changes the order of `$PATH`. Setting `"terminal.integrated.inheritEnv": false` prevents this behavior.
FWIW, I was able to reproduce similar behavior when VSCode was launched automatically after a reboot—the PATH was all screwed up (I noticed because a dependency I was using in a jupyter notebook, pandoc, wouldn't resolve because it wasn't on the PATH). Launching (via Quicksilver) gave me the right path, but auto-launch after reboot did not. |
We continue without the env variables from the shell if retrieving them takes more than 10 seconds which is more likely to happen when the machine is under load (like during startup). We used to have a notification in the UI for this, but now it only appears in the log.
Remote-Containers is now also adding |
We ultimately ended up doing the same thing in the Docker extension. |
I believe I am encountering the same issue on macOS Monterey 12.0.1 and VSCode 1.63.0.
I noticed the issue when my Go extension was not loading the proper Here are some screenshots from launching VSCode in different ways.
A few notes that may be helpful when looking at the following logs/screenshots (I am including GOPATH info too since that is how I noticed the issue):
Launched using
Launched using Raycast
Launched using Spotlight
Launched from dock icon
I also have logs from launching VSCode from the terminal using These are the logs I get when I run the command with no instances open: These are the logs I get when I run the command while a VSCode instance is already open: |
Likely the same problem with minimal reproducible steps in #145434. Behavior appears to be (at least) in tasks on macOS when:
Unfortunately the requirement not to launch from the command line obviates the possibility of the node debug logs in the usual fashion. Happy to try another way if possible. |
I'm having this issue right now with devcontainers. We ask our developers to include some secrets in their environment so that the containers can get built correctly. This all works when using Anyhow, I've had to tell my developers to only open Code from the command line, which is a bit of a pain but not a showstopper. Edit: my only workaround is to run |
@divmgl The environment can be set in many ways in Code itself depending on the desire to use it in Tasks, Terminal, or other components. Would that be a better solution for your use case than setting the shell environment which is, as you note, somewhat less consistently imported? |
I can confirm this to be an ongoing issue in macOS Monterey 12.2.1 and VSCode 1.65.2. To reproduce:
Result:
Workaround:
|
When launching vscode through spotlight, raycast, or finder, I get this error when trying to build my dotnet project.
|
@ostwilkens Please see this comment for possible workarounds, let us know if one of those doesn’t work. Thanks! |
Thank you for the quick reply! My findings:
|
Changing the task type from |
@ostwilkens, I'm afraid there are a couple of issues in your comment that aren't quite right. I'm going to reply to them directly here, then add a follow-up comment with more generic comments about how macOS and Visual Studio Code are coming up with the environments in which to run things. The issue is obviously overcomplicated, as you've figured out and referenced very nicely, but there's unfortunately a great deal of misunderstanding out there, primarily due to recommendations that worked on previous versions of macOS but don't anymore. There's plenty of discussion in the dotnet issue you link about how it all "should" work, and I'm going to try to avoid that, but dotnet on macOS does add itself to the path in a common macOS way; it just happens not to be a common way on other platforms. And similar to that mechanism, macOS still does have a I'm very interested to hear that your problem seems to be solved by using the "process" type as it doesn't "look" at first glance like that should change the way VS Code develops the environment on Linux and macOS. Definitely will need to test more myself. Most importantly, of course, I'm glad you got it working! |
Work in progress: |
@therealchjones that's a great document for understanding the functionality! Oh, and it was the "shell" type that fixed the problem with the tasks. However, I'm sorry to say OmniSharp isn't happy about dotnet not being in PATH, and fails to run debugging. I'm back to launching vscode from the terminal. |
@therealchjones that is a GREAT document, thank you! |
We have made some process architecture changes over the last couple of months for the extension host, does this issue repro with latest insiders https://code.visualstudio.com/insiders ? |
@deepak1556 we've made a lot of changes in the Docker extension too; likely they will make it more sensitive to issues with |
We have another user hitting it here: microsoft/vscode-docker#3811
|
Also, #173480 seems the same as or similar to this. |
Hey @deepak1556, this issue might need further attention. @bwateratmsft, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
We have not been able to reproduce this issue ourselves, but have seen a lot of users hitting problems with the
PATH
variable missing some things on Big Sur. It does not happen when running the Terminal app nor within terminals manually-launched within VSCode, but does seem to happen when things execute as tasks or in the background via child_process.As a result of missing entries, commands like
docker ...
fail.microsoft/vscode-docker#2758(ended up beingterminal.integrated.inheritEnv
==false
)microsoft/vscode-docker#2366
microsoft/vscode-docker#2254
microsoft/vscode-docker#2574
microsoft/vscode-docker#2577
Maybe related to #115738 or #21655?
The text was updated successfully, but these errors were encountered: