axodotdev / axodotdev/cargo-dist
[powershell] investigate ancient chocolatey wizard magic to impl "source HKCU"
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 149
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 32
Description
Windows has a Better and Worse story for updating PATH:
* Better: you can just modify `HKCU:\Environment\Path` and every windows shell should respect that
* Worse: there is no equivalent to `source ~/.profile` to refresh the current shell (and even opening a new tab in Windows Terminal is insufficient, only opening a new Window will force a reread of HKCU.
Someone told me that chocolatey (at least at some point?) had some dark wizard magic to potentially refresh the local shell's env:
https://github.com/chocolatey-archive/chocolatey/blob/master/src/redirects/RefreshEnv.cmd
If this worked, and especially if it could be done automatically by the powershell installer, this would make windows basically a perfect UX.
I'm suspicious of it but it's worth investigating more deeply.
Contributor guide
Research direction
Start by reviewing Chocolatey's linked RefreshEnv.cmd and the PowerShell installer behavior in cargo-dist. Determine whether the environment can be refreshed in the current shell, whether the approach works reliably, and whether automatic use by the installer is feasible; document the result and any constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, release
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100