vscode: Things missing from PATH variable in OS X Big Sur
- VS Code Version: (various)
- OS Version: OS X Big Sur
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.
~~https://github.com/microsoft/vscode-docker/issues/2758~~ (ended up being terminal.integrated.inheritEnv
== false
)
https://github.com/microsoft/vscode-docker/issues/2366
https://github.com/microsoft/vscode-docker/issues/2254
https://github.com/microsoft/vscode-docker/issues/2574
https://github.com/microsoft/vscode-docker/issues/2577
Maybe related to https://github.com/microsoft/vscode/issues/115738 or https://github.com/microsoft/vscode/issues/21655?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 31 (13 by maintainers)
Work in progress:
PATH
in macOS and VS Code@deepak1556 we’ve made a lot of changes in the Docker extension too; likely they will make it more sensitive to issues with
$PATH
. So far we haven’t seen any customer reports of problems that look like$PATH
issues, but I’ll respond back if we see anything.I can confirm this to be an ongoing issue in macOS Monterey 12.2.1 and VSCode 1.65.2.
To reproduce:
${env:PATH}
in the path set interminal.integrated.env.osx
in workspace or user settingsResult:
/usr/bin:/bin:/usr/sbin:/sbin
; this can be verified in the Developer Tools console asprocess.env
/usr/bin:/bin:/usr/sbin:/sbin
Workaround:
terminal.integrated.env.osx
, tasks will set it from the environment used in a typical interactive login shell for the user (some caveats apply; this partially contradicts the documentation at https://code.visualstudio.com/docs/editor/tasks#_why-do-i-get-command-not-found-when-running-a-task)options.env
settings for the task, this will override theterminal.integrated.env.osx
setting; non-intuitively (as noted in #145434),${env:PATH}
in the task options does substitute the PATH from a typical interactive login shell rather than the environment Code is running under.