When I startup spacemacs I get the following message:

You appear to be setting environment variables ("PATH") in your .bashrc or .zshrc: those files are only read by interactive shells, so you should instead set environment variables in startup files like .profile, .bash_profile or .zshenv. Refer to your shell's man page for more info. Customize exec-path-from-shell-arguments' to remove "-i" when done, or disableexec-path-from-shell-check-startup-files' to disable this message

What are the usual variables spacemacs\emacs expects to find in the profile, especially the emacs related ones?

  • 2
    emacs doesn't use .profile or .bashrc/.zshrc, your shell does.
    – npostavs
    Jun 9, 2017 at 16:32

2 Answers 2


This is a feature of the emacs package exec-path-from-shell, https://github.com/purcell/exec-path-from-shell. The message is trying to do you a favour in warning about PATH variable definitions in configuration files that are not read by non-interactive shells.

Many Emacs commands use command line programs to do the real work. The package reads your PATH setup to find out all places you have these executable files.

Just like the message says.

  • It's not a standard Emacs feature. The user has installed the non-standard exec-path-from-shell package, which is responsible for this behaviour.
    – phils
    Jun 9, 2017 at 23:46
  • Answer amended.
    – Heikki
    Jun 10, 2017 at 5:34

By default, Emacs does not look at your shell config files.

The behaviour you are seeing is on account of a third-party elisp package named exec-path-from-shell which you have installed. Maybe spacemacs installs this by default.

This will probably help:

M-x finder-commentary RET exec-path-from-shell RET

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.