X-Recipient: archive-cygwin AT delorie DOT 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:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=QH55yiNzplMFNlOv Uf8+xSKmu0nbwIEpwBO9Aa3iXhd8zXV8b1BLBt0jDlPQGvCmmtIZ50a9zxovzKPM 3xLcztfecqVRYwreKRjnw1ZVizCJhsBMvZipZkWAEC9JEwgSKuN8dcG0CEK1yOdX icUuFmHx0pM0e0MlTLWzaD2p7wY= 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:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=default; bh=9vzPt/UQx2iN1lZKUROuAi NNCvg=; b=Y56JKnluPyRlnioE5/DNsCOkbpj5rs7y32Gj17IsitatUfo87fvbJD ErGr75eU31F+sTB1NvmV+j1FmXRaZgmxyVt7cZ4mvHxuswRFERIslz6ApqrQ0bl0 VLnYVPqmMS0xrilFkeyTv0JphWQuPpiqZKcRMyAWyjtSrKaPoq0G4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*M:yandex, H*F:D*yandex.ru, UD:yandex.ru, yandexru X-HELO: forward4p.cmail.yandex.net Authentication-Results: smtp3j.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Date: Fri, 18 Nov 2016 02:43:18 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <1093942788.20161118024318@yandex.ru> To: Francis Litterio , cygwin AT cygwin DOT com Subject: Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH) In-Reply-To: References: <20160908120718 DOT GE3860 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Greetings, Francis Litterio! >>> 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. It's actually OS and setx's doing. setx sends a signal on OS level, that the environment has been updated, and programs subscribed to it (like Explorer) update their environment accordingly. Predictable, this behavior is not limited to Explorer. F.e. Far Manager do that. -- With best regards, Andrey Repin Friday, November 18, 2016 02:36:52 Sorry for my terrible english... -- 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