X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Lilja Subject: Re: Using cygwin bash shell with NT Emacs, path is not setup perfectly Date: Sun, 26 Aug 2007 18:42:28 +0200 Lines: 51 Message-ID: References: <46D1AA07 DOT 5090307 AT math DOT cornell DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <46D1AA07.5090307@math.cornell.edu> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Ken Brown wrote: > On 8/25/2007 8:30 PM, Eric Lilja wrote: >> Ok, it seems that /etc/profile is not read when I start cygwin bash >> using M-x shell and I think that may be a problem. > > I can't find the earlier message(s) in this thread, so I'm not sure of > the context. But you might be able to solve your problem by customizing > the emacs variable explicit-bash-args to include "-l" or "--login". > > Ken > > Thanks, but unfortunately it didn't help. I read and post using gmane (set up as a news server under thunderbird) and it took hours before my post showed up and it sounds like people didn't get see it even then. Here's the original post: Hello, I'm using a native win32 version emacs and I want M-x shell to invoke Cygwin's bash instead of the default shell. Everything seems to work except that the path does not get setup properly. Here's the output from echo $PATH when bash is run under nt emacs: $ echo $PATH /usr/bin:/usr/local/bin:/usr/bin:/usr/bin:/usr/X11R6/bin:/cygdrive/c/Program/MiKTeX 2.6/miktex/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/emacs/bin Here's the same command when started using cygwin.bat: $ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Program/MiKTeX 2.6/miktex/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/emacs/bin See the difference? Under ntemacs I get /usr/bin twice in a row instead of /usr/bin:/bin: This is causing problems for me. Why is this happening and how can I solve it? Here's the relevant section of my .emacs. It's basically what's on the emacs wiki (I added ansi-color.for-comint-mode-on and removed the setting of the HOME variable as that is availabe anyway on my system): (let* ((cygwin-root "c:/cygwin") (cygwin-bin (concat cygwin-root "/bin"))) ;(setenv "HOME" (concat cygwin-root "/home/eric")) (setenv "PATH" (concat cygwin-bin ";" (getenv "PATH"))) (setq exec-path (cons cygwin-bin exec-path)) (setq shell-file-name "bash") (setq explicit-shell-file-name "bash") (add-hook 'comint-mode-hook 'ansi-color-for-comint-mode-on))) -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/