purcell / exec-path-from-shell

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

Runs slowly #50

Closed dangitall closed 8 years ago

dangitall commented 8 years ago

Even with exec-path-from-shell-check-startup-files set to nil, this takes a second or more to run on my MBP. Is it this slow for everyone?

purcell commented 8 years ago

Is it this slow for everyone?

No! :-)

Have you changed exec-path-from-shell-arguments to remove "-i"? If you haven't, and you're using a huge interactive start-up package like oh-my-zsh, then perhaps that's the culprit. Can't really give more suggestions without concrete examples of how you're using exec-path-from-shell, sorry.

dangitall commented 8 years ago

Thanks for the response. Yeah, sorry, my intent wasn't to drop the problem in your lap but just to see if it was a common issue before I dug into it.

I had removed the -i from the call but it didn't help. The issue for me was that I sourced .bashrc from my .bash_profile. This is apparently a pretty common pattern amongst OS X users, it seems, because every Terminal shell is a login shell. I'm curious what others did to deal with this, but for me adding this to my profile seems to get things to work well enough:

[[ $- == *i* ]] && [[ -s ~/.bashrc ]] && source ~/.bashrc
purcell commented 8 years ago

Interesting. Yeah, the bash startup file logic is a bit funky. Looks like you could also add --norc to exec-path-from-shell-arguments.