Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define a default shell for emacs

Tags:

emacs

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?

like image 266
Utsob Roy Avatar asked May 24 '16 09:05

Utsob Roy


Video Answer


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

like image 71
duthen Avatar answered Oct 06 '22 01:10

duthen