The drama of PATH under Mac OSX Mountain Lion
After much reading and many trials and errors I’m finally quite confident about the situation of the PATH variable under Mac OSX Mountain Lion. So, is there a unified way to set the PATH for applications launched by different means (like shell script, Finder and Spotlight)? Well, yes and no:
No: Setting PATH in shell start up scripts (.e.g. .bashrc) works only for apps launched by shells.
No: Setting PATH for the current launchd process via launchctl setenv PATH <...> does not work for me at all.
Yes: Setting PATH in /etc/launchd.conf (and restarting the system) will make the appropriate PATH visible in applications launched by Spotlight, Dock and Finder. For correct functioning in the shell it is important to switch off the use of /usr/libexec/path_helper. because the default paths in /etc.paths might change the order of the paths in PATH.
The unfortunate consequences are:
No way to have these unified settings on a per user basis. (~/.launchd.conf does not work.)
No easy way to construct the PATH from different sources using techniques like home directory expansion et al.