Failed to unload env var in my windows.
Describe the bug When I try to unload the profile, it fails. I tried to reload my shell, but the environment variables were still there. the report is as following:
Reload your shell to apply changes
ERROR: Invalid syntax.
Type "REG DELETE /?" for usage.
To Reproduce Steps to reproduce the behavior:
- Create a profile.
envio create lab -g select - add env var.
envio add lab -e WEB_ADDRESS="127.0.0.1:8080" - load it.
envio load lab - unload it.
envio unload lab - restart my terminal.
- echo the env var.
echo $Env:WEB_ADDRESS
Expected behavior
The environment variable WEB_ADDRESS remains after unloading the profile.
Screenshots
If applicable, add screenshots to help explain your problem.
Device (please complete the following information):
- OS: windows11 23H2
- Shell: powershell 7.4.2
- CLI Version: 0.5.1 (installed directly from
cargo install)
Additional context I can still find WEB_ADDRESS in the registry.
@ulic-youthlic, I've just pushed a commit that should resolve the issue. Test it out and let me know
I cloned this repository and then installed it using cargo install --path .. Now, I have good news and bad news:
It works, but not completely (maybe).
Here’s the process I followed:
- Created a profile named "test"
- Added an environment variable
Port=2333 - Loaded this profile
- Printed the environment variable directly, no response
- Restarted my terminal
- Printed
Port, output was 2333 - Unloaded the profile, output was successful
- Printed
Port, output was 2333 - Restarted the terminal
- Printed
Port, output was 2333 - Restarted the computer
- Printed
Port, no output
Yes, the latest envio can indeed correctly delete environment variables, but the problem is that Windows seems to be a bit slow to react and requires a computer restart to properly update the environment variables. Anyway, thanks for all you've done.