7

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
  • 1
    I'm voting to close this question as off-topic; suggest migration to emacs.stackexchange.com Commented May 24, 2016 at 9:29

2 Answers 2

14

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")

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.