purcell / exec-path-from-shell

Make Emacs use the $PATH set up by the user's shell
Other
1.41k stars 81 forks source link

Readme confusions #73

Closed spacegoing closed 6 years ago

spacegoing commented 6 years ago

I'm confused by this paragraph. Would you please explain this?

Note that your shell will inherit Emacs's environment variables when it is run -- to avoid surprises your config files should therefore set the environment variables to their exact desired final values, i.e. don't do this:

Do you mean my $PATH in shell defined by .zshrc will be overide after executing this command?

In which place should I do the following? In .zshrc file or in Emacs init.el?

but instead do this: export PATH=/usr/local/bin:/usr/bin:/bin

Many thanks!

purcell commented 6 years ago

Yes, when zsh is executed by Emacs, then zsh will see the PATH environment variable it inherited from the parent process. So zsh should explicitly set that variable itself, which means the above snippet goes in your .zshrc (or .zshenv).