The terminal natively on Mac i.e. spawned through Spotlight or Launchpad, adopts the desired environment variables including the customization in ~/.bash_profile
. But when I run Emacs (Emacs.app
taken from Emacs For Mac OS X) and spawn shell inside it (using either shell
, eshell
or term
), the shells doesn't adopt the same environment variables as mentioned earlier.
I realize that the shell adopts its environment from the process that launches it and it is because of this that the values of shell's environment variable the same as those of Emac (e.g. (getenv "PATH")
)
Venturing inside the content of Terminal.app
and Emacs.app
did not get me lucky.
How can I automatically get the same environment variable I get in Terminal.app
in the shell spawned inside Emacs? And I do not prefer launching Emacs from the terminal.
(I realize that this is too MacOSX-ish and the answers could propose solutions/tweaks that are totally outside of Emacs. But the question concerns Emacs therefore I chose this site)