8

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.

Oly
  • 583
  • 1
  • 5
  • 15

1 Answers1

11

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.

xuchunyang
  • 14,302
  • 1
  • 18
  • 39
  • 1
    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 09: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 09:38
  • 2
    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