Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Emacs doesn't respect $PATH on OSX #132

honza opened this Issue · 4 comments

3 participants


Yes, it's in the README but the suggested fix doesn't work.

(setenv "PATH" (shell-command-to-string "echo $PATH"))

I'm not really sure how I can help you debug it. Let me know what you need.


Evaluate (shell-command-to-string "echo $PATH") in the scratch buffer or via M-x eval-expression, then make sure it is the PATH you expect.

If you have lein under PATH and it works in the terminal, there should be no need to use setenv.


Another way to set up PATH is to Max customize-apropos PATH [ret]. Then find find exec path and Swank path there. However, in my case they do not include ~/bin, which is where lein is located. This has been the case for over 1 year, with 2 Emacs versions, several Leiningen versions and lein-swank plugin updates.


Evaluating in a scratch buffer gives the wrong $PATH. I fixed it by doing

(setenv "PATH" (shell-command-to-string "source ~/.bashrc; echo $PATH"))
@honza honza closed this

.bashrc is not the right place to customize your $PATH, but if you got it working that's good. Settings that are shell-agnostic go in .profile instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.