Hello,
On Jan 8, 2007, at 2:31 PM, Brett Calcott wrote:
This does seem to be the case. No amount of fiddling with .profile
.bashrc .bash_profile /etc/bashrc or whatever makes any difference to
the environment that ends up in the GUI version that is started from
the dock.
I don't know if the Mac folks have filled you in, but apps launched
from the Finder get their environment from the file ~/.MacOSX/
environment.plist. Mac OS X "Property List" files are XML, and they
look like this (this is a bit of my own environment.plist):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>myvimhelp</key>
<string>~/.vim/doc/dml.txt</string>
</dict>
</plist>
Th file contains any number of <key>/<string> pairs, which give the
name and value of environment variables for Finder-launched apps.
The values in environment.plist are loaded at login time, so you have
to log out and back in for new variables to be available.
Some folks keep all their environment variables in environment.plist
and parse it from .bashrc (or equivalent for other shells) to load
those vars into their shell. Happily, Apple provided a utility that
handles it for you:
defaults read "${HOME}/.MacOSX/environment"
Also, with the Apple developer tools comes a program "Property List
Editor" that makes it very easy to muck about with its contents. Of
course, this being a vim list, most of you probably would prefer to
use something like pico or emacs for this purpose :-).
Dave