mise hook-env
: PATH is not updated after mise uninstall
#2876
Labels
mise hook-env
: PATH is not updated after mise uninstall
#2876
Describe the bug
If there are some older tool versions installed (which also match version requirement in
.mise.toml
) and we domise rm <tool@current_version>
then we get broken$PATH
andmise i
is unable to fix this issue.To fix this situation we need to do something unusual: either remove all versions of the tool and then
mise i
will fix it, or install just removed "current_version" back, or leave project's directory and enter again.To Reproduce
Start clean, and ensure
mise i
won't add new tools to PATH, just in case (so far so good):Now, start using it and then upgrade, to ensure
mise i
will update PATH (so far so good too):Then, remove currently used version and get broken PATH:
The last line (above) demonstrate the issue: PATH still contain uninstalled/non-existing version, while Mise tools like
bin-paths
andls
thinks PATH contains another, existing version. As result of this it's even impossible to "fix" this in usual way:Expected behavior
If
mise install
updates$PATH
when installing newer version which matches requirement in config thenmise uninstall
should do the same when uninstalling currently used version. Or, more precisely,mise hook-env
should handle this case.mise doctor
outputThe text was updated successfully, but these errors were encountered: