0

For some reason, some garbage is prepended to my PATH variable in emacs.

  1. Testing from eshell: (M+x eshell):

~/projects/rust/logentries-parser/src $ echo $PATH bash: cannot set terminal process group (-1): Inappropriate ioctl for devicebash: no job control in this shell:/home/renat/.cargo/bin:/home/renat/lib/google-cloud-sdk/bin: ... other stuff

  1. Testing from shell: (M+x shell):

renat@hp-envy ~/projects/rust/logentries-parser/src $ echo $PATH :/home/renat/.cargo/bin:/home/renat/lib/google-cloud-sdk/bin: ... other stuff

  1. Testing using the getenv: (getenv RET PATH):

bash: cannot set terminal process group (-1): Inappropriate ioctl for devicebash: no job control in this shell:/home/renat/.cargo/bin:/home/renat/lib/google-cloud-sdk/bin: ... other stuff

Did anybody encounter anything similar?

Thanks

A new update:

When I'm starting emacs with a -nw switch - it works fine and PATH is not polluted.

3
  • 1
    I can't reproduce this on Emacs 25.2.1. Does it happen when you start emacs with emacs -Q? You should also check your .bashrc and .bash_profile files to see if you're doing anything strange to your PATH in there. Also, check if you have an ~/.emacs.d/init_bash.sh file and what it contains. Commented Mar 17, 2017 at 13:35
  • Hi, @Tyler! Thanks to your response. My Emacs version is 25.1.1. > Does it happen when you start emacs with emacs -Q No, it doesn't happen. > You should also check your .bashrc and .bash_profile files to see if you're doing anything strange to your PATH in there. I tried to comment out anything what updated the PATH variable, but still getting the issue. One more interesting thing that when I'm starting emacs from the terminal PATH not polluted. Commented Mar 23, 2017 at 7:12
  • One more thing: I don't have init_bash.sh Commented Mar 23, 2017 at 7:23

1 Answer 1

0

You have something somewhere in your Emacs config which is attempting to set PATH automatically by calling a shell command, and that config is failing to pay any attention to the exit status of the command, and is just using whatever is returned -- in this case the text of an error message, because the shell command fails.

You need to track down what that is, because we certainly can't tell you. I suggest grepping your config for PATH.

I suspect this shell command is dependent on your shell config having been read, but that you are running Emacs via some kind of GUI launcher mechanism which does not invoke a shell at any point, and therefore has no knowledge of your shell config.

When you run emacs -nw and it works, that is because you are invoking that command from a shell.

Most likely if you run emacs from a shell it will also work, for the same reason.

1
  • 1
    Thank you very much! I greped my config directory and found that one of config files for Go-lang tries to set path (when window-system (set-exec-path-from-shell-PATH)). Commented Mar 23, 2017 at 11:52

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.