delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/02/10:34:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-Id: <5.1.0.14.2.20011002102745.00a6df08@pop.atg.com>
X-Sender: matt AT pop DOT atg DOT com
X-Mailer: QUALCOMM Windows Eudora Version 5.1
Date: Tue, 02 Oct 2001 10:33:36 -0400
To: David Starks-Browning <starksb AT ebi DOT ac DOT uk>
From: Matt Landau <matt AT atg DOT com>
Subject: Re: bash 2.04 can't complete ~/name if $HOME set to
c:/users/foo?
Cc: cygwin AT cygwin DOT com
In-Reply-To: <4677-Tue02Oct2001103702+0100-starksb@ebi.ac.uk>
References: <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20011001192343 DOT 00a74568 AT pop DOT atg DOT com>
<5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20011001192343 DOT 00a74568 AT pop DOT atg DOT com>
Mime-Version: 1.0

At 05:37 AM 10/2/2001, David Starks-Browning wrote:
>If your non-Cygwin application (like Emacs) requires HOME be set in a
>non-Cygwin way, then don't start emacs from your Cygwin bash shell.
>
>If you must invoke your emacs command from the Cygwin bash shell, you
>could put the emacs command in a windows .bat file, and invoke that
>file from Cygwin bash.  In the .bat file, your HOME variable should be
>set the way Emacs needs it.
>
>Hope this helps.

Let me clarify the problem.

Emacs doesn't care what $HOME is set to, it cares what path it sees on the 
command line.  The issue is that bash, by default, expands ~/filename to a 
posix-style path, resulting in commands like "emacs /c/users/matt/.bashrc", 
which doesn't work for any non-Cygwin program.

Saying "don't run non-Cygwin programs from bash" isn't a thrilling answer; 
an interactive shell is most useful when you can use it as your shell for 
*everything*.

There is a half-hearted workaround, which is to reset HOME to a win32-style 
path in .bashrc so that ~/.bashrc expands to c:/users/matt/.bashrc (since 
cygwin programs understand win32-style paths, there's little reason not to 
do this), but it breaks bash's completion.  That's the real bug I was 
asking about.  It's not clear to me why bash should be able to expand 
posix-style paths but not win32-style paths.


I suppose another workaround is to define a shell function that turns 
"emacs filename" into "emacs `cygpath -w filename`", converting all names 
back to win32-style paths before emacs ever sees them, but having to do 
this for every non-cygwin application I ever run from the shell is going to 
get tedious.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019