-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Built-in terminal fails to properly initialize PATH with path_helper
on Darwin
#13701
Comments
@geoff-codes so you're saying the |
@Tyriar I have the same problem where my Go installation isn't found when opening Code from Find/Spotlight.
Opening Code from the terminal (iTerm2 in my case) gives me this output:
Cheers. |
You can set the terminal to launch as a login process, this would probably solve these issues as it forces "terminal.integrated.shell.osx": "/bin/bash",
"terminal.integrated.shellArgs.osx": ["-l"] Let me know if that doesn't solve your problem. |
This fixed my problem but I don't know if it's necessary to load my full bash profile in order to ensure PATH is correct (for example, my integrated terminal now runs tmux, lol). Is this a bug? Without the |
As mentioned in #21655 simply having |
@peabnuts123 I actually get this quite a bit so I wrote up a saved reply in GH which you can read below, including the reasons for the decision. This is happening because we don't run the integrated terminal as a login shell by default. You will need to add the following to launch bash as a login shell: // macOS:
"terminal.integrated.shellArgs.osx": [ "-l" ]
// Linux
"terminal.integrated.shellArgs.linux": [ "-l" ] You could also solve this by moving the relevant parts of your More information: |
I'm sorry, I don't see how that's really related. I understand that the integrated terminal is not a login shell; that's WHY it's spooky-action to have the contents of my |
Steps to Reproduce:
$PATH
.So I literal decided to give this Editor a shot maybe 4 minutes ago, so bit of a rocky start 🙀 but at least I can tell you what's up!
On Darwin, the default _SC_PATH (
sysconf PATH
) is augmented (for all users, including root) by the terminal with the paths contained in the file/etc/paths
and in files within/etc/paths.d
. This is done by sourcing the shell with the output/usr/libexec/path_helper
, immediately prior to the shell beginning its own initialization routines (sourcing.[bash][rc|_profile]
, etc. I'm not 100% sure on the implementation but between Terminal.app and especially iTerm (it being open source) it shouldn't be too hard to figure out the "exact right way" to do this.This is extremely important, as paths "as trivial" as
/usr/local/bin
enter thePATH
this way;getconf PATH
is only/usr/bin:/bin:/usr/sbin:/sbin
!Doing a 10 second search, this is probably also #13671, and I'd guess a few other issues you have open as well.
Cheers,
G
The text was updated successfully, but these errors were encountered: