[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] Bash with emacs's shell

From: Theodore Jump
Subject: Re: [h-e-w] Bash with emacs's shell
Date: Fri, 30 Nov 2001 11:40:44 -0600

I don't use Cygwin bash as the default shell for personal reasons, but I like being able to invoke it. Here's the lisp I use to do so ...note

(defun w32-dev-go-bash ()
  "Load Cygwin GNU-Win32 GNU Bourne Again Shell for interactive shell processing"
  (require 'shell)
  (let ((binary-process-input t)        ; for 19.x
        (binary-process-ouput nil)      ; for 19.x
        (coding-system-for-write 'no-conversion) ; for 20.x
        (coding-system-for-read 'iso-latin-1-unix) ; for 20.x
        (explicit-bash-args '("-login" "-i"))
        (explicit-shell-file-name "")
        (original-shell (getenv "SHELL"))
        (ori-sfn shell-file-name)
        (w32-quite-process-args ?\")
    ;; Wipe out PID in case emacs is called from Cygwin32 built BASH (this causes problems)
    (setenv "PID" nil)
    (if (and (getenv "CYGREL") (string-equal (getenv "CYGREL") "B20.1"))
        (setenv "SHELL" (expand-file-name (concat (getenv "CYGROOT") "/bin/bash.exe")))
      (setenv "SHELL" (expand-file-name (concat (getenv "CYGROOT") "/bin/bash.exe")))
    (setq-default shell-file-name (getenv "SHELL")
                  explicit-shell-file-name shell-file-name)
    (message (format "invoking bash ... %s" shell-file-name) )
    (setq-default shell-file-name ori-sfn)
    (setenv "SHELL" original-shell)

Works for me with Emacs 21.1 and Cygwin-mostly-current but it does need some spiffying-up.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]