X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding
	:in-reply-to; q=dns; s=default; b=o6Rnv+FdaQ1IWbofY1U4TGiMFHLphL
	xyMhdLPQFrfOOHJgPuJrhPqQ5QGO7zORQuL0rtRUISTi6JmUucXxm7y21m9r+/lB
	EceZL2J8M6aWJS3poqw1+k4OzRYGXiWIk9q+HAtoW0iUzZZWSNgqYwXZx2h2WqFZ
	0jp4HBwM4Hm/Q=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding
	:in-reply-to; s=default; bh=lWh1p49pBLsTrasZ9Kich5x8Rs8=; b=qsqO
	CeTaaesqfqMdGB8OkKwSmtSx7Q6RO/B6GsZMkMTR6+dcwg3TfxfBC9Xc2AkjQ2yM
	1neokhBKri3XS3K8xMD75B/lbfQX/RuR6a6whoxIpCiuB5v1F4X7KRPnY/Trd6PW
	P35ikTL8/UR6e0ynuYKiN+dKjmZIi0LmaMGXIxE=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
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
To: cygwin@cygwin.com
From: Francis Litterio <flitterio@gmail.com>
Subject: Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)
Date: Thu, 17 Nov 2016 13:04:49 -0500
Lines: 35
Message-ID: <o0krfu$cob$1@blaine.gmane.org>
References: <CAK-n8j7X7XkqO8Ny=_1CRLX=9cLY4nx6Pau2Q5mSq8ODVjNMtQ@mail.gmail.com> <CAJ1FpuMm_agFZZGbW=nCHes4uuNL2FPJWdgYb=0uRMoXdWZrCw@mail.gmail.com> <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

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

