public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Vince Rice <vrice@solidrocksystems.com>
To: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)
Date: Thu, 17 Nov 2016 19:53:00 -0000	[thread overview]
Message-ID: <5254219C-D6EF-47E7-BE79-3EEDC8DA6604@solidrocksystems.com> (raw)
In-Reply-To: <o0krfu$cob$1@blaine.gmane.org>

> On Nov 17, 2016, at 12:04 PM, Francis Litterio <flitterio@gmail.com> wrote:
> 
> 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.

None of which has anything to do with needing to re-start cygwin, which was Corinna's point.
And, for the record, Explorer doesn't induce any confusion at all. A new process gets its environment when it starts. Pretty simple to understand.


--
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

  reply	other threads:[~2016-11-17 18:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 16:04 Jim Reisert AD1C
2016-09-05 16:36 ` Doug Henderson
2016-09-05 17:23   ` Jim Reisert AD1C
2016-09-05 17:46   ` Achim Gratz
2016-09-08 12:07   ` Corinna Vinschen
2016-11-17 19:34     ` Francis Litterio
2016-11-17 19:53       ` Vince Rice [this message]
2016-11-17 20:26         ` Corinna Vinschen
2016-11-18  2:36       ` Andrey Repin
2016-09-05 17:44 ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5254219C-D6EF-47E7-BE79-3EEDC8DA6604@solidrocksystems.com \
    --to=vrice@solidrocksystems.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).