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

MacOS .app has a different $PATH when launched from terminal #4273

Closed
jgillman opened this Issue Sep 30, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@jgillman
Contributor

jgillman commented Sep 30, 2018

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 spawn mpv {url} and stuff like that. When I launch qutebrowser from the .app the PATH is extremely short and I can't spawn anything that's not built into the system.

I'm running 10.13.6 and installed qutebroswer with Homebrew.

PATH when launched from command line

PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jgillman/perl5/bin:/Users/jgillman/bin:/Users/jgillman/.dotfiles/bin:/usr/local/lib/node_modules:/Users/jgillman/node_modules/.bin:/Users/jgillman/.dotfiles/fzf/bin:/usr/local/sbin:/usr/local/opt/fzf/bin

PATH when lauched from .app

PATH = /usr/bin:/bin:/usr/sbin:/sbin

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.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Sep 30, 2018

Collaborator

Nothing that qutebrowser can do about that - you'll need to find a way to set a system-wide path on macOS, or just use full paths with :spawn.

Collaborator

The-Compiler commented Sep 30, 2018

Nothing that qutebrowser can do about that - you'll need to find a way to set a system-wide path on macOS, or just use full paths with :spawn.

@jgkamat

This comment has been minimized.

Show comment
Hide comment
@jgkamat

jgkamat Sep 30, 2018

Collaborator

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 .profile is not propogated to gui applications in mac os. There are some ways you can set the PATH in mac os, but I don't know how much success you'll have with that.

Workarounds:

  1. Launch from the terminal, as you are doing now, to inherit the terminal's path
  2. Use config.py to append the path values you want before the browser starts
  3. Use absolute paths to any executables you run, instead of relying on PATH.
Collaborator

jgkamat commented Sep 30, 2018

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 .profile is not propogated to gui applications in mac os. There are some ways you can set the PATH in mac os, but I don't know how much success you'll have with that.

Workarounds:

  1. Launch from the terminal, as you are doing now, to inherit the terminal's path
  2. Use config.py to append the path values you want before the browser starts
  3. Use absolute paths to any executables you run, instead of relying on PATH.
@jgillman

This comment has been minimized.

Show comment
Hide comment
@jgillman

jgillman Sep 30, 2018

Contributor

Thanks @jgkamat! Sorry for the extra noise but I appreciate the compiled workarounds.

Would it be worth adding this as a "known" in the FAQ or Troubleshooting sections? idk how often this "issue" comes up.

Contributor

jgillman commented Sep 30, 2018

Thanks @jgkamat! Sorry for the extra noise but I appreciate the compiled workarounds.

Would it be worth adding this as a "known" in the FAQ or Troubleshooting sections? idk how often this "issue" comes up.

@jgkamat

This comment has been minimized.

Show comment
Hide comment
@jgkamat

jgkamat Sep 30, 2018

Collaborator

This does come up quite a lot, so I would be fine with adding an entry to the FAQ personally. I don't have access to a Mac OS machine though, so I can't test/validate anything, so I can't be the one to write it :P

Collaborator

jgkamat commented Sep 30, 2018

This does come up quite a lot, so I would be fine with adding an entry to the FAQ personally. I don't have access to a Mac OS machine though, so I can't test/validate anything, so I can't be the one to write it :P

@jgillman

This comment has been minimized.

Show comment
Hide comment
@jgillman

jgillman Sep 30, 2018

Contributor

PR incoming 😉

Contributor

jgillman commented Sep 30, 2018

PR incoming 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment