Describe the bug
Running sample cmd:
%userprofile%\bin\pathman.exe add ~/bin
Expected: %userprofile%\bin (or perhaps expanded, e g C:\Users\JohnDoe\bin ) added to REG_EXPAND_SZ Path value of HKCU\Environment key.
Actual: Path entry is added as expected (well, almost), but value is rewritten as REG_SZ type.
To Reproduce
- In fresh win11, check registry.
Example:

Notice type of PATH value.
- In cmd.exe, run sample cmd (
%userprofile%\bin\pathman.exe add ~/bin). Check registry again.
I get:

or
C:\Users\mawid6>reg query "HKCU\Environment"
HKEY_CURRENT_USER\Environment
Path REG_SZ C:\Users\mawid6/bin;C:\Users\mawid6\AppData\Local\Programs\Python\Python313\Scripts\;C:\Users\mawid6\AppData\Local\Programs\Python\Python313\;C:\Users\mawid6\AppData\Local\Programs\Python\Launcher\;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Users\mawid6\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mawid6\AppData\Local\Microsoft\WinGet\Links;C:\Users\mawid6\AppData\Roaming\npm;%USERPROFILE%\go\bin
TEMP REG_EXPAND_SZ %USERPROFILE%\AppData\Local\Temp
Device / Machine (please complete):
- OS/Device: Win 11, Microsoft Windows [Version 10.0.26100.3775]

- Arch: x64 (installed amd64 version, e g
https://git.rootprojects.org/root/pathman/releases/download/v0.5.2/pathman-v0.5.2-windows-amd64.zip).
- Version 0.5.2.
Additional context / Impact
I doubt this has any actual impact on anything, TBH, but it just looks rather "clueless" and I immediately reacted with a feeling of unease, like "if this passes, how can I trust this command?". And I think it should be easy to fix, have not checked the code.
git-bash startup broke for me, since my user env path has a few %USERPROFILE%\bin like entries. When I manually changed the valuetype back to REG_EXPAND_SZ, it worked fine again - so it seems that was the culprit. It seems likely that it parses the regedit values based, and based on the type - if it is REG_EXPAND_SZ - it does variable expansion.
Describe the bug
Running sample cmd:
%userprofile%\bin\pathman.exe add ~/binExpected:
%userprofile%\bin(or perhaps expanded, e gC:\Users\JohnDoe\bin) added toREG_EXPAND_SZPath value of HKCU\Environment key.Actual: Path entry is added as expected (well, almost), but value is rewritten as
REG_SZtype.To Reproduce
Example:
Notice type of PATH value.
%userprofile%\bin\pathman.exe add ~/bin). Check registry again.I get:
or
Device / Machine (please complete):
https://git.rootprojects.org/root/pathman/releases/download/v0.5.2/pathman-v0.5.2-windows-amd64.zip).Additional context / Impact
I doubt this has any actual impact on anything, TBH, but it just looks rather "clueless" and I immediately reacted with a feeling of unease, like "if this passes, how can I trust this command?". And I think it should be easy to fix, have not checked the code.git-bash startup broke for me, since my user env path has a few
%USERPROFILE%\binlike entries. When I manually changed the valuetype back toREG_EXPAND_SZ, it worked fine again - so it seems that was the culprit. It seems likely that it parses the regedit values based, and based on the type - if it isREG_EXPAND_SZ- it does variable expansion.