-
Notifications
You must be signed in to change notification settings - Fork 4
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
Switching environment in the CLI should also change the value of environment variables in the current terminal #11
Comments
RefreshEnv.cmd works quite well, but unlikely to help you as you want to cause the parent process to be reset. https://github.com/tischda/refresh does that, using the broadcast mentioned in the SO you linked to above. See also saltstack/salt#23504 (comment) and rest of the thread. |
I've played around with this quite a bit over the last day for my own script, and I am pretty confident that RefreshEnv.cmd is the only way to fix this. Maximus5/ConEmu#468 also covers some of the reasons why a terminal shouldnt automatically refresh its env vars, and it has a patch very recently uploaded ... ;-) |
Thanks @jayvdb ! I am not sure of the final conclusion though: would there be a chance for a python process (the commandline setuptools entrypoint included in |
The best you could do is tell users
But then why not include |
You are right: the best is probably to include it as a resource and ask them to run it. Thanks ! |
Ahhh, yes ... if you can get control of the contents of Then you have the problem of being cross platform ... :) See chocolatey/choco#1851 |
Modifying the setuptools-generated entrypoint is a good idea ! We'll see how this goes when I have a window of time to have a look (or if someone proposes a PR). |
Currently if you use the CLI as in
envswitch <my_env>
, you need to restart your command terminal to see the change.Hints on how to do this:
The text was updated successfully, but these errors were encountered: