Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am relativley new to Emacs and am trying to setup emacs, to allow the following command to open the msysgit shell.

M-x bash-shell

I have added following snippet to my init.el.

(defun bash-shell ()
  "Run git bash in shell mode."
  (interactive)
  (let ((explicit-shell-file-name "C:/Dev/Apps/Git/bin/sh.exe")
    (shell-file-name explicit-shell-file-name)
    (explicit-sh.exe-args '("--login" "-i")))
    (call-interactively 'shell)))

It seems to work, but not the way I expect it. It starts with the following output.

Welcome to Git (version 1.8.4-preview20130916)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.

But then gets stuck. I can however enter standard commands (e.g. ls, pwd, ...), but my .bashrc does not seem to get executed. When I exit however, it seems to either start it properly or at least execute .bashrc, which is very confusing to me.

Welcome to Git (version 1.8.4-preview20130916)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
pwd
/c/Dev/Apps/Emacs/emacs-23.3/bin
uname
MINGW32_NT-5.1
ll
bash: line 3: ll: command not found
exit
laiwib@WZUR5250815 /c/D.A.E.e/emacs-23.3/bin  $ 

In any case it does not behave the same as if I start Git Bash on Windows

C:\WINDOWS\system32\cmd.exe /c ""C:\Dev\Apps\Git\bin\sh.exe" --login -i"

which gives me the following

Welcome to Git (version 1.8.4-preview20130916)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
Agent pid 4384
laiwib@WZUR5250815 ~ (git::master) $ ll
total 16
drwxr-xr-x    1 laiwib   Administ        0 Oct 21  2012 WINDOWS
drwxr-xr-x    1 laiwib   Administ        0 Oct 23  2012 .eclipse
-rw-r--r--    1 laiwib   Administ       38 Oct 23  2012 .dbshell
...

How can I make it behave like Git Bash without calling exit manually?

share|improve this question
    
This may be relevant: stackoverflow.com/questions/4733071/… –  Ben Jan 26 at 7:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.