up vote 0 down vote favorite
share [g+] share [fb]

I run EmacsW32 on Windows XP.

I would like to know how to tell Emacs to start a Cygwin shell when I do M-x shell. Right now it starts a Windows cmd shell and I have to start the Cygwin shell manually.

I know it can be done because I had it working before reinstalling Windows. But now I can't find the instructions.

link|improve this question

feedback

2 Answers

up vote 2 down vote accepted

This seems to have the information you're looking for: http://www.khngai.com/emacs/cygwin.php

Specifically add the following to the .emacs file:

(add-hook 'comint-output-filter-functions
'shell-strip-ctrl-m nil t)

(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt nil t)

(setq explicit-shell-file-name "bash.exe")

;; For subprocesses invoked via the shell
;; (e.g., "shell -c command")
(setq shell-file-name explicit-shell-file-name)
link|improve this answer
I needed to add a bit more but the info was all there on the page you linked to. – Nifle Jan 30 '10 at 10:06
feedback

An alternative that I find easier is to set an environment variable like this:

variable ESHELL, value c:\ProgramFiles\cygwin\bin\bash.exe

(or wherever you've installed Cygwin, of course)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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