Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
MacOS .app has a different $PATH when launched from terminal #4273
Apologies if this has been posted before, I found closed $PATH-related issues, but none that seemed fitting.
When I launch qutebrowser from the command line in MacOS the PATH includes everything I would expect and I'm able to correctly
I'm running 10.13.6 and installed qutebroswer with Homebrew.
PATH when launched from command line
PATH when lauched from .app
This all makes sense since launching it from the command line would inherit the environment from which it was launched, but it's annoying that it's not included when launched from the app. Not sure if that's a fixable thing, or if the solution is to always launch from the terminal.
There are quite a lot of issues about this already, but I'll try to write everything that I know in one place for search-ability.
This is a problem because the path from
I found another way to address this bug that I think is much better and will work for any GUI app.
You can add the extra needed paths in
Feed launchd with added values (it will be automatic after a restart, the following command is only necessary if you don't want to reboot):
egrep "^setenv\ " /etc/launchd.conf | xargs -t -L 1 launchctl
you can now restart your Dock and Spotlight:
killall Dock killall Spotlight
Now every GUI app you launch inherit of this PATH env variable, either you launch it by clicking the icon in
Thank you for that fast reply!
But @jgillman has two PATH depending how qutebrowser ist started.
How can I get these?
You should follow the instructions I added above.
This is related to how Mac OS application launcher (understand clicking the app icon or use spotlight) handle the PATH. It uses it’s own PATH variable that is set by launchd.
When you start an app from the term it inherits from the term PATH.
This is not true when using app launcher (which I can understand technically).