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

bash errors after upgrading to v2.2 #120

Closed abscondment closed 6 months ago

abscondment commented 6 months ago

I'm using bash on OSX. My .emacs ends with this:

(require 'exec-path-from-shell)
(setq exec-path-from-shell-debug t)
(exec-path-from-shell-copy-env "SSH_AGENT_PID")
(exec-path-from-shell-copy-env "SSH_AUTH_SOCK")
(exec-path-from-shell-initialize)

After installing the 2.2 release via MELPA, I get this error on startup:

⛔ Warning (initialization): An error occurred while loading ‘/Users/bribera/.emacs’:

error: Non-zero exit code from shell /bin/bash invoked with args ("-l" "-i" "-c" "
 '__RESULT\\000%s\\000__RESULT' \"${SSH_AGENT_PID-804a37a88c627309580dd2d8a4f10415}\"").  Output was:
"bash: __RESULT\\000%s\\000__RESULT: command not found
"

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

If I check out the 2.1 release and install it via M-x package-install-file, things work.

abscondment commented 6 months ago

Ah, apologies. Please ignore - I had some very old, inherited config that recently broke both this an magit. Once I stopped loading it, the issue in v2.2 went away.

orlandini commented 4 months ago

Would you mind sharing what made it go away for you?

abscondment commented 4 months ago

@orlandini sure, I can give a little more detail:

I have been using some dotfiles shared by a friend in ~2007. A few of the old functions defined there seem to be overriding newer functions added to emacs proper, which in turn has been causing random errors in various libraries.

I noticed this and disabled most of this old config, and a handful of issues disappeared. I didn't dig deeper to figure out exactly which conflicts caused this particular issue.

orlandini commented 4 months ago

@abscondment thank you!

In the end, in my case it was something else, which I will share should someone face the same issue in the future.

When setting the environment variables I wanted to get from my shell I accidentally had a space between them, like

"VAR1 VAR2" instead of "VAR1" "VAR2"