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?
2 Answers
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")
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