From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95584 invoked by alias); 17 Nov 2016 23:50:22 -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 95572 invoked by uid 89); 17 Nov 2016 23:50:22 -0000 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 Received: from forward4p.cmail.yandex.net (HELO forward4p.cmail.yandex.net) (77.88.31.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Nov 2016 23:50:12 +0000 Received: from smtp3j.mail.yandex.net (smtp3j.mail.yandex.net [IPv6:2a02:6b8:0:801:1::12]) by forward4p.cmail.yandex.net (Yandex) with ESMTP id C80D620BDC; Fri, 18 Nov 2016 02:50:08 +0300 (MSK) Received: from smtp3j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3j.mail.yandex.net (Yandex) with ESMTP id 2577C6240DC9; Fri, 18 Nov 2016 02:50:07 +0300 (MSK) Received: by smtp3j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id kLBgS0U9eA-o7pGuSts; Fri, 18 Nov 2016 02:50:07 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Authentication-Results: smtp3j.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Thu, 17 Nov 2016 23:43:19 -0000 Date: Fri, 18 Nov 2016 02:36:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1093942788.20161118024318@yandex.ru> To: Francis Litterio , cygwin@cygwin.com Subject: Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH) In-Reply-To: References: <20160908120718.GE3860@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00214.txt.bz2 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