6

My default shell is fish and I don't want to change it. But in Emacs Tramp doesn't work well with fish. So I just want to set bash as default shell for Emacs only. Is it possible?

1

2 Answers 2

12

From the documentation for the shell function (C-h f shell RET):

Program used comes from variable `explicit-shell-file-name',
 or (if that is nil) from the ESHELL environment variable,
 or (if that is nil) from `shell-file-name'.

So, if you want to use "/bin/bash" as the shell file in emacs buffers, you can either:

  • set the variable `explicit-shell-file-name' in your ~/.emacs file:

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

  • set the ESHELL environment variable in your ~/.profile file:

    export ESHELL=/bin/bash

  • set the variable `shell-file-name' in your ~/.emacs file:

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

0
2

The Tramp manual speaks about problems with fish. Maybe you try what's proposed there:

Similar fancy prompt settings are known from the fish shell.
Here you must add in ‘~/.config/fish/config.fish’:

     function fish_prompt
       if test $TERM = "dumb"
          echo "\$ "
       else
          …
       end
     end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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