This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: problen with run command and the environment

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 :-(.

Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...

Unsubscribe info:
Problem reports:

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