-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise WM_SETTINGCHANGE
after setting environment registry keys on Windows
#40
Comments
Is the goal for updates to affect the current session, sort of like an automatic |
No, I don't think that's possible, unless the shell itself, e.g., cmd or PowerShell, also reacts to this message and refreshes its environment, which would require managing/merging any user-local changes to the values.
Ah, I see now that I left that detail out in the original request. Sorry, I've clarified that this is for new apps started from Explorer or other process-starting applications. For example, ConEmu handles this message too so new tabs will see the PATH change, where right now I expect they do not if the user does not take some other action. |
Should be supported in https://pypi.org/project/userpath/1.8.0/ |
Awesome. Tested okay in the context of pipx: pypa/pipx#659 (comment) |
This is a feature request to resolve issues seen in pypa/pipx#659, where after
pipx ensurepath
(implemented using this library), you must either log-out-and-in, or manually edit an env-var (both the env-var editor UI andsetx
appear to raise this message after applying their changes), before the PATH becomes active for new processes started from Explorer or other process-starting applications, e.g. ConEmu.If
WM_SETTINGCHANGE
is raised after changing the registry key, then Windows Explorer (amongst others) will refresh its cache of the env-vars, and hence newcmd
,powershell
, etc. windows will see the new path immediately.At some point Windows Terminal will also support handling this message, and so new tabs will see the updated
PATH
. ConEmu already supports this for new tabs, and Console2 is mentioned in a comment on that issue as supporting this. ConsoleZ also supportsWM_SETTINGCHANGE
, but that can be disabled.That Windows Terminal issue link also has a bunch of discussion of the low-level details of the Explorer and application-specific behaviour when receiving the message, but they're not super-important here, as the sender-side is pretty close to:
and poking around, there's some Python-implemented versions of this call at https://stackoverflow.com/q/21138014/166389.
The text was updated successfully, but these errors were encountered: