<p>I am running GNU Emacs on Windows so entering:</p>

<pre><code>M-x shell
</code></pre>

<p>launches the Windows command-line DOS shell. However, I would like to instead be able to run the Cygwin Bash Shell (or any other non-Windows shell) from within Emacs. How can this be easily done?</p>

I use XEmacs with Cygwin, and can run bash from XEmacs relatively easily.
Here's the relevant section from
```
init.el
```
```
```
;; Let's use CYGWIN bash...
;;
(setq binary-process-input t) 
(setq w32-quote-process-args ?\") 
(setq shell-file-name "bash") ;; or sh if you rename your bash executable to sh. 
(setenv "SHELL" shell-file-name) 
(setq explicit-shell-file-name shell-file-name) 
(setq explicit-sh-args '("-login" "-i"))
```
```