pathman icon indicating copy to clipboard operation
pathman copied to clipboard

bug: Pathman remove is path separator sensitive

Open chipbite opened this issue 7 months ago • 1 comments

Describe the bug

Lazy for this one, see previous reports, here is my test in cmd.exe, first TLDR:

C:\Users\mawid6>%userprofile%\bin\pathman.exe add "~/bin"
The operation completed successfully.

C:\Users\mawid6>%userprofile%\bin\pathman.exe remove ~\bin
PATH not changed.

C:\Users\mawid6>%userprofile%\bin\pathman.exe remove ~/bin
The operation completed successfully.
Saved PATH changes.

Complete:

C:\Users\mawid6>reg query "HKCU\Environment"

HKEY_CURRENT_USER\Environment
    Path    REG_SZ    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
    TMP    REG_EXPAND_SZ    %USERPROFILE%\AppData\Local\Temp
    OneDrive    REG_EXPAND_SZ    C:\oned\OneDrive - Inter IKEA Group
    GOPATH    REG_EXPAND_SZ    %USERPROFILE%\go
    OneDriveCommercial    REG_EXPAND_SZ    C:\oned\OneDrive - Inter IKEA Group


C:\Users\mawid6>%userprofile%\bin\pathman.exe add "~/bin"
The operation completed successfully.
Saved PATH changes. To set the PATH immediately, update the current session:

        PATH C:\Users\mawid6/bin;%PATH%



C:\Users\mawid6>%userprofile%\bin\pathman.exe remove ~\bin
PATH not changed.


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
    TMP    REG_EXPAND_SZ    %USERPROFILE%\AppData\Local\Temp
    OneDrive    REG_EXPAND_SZ    C:\oned\OneDrive - Inter IKEA Group
    GOPATH    REG_EXPAND_SZ    %USERPROFILE%\go
    OneDriveCommercial    REG_EXPAND_SZ    C:\oned\OneDrive - Inter IKEA Group


C:\Users\mawid6>%userprofile%\bin\pathman.exe remove ~\bin
PATH not changed.


C:\Users\mawid6>%userprofile%\bin\pathman.exe remove ~/bin
The operation completed successfully.
Saved PATH changes.


C:\Users\mawid6>

chipbite avatar May 20 '25 13:05 chipbite

Yes, this is the same issue - PATH-normalization was not implemented correctly for Windows in all of the right places.

coolaj86 avatar May 21 '25 06:05 coolaj86