This is the mail archive of the
mailing list for the Cygwin project.
Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Francis Litterio <flitterio at gmail dot com>, cygwin at cygwin dot com
- Date: Fri, 18 Nov 2016 02:43:18 +0300
- Subject: Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: smtp3j.mail.yandex.net; dkim=pass email@example.com
- References: <CAK-n8j7X7XkqO8Ny=_1CRLX=9cLY4nx6Pau2Q5mSq8ODVjNMtQ@mail.gmail.com> <CAJ1FpuMm_agFZZGbW=nCHes4uuNL2FPJWdgYb=0uRMoXdWZrCw@mail.gmail.com> <20160908120718.GE3860@calimero.vinschen.de> <firstname.lastname@example.org>
- Reply-to: cygwin at cygwin dot com
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,
Friday, November 18, 2016 02:36:52
Sorry for my terrible english...
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple