all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Lilja <mindcooler@gmail.com>
To: help-gnu-emacs@gnu.org
Cc: cygwin@cygwin.com
Subject: Using cygwin bash shell with NT Emacs, path is not setup perfectly
Date: Sat, 25 Aug 2007 15:36:02 +0200	[thread overview]
Message-ID: <fapb84$s4n$1@sea.gmane.org> (raw)

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)))

Thanks for any replies.

Posting this to both gmane.os.cygwin and gmane.emacs.help, hope that's 
not inappropriate. If so, I sincerly apologise.

- Eric

             reply	other threads:[~2007-08-25 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-25 13:36 Eric Lilja [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-08-25 14:00 Using cygwin bash shell with NT Emacs, path is not setup perfectly Eric Lilja
2007-08-26  0:29 ` Eric Lilja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='fapb84$s4n$1@sea.gmane.org' \
    --to=mindcooler@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.