-
Notifications
You must be signed in to change notification settings - Fork 26
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
Path environment not set correctly when running from within a Mac OSX .app bundle. #23
Comments
@jamiek Thanks for the information provided. You are absolutely right. Previously, I simply symbol link all the required programs to App launching from .app bundle does not use the same shell as Terminal. In the case where default shell for user is |
@wanglongqi I've done some digging and have some more info. So when launched from the Finder by double clicking an .app bundle the path is set by
I will caution that the This seems like a reasonable solution but my only hesitation is that it affects all apps launched via the finder. That said, these apps tend to look inside the .app bundle first so this should't risk breaking things. An alternative might be to try to use python to set the appropriate PATH using One other possibility is to modify the info.plist file in the .app bundle to include the updated PATH. i've tested this and it works, but requires a restart. |
Maybe another way is to add a text field for user to set additional search paths. Inkscape will remember the field value used for last run, so user also only need to set that field once. |
User configurable text fields sounds like a clean way to handle it. Especially if you could put the config settings on a separate tab. It would keep the UI looking clean. |
I tried to add a settings tab in this commit 85458b1, when have time please help do some tests. |
First off I'll note that this may not necessarily be an issue with WriteTeX, but it can be addressed in your code base. I was not able to find a similar report related to inkscape in their issue tracker.
Behavior: WriteTeX is not able to find latex interpreter or .svg converter when run from inkscape launched from an .app bundle on OS X. Apparently this is because .app bundles do not respect the environment variables set in various locations (.profile, /etc/profiles, and so forth).
Expected behavior: WriteTeX should rely on the user set PATH environment variable to search for latex interpreter and svg converter.
Other info: The issue only occurs when launching inkscape from an .app bundle. Calling the inscape executable inside the bundle via terminal correctly passes the PATH environment variable.
Here are the PATHS returned by calling 'echo $PATH' from within writetex.py:
inkscape from terminal: /Applications/Inkscape.app/Contents/MacOS:/Applications/Inkscape.app/Contents/MacOS/../Resources/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
inkscape launched as .app:
/Applications/Inkscape.app/Contents/MacOS:/Applications/Inkscape.app/Contents/MacOS/../Resources/bin:/usr/bin:/bin:/usr/sbin:/sbin
entering the full path to the latex interpreter in the modal window can fix the latex interpreter issue, but there is no way to provide the full path to the svg converter.
There area bunch of ways I've been able to club this into submission such as: symlinks located in the .app bundle to point to the latex interpreter and svg converters, getting and altering the path within writetex.py using os.environ and using the env= flag in subprocess.call(), etc. None of these are particularly convenient from a user standpoint.
As mentioned up front, it is possible that there is a clean way to fix this within inkscape, but I expect that the developers here are much more familiar with the extension codebase than I am.
Inkscape 1.0 binary from inkscape.org
OS X 15.4
writeTex 1.0.x
The text was updated successfully, but these errors were encountered: