GNU bug report logs -
#7923
23.2; Shell PATH environment variable problem
Previous Next
Reported by: John McHugh <mchugh <at> cs.unc.edu>
Date: Wed, 26 Jan 2011 21:30:03 UTC
Severity: normal
Found in version 23.2
Done: Alan Third <alan <at> idiocy.org>
Bug is archived. No further changes may be made.
Full log
Message #16 received at 7923-done <at> debbugs.gnu.org (full text, mbox):
John McHugh <mchugh <at> cs.unc.edu> writes:
> Stefan
>
> I don't think this is the problem
>
> In OS X, Leopard, the initial $PATH setting comes from a property list file
>
> ~/.MacOSX/environment.plist
>
> This file contains a list of properties and their initial values. In this case, the properties are environment variables.
> The value for the PATH is
>
> /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
>
> According to the OS X Leopard documentation, the contents of files in
> /etc/paths.d is then added to PATH. This allows software packages to
> add their specific bin directories without consideration of the
> specific shell to be used, or the user using the machine. Installing
> X11 adds a file to this directory containing the path to X11 binaries.
>
> Now, if I issue the emacs command "shell-command echo $PATH" I get the PATH value that is in the plist file. If I change the plist file, output of that command changes, as well.
>
> What is not happening is that the additional files in /etc/paths.d are not being added to the path.
>
> Since my shell for shell windows in emacs is bash, my .bashrc file is being executed since, they appear in the PATH echoed from a shell window in emacs.
>
> Is there an explanation of how emacs sets the path for shell commands?
PATH handling on OS X is rather broken and seems to change with each new
release. GUI apps don't inherit the same PATH as terminal applications.
I've found the simplest solution for Emacs is to use the
exec-path-from-shell package.
I wrote up a wee bit about how zsh generates it's PATH on OS X, and it
may give you some pointers for bash:
http://unix.stackexchange.com/questions/246751/how-to-know-why-and-where-the-path-env-variable-is-set/250456#250456
Ultimately this isn't an Emacs problem, but a general issue with OS X,
so I'm going to close this bug report.
Sorry I can't be more help.
--
Alan Third
This bug report was last modified 9 years and 58 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.