X-Spam-Check-By: sourceware.org Date: Thu, 19 Jan 2006 09:29:27 -0600 From: Brian Ford Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: problen with run command and the environment In-Reply-To: <20060119000230.30295.qmail@web35612.mail.mud.yahoo.com> Message-ID: References: <20060119000230 DOT 30295 DOT qmail AT web35612 DOT mail DOT mud DOT yahoo DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list 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: http://cygwin.com/ml/cygwin/2006-01/msg00472.html 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 environment? 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: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/