Suppose I go into the System Properties window and add an environment variable to the Path. If I have a terminal window open, it will be unaware of the change, so I close it and open another one.
Is there a way to have it reload the Path information from the command line? I'd particularly like to know how I can do it with my Cygwin shell, but I'd be happy to know how to handle either case (Cygwin or native terminal).
Best Answer
There is not built-in method for changes to be propagated to child processes automatically, processes can be setup to listen for a particular message, and update, but for that requires special handling within the application.
Propgation of the environment to some applications is the exception rather then the rule. The normal behavior is that when process is created it gets a copy of the environment from the parent process. Changes with to the environment within that process do not propagate back to the parent. After a process has been created any further changes in the environment of the parent do not get propagated to the child.
On Windows the environment the system variables that you set through that interface are stored in the registry, so you could theoretically write a script in cygwin that would re-read the registry and output the current variables, and then use that to update the environment in the current shell.
From the kb http://support.microsoft.com/kb/104011