From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120441 invoked by alias); 17 Nov 2016 18:05:10 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 120428 invoked by uid 89); 17 Nov 2016 18:05:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=fran, henderson, Henderson, explorers X-HELO: blaine.gmane.org Received: from Unknown (HELO blaine.gmane.org) (195.159.176.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Nov 2016 18:05:08 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1c7R3S-0004uG-5X for cygwin@cygwin.com; Thu, 17 Nov 2016 19:04:58 +0100 To: cygwin@cygwin.com From: Francis Litterio Subject: Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH) Date: Thu, 17 Nov 2016 19:34:00 -0000 Message-ID: References: <20160908120718.GE3860@calimero.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 In-Reply-To: <20160908120718.GE3860@calimero.vinschen.de> X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00209.txt.bz2 On 9/8/2016 8:07 AM, Corinna Vinschen wrote: > On Sep 5 10:36, Doug Henderson wrote: >> I set CYGWIN_NOWINPATH=1 in my user environment variables, i.e. in >> registry, not in a cmd shell. I expect it needs to be seen when the >> first cygwin1.dll instance starts, so you would need to stop all >> cygwin processes and servers, just like you do when you run the cygwin >> setup, for this to be effective. > > Ouch, no! Environment variables are handed down from parent to child > process. On all systems, be it Windows, Cygwin, Linux or whatever. > There's *no* other magic involved. It's just a bunch of strings > inherited from the parent process. Yes, but Explorer induces confusion as follows (seen on Windows 7): 1. Open a Command Prompt from the Start Menu (so cmd.exe is a child of explorer.exe), and enter "echo %foobar%". See output "%foobar%". Environment variable foobar is not set. 2. Enter "setx foobar 99" to add foobar to the persistent environment variables in the Registry. 3. Enter "echo %foobar%" again in the same Command Prompt. Still see "%foobar%". No change in that process's environment, as expected. 4. Launch a new Command Prompt from the Start Menu. Enter "echo %foobar%". See "99". Clearly, Explorer updated it's environment from the Registry and passed the change to the new child process. This leads people to think that environment variables stored in the Registry are special, when in fact it's Explorer's doing. -- Fran -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple