This is the mail archive of the
mailing list for the Cygwin project.
Re: problen with run command and the environment
- From: Brian Ford <Brian dot Ford at flightsafety dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 19 Jan 2006 09:29:27 -0600
- Subject: Re: problen with run command and the environment
- References: <firstname.lastname@example.org>
- Reply-to: cygwin at cygwin dot com
On Wed, 18 Jan 2006, Jeff Hardy wrote:
> I have updated my windowsxp with the latest cygwin and
> this breaks several scripts I have that use the run
> command to start xterms without consoles. I have tried
> to track the problem down and at least one problem is
> that if I type "run env > /tmp/xxx" and look at
> /tmp/xxx, most of my environment variables are
> missing. Also, my HOME environment variable is now "/"
> instead of what my home directory is. I have another
> computer that I have not updated yet and when I do the
> same exercise as above, all the environment variables
> come across the run command.
> Anybody have any suggestions?
Just a few comments.
Run uses the Windows CreateProcess call to hide the console and
launch a new process, thereby subverting Cygwin in a manner similar to
one of our applications that I mentioned here:
It passes a NULL for the lpEnvironment parameter of that call which
means to inherit the environment from the parent process. In Cygwin <=
1.5.18, this inheritance included Cygwin environment variables. Now it
does not. I presume it now only inherits what was in the Windows
Anyway, this is a regression, but not necessarily one that will be fixed,
especially given Igor's workaround. I suspect this is just a case of if
you subvert Cygwin's means of doing something using Windows native calls,
you can expect the subversion method to break occasionally :-(.
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
the best safety device in any aircraft is a well-trained pilot...
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html