syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.72k stars 4.9k forks source link

fish users get a warning message about PATH being set for allegedly non-interactive shells #7780

Closed lvh closed 4 years ago

lvh commented 8 years ago

Description :octocat:

If user's default shell is fish, Emacs appears to run the shell in a way that makes it think it is interactive; in particular, status --is-interactive will return true. This results in the following error 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 disable ‘exec-path-from-shell-check-startup-files’ to disable this message.

fish doesn't distinguish between interactive and non-interactive shells via different files. In my shell, PATH is configured via the usual set -gx. Meanwhile, my fish config has stuff like:

function interactive_setup
  . (pyenv init -|psub);
  . (rbenv init -|psub);
  . (pyenv virtualenv-init -|psub);

  eval (thefuck --alias | tr '\n' ';')

  . /usr/local/share/autojump/autojump.fish
end

status --is-interactive; and interactive_setup

According to the order of messages in *Messages*, I think auto-layer might be the thing creating a shell.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

Above error message in minibuffer.

According to the order of messages in *Messages*, I think auto-layer might be the thing creating a shell.

Expected behaviour: :heart: :smile:

No error message; ideally because fish correctly does not set the env vars the message is complaining about.

System Info :computer:

TheBB commented 8 years ago

https://github.com/purcell/exec-path-from-shell

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!