Skip to content

uninstalling the current version exits 1 without a shell hook, and nothing is left in use #809

Done

Description

@linghengqian

On Linux and macOS, uninstalling the version in use prints that vfox switched to another version, then fails with exit status 1, and no version is in use afterwards.

$ __VFOX_SHELL=bash vfox use --global <sdk>@2.0.0     # <sdk> has 1.0.0 and 2.0.0 installed
$ vfox uninstall <sdk>@2.0.0
Uninstalled <sdk>@2.0.0 successfully!
Auto switch to the other version.
vfox requires hook support. Please ensure vfox is properly initialized with 'vfox activate'
$ echo $?
1
$ vfox current <sdk>
no current version of <sdk>

1.0.0 stays installed, but nothing is in use. The same uninstall with __VFOX_SHELL=bash set exits 0 and makes 1.0.0 the global version.

The message comes from cmd/commands/uninstall.go (line 87), which prints it before source.Use runs. UseWithConfig in internal/sdk/sdk.go then returns the hook error (line 677) because the variable is missing. On Windows the same path switches to the global scope with a warning instead (line 672), so the Linux and macOS path could do the same, or the uninstall could report a clean state without the failing exit status.

Expected: exit status 0 after a successful uninstall, and a version in use if one is left.

Checked with vfox 1.1.0 on Linux. The code path is the same on main (69da1ba).

Activity

  1. added
    bug
    help wanted
    and removed
    help wanted
    on Nov 21, 2026
  2. added this to the 1.1.1 milestone on Nov 21, 2026
  3. linghengqian commented on Nov 21, 2026

    @linghengqian
    MemberAuthor

    @DeviousCardi I’d say you’re a bit late—there’s already a PR to address this issue. 🤣

  4. added a commit that references this issue on Nov 24, 2026
    43acf4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions