I am having an issue with one of the plugins i am running because its trying to use fish and does not like the parameters.

Is there a way i can change emacs to use bash for any plugins that use shell-command or similar functions.

(setenv "SHELL" "/bin/bash")
(setq explicit-shell-file-name "/bin/bash")

I tried the above but shell-command still seems to use fish.


You need to change the option shell-file-name.

(setenv "SHELL" "/bin/bash")

This doesn't work since Emacs is already running thus it's too late, Emacs initializes shell-file-name according to SHELL during startup. Something like

$ SHELL=/bin/bash emacs

should work.

(setq explicit-shell-file-name "/bin/bash")

This is for M-x shell, not M-x shell-command.

| improve this answer | |
  • Cheers, I can work with that i was hoping there might have been a nicer solution I will wait in case anyone else knows another way, else i will accept this answer. – Oly Nov 14 '16 at 9:22
  • @Oly Don't know about your expect. Setting shell-file-name to bash is sufficient for you, I think. – xuchunyang Nov 14 '16 at 9:38
  • Cheers the correct answer is (setq shell-file-name "/bin/bash") this makes shell-command use bash instead of the default, and has fixed the plugin i am trying to use :) – Oly Nov 14 '16 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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