help-emacs-windows
[Top][All Lists]
Advanced

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

RE: [h-e-w] Windows 2000 Pro / bash shell solved


From: Sprenger, Karel
Subject: RE: [h-e-w] Windows 2000 Pro / bash shell solved
Date: Wed, 17 Oct 2001 10:16:53 +0200

Hi,
 
As the bash(1) man page states: "If the -i option is present, the shell is interactive."  So it seems obvious that this argument is added to the make-comint call in shell.el.  On the other hand, if I enter the command "bash" without any "-i" argument inside a DOS box (oh well a cmd box) the resulting bash is pretty interactive.  This is *not* the case, however, when bash is called as a subprocess by for example emacs.  I figure this is because in that case standard input and output are "hooked" to the calling process so to speak, and on detecting this, bash will *not* be interactive when called as a subprocess *unless* the "-i" command line argument is present.
 
With your different version of shell.el you might consider setting the environment variable ESHELL or the lisp variable explicit-shell-file-name to "bash", and the lisp variable explicit-bash-args to be at least the list '("-i").  If anyone with just the distributed version of shell.el wants to see the behaviour Jeff got, do
 
(setenv "ESHELL" "bash")
(setq explicit-bash-args nil)
(shell)
 
Cheers,
Karel
 
--
Karel Sprenger, solution architect
COMPAQ, Professional Services
Phone: +31(30)283 4902         Home: +31(20) 670 0942
Email: address@hidden        Home: address@hidden
"A behaviorist is someone who pulls habits out of rats." -- Anonymous
-----Original Message-----
From: Jeff Rancier [mailto:address@hidden
Sent: Tuesday, October 16, 2001 16:20
To: Cygwin; Emacs Help (Windows)
Subject: [h-e-w] Windows 2000 Pro / bash shell solved

Hello.

I had a different version of shell.el in my load-path.  The only difference
was in the function shell(), the "-i" was missing and caused bash (or
something) to fail.  Can anyone shed any light on this?

(defun shell ()
  (interactive)
  (if (not (comint-check-proc "*shell*"))
      (let* ((prog (or explicit-shell-file-name
                       (getenv "ESHELL")
                       (getenv "SHELL")
                       "/bin/sh"))
             (name (file-name-nondirectory prog))
             (startfile (concat "~/.emacs_" name))
             (xargs-name (intern-soft (concat "explicit-" name "-args")))
             shell-buffer)
        (save-excursion
          (set-buffer (apply 'make-comint "shell" prog
                             (if (file-exists-p startfile) startfile)
                             (if (and xargs-name (boundp xargs-name))
                                 (symbol-value xargs-name)
                               '("-i"))))

------------------------------^^^


          (setq shell-buffer (current-buffer))
          (shell-mode))
        (pop-to-buffer shell-buffer))
    (pop-to-buffer "*shell*")))



Jeff


reply via email to

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