This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cygwin modifies path: problems in NTEmacs shell buffer


Hi,

when upgrading from B20.1 to the latest net release I noticed a change
in how the PATH is handled. It appears to me that Cygwin (I say Cygwin
because I don't know where this exactly happens - bash or
cygwin1.dll?) automagically prepends /usr/local/bin:/usr/bin:/bin to
the path. This is basically fine but for some reason does not work if
I use bash as a shell in NTEmacs.

My NT path in a NT command line window looks as follows, using the
command "path":
<NT stuff>;d:\cygwin\bin

The latter is necessary to find bash in the first place.

If I now start bash from this command line window with bash -login -i
and run "echo $PATH", I get:
/usr/local/bin:/usr/bin:/bin:<NT stuff>:/cygdrive/d/user/mhoen/scripts

Cygwin prepends the first three entries. I replace the d:\cygwin\bin
entry of my NT path with /user/mhoen/scripts in my .bashrc. I don't
need the scripts outside of bash, and I can remove d:\cygwin\bin as
this would simply duplicate what Cygwin prepends anyway.

If I now start bash in an NTEmacs shell buffer, the path looks
different:
<NT stuff>:/cygdrive/d/user/mhoen/scripts

That means my .bashrc is read correctly, but Cygwin fails to add
/usr/local/bin:/usr/bin:/bin.

I use the following settings in my _emacs:

; try to use bash as the default shell
(setq shell-file-name "bash")
(setenv "SHELL" shell-file-name)
(setq explicit-shell-file-name shell-file-name)
(setq explicit-shell-args '("-login" "-i"))
(setq shell-command-switch "-c")
(setq w32-quote-process-args t)
(defun bash ()
  (interactive)
  (let ((binary-process-input t)
        (binary-process-output nil))
    (shell)))

(setq process-coding-system-alist (cons '("bash" . (raw-text-dos . raw-text-unix))
					process-coding-system-alist))

(require 'cygwin32-mount)

i.e. this will also run bash -login -i.

I could certainly just add the missing paths in my .bashrc, but this
would mean that I have three duplicate paths in my command line bash
sessions.

Any ideas how to rectify this?

Markus

-- 
Markus Hoenicka, PhD
UT Houston Medical School
Dept. of Integrative Biology and Pharmacology
6431 Fannin MSB4.114
Houston, TX 77030
(713) 500-6313, -7477
(713) 500-7444 (fax)
Markus.Hoenicka@uth.tmc.edu
http://ourworld.compuserve.com/homepages/hoenicka_markus/


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]