fix: recover interrupted installs and correct shell integration - #707
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved Windows zsh PATH serialization/cache issues and empty-version runtime detection remain.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR adds interrupted-install recovery, fixes Windows/MSYS2 shell integration, and adds Fish completion support.
Changes:
- Adds install markers, locking, recovery logic, and tests.
- Improves shim-based shell detection and zsh PATH handling.
- Adds Fish completion, documentation, packaging, and CI coverage.
File summaries
| File | Summary |
|---|---|
README.md |
Documents Fish completion. |
README_CN.md |
Documents Fish completion in Chinese. |
internal/shell/shell.go |
Resolves shells through same-name shims. |
internal/shell/open_test.go |
Tests shim-aware shell detection. |
internal/sdk/sdk.go |
Adds install markers and recovery checks. |
internal/sdk/install_windows_test.go |
Tests Windows locked-payload recovery. |
internal/sdk/install_test.go |
Tests installation recovery and locking. |
internal/sdk/install_lock.go |
Provides shared install locking. |
internal/sdk/install_lock_windows.go |
Implements Windows locking. |
internal/sdk/install_lock_unix.go |
Implements Unix locking. |
internal/env/path_windows_test.go |
Tests Windows/MSYS2 PATH handling. |
internal/env/env_win.go |
Adds zsh PATH serialization. |
completions/zsh_autocomplete |
Preserves zsh completion formatting. |
completions/vfox.fish |
Adds Fish command and option completion. |
completions/bash_autocomplete |
Preserves Bash completion formatting. |
cmd/completion.go |
Handles CLI completion generation. |
cmd/completion_test.go |
Tests shell completion integration. |
cmd/cmd.go |
Registers completion handlers. |
AGENTS.md |
Documents installation invariants. |
.goreleaser.yaml |
Packages Fish completion scripts. |
.github/workflows/ci.yml |
Adds platform-specific regression jobs. |
Review details
Suppressed comments (1)
internal/env/env_win.go:33
- The new zsh branch can be skipped entirely by the persistent env cache:
envFlagreturns cached output for a cachedzshentry beforePaths.String()runs, andConfigStatekeys that entry only by shell name, not by PATH serialization format or vfox version. Output generated by the pre-change binary can therefore remain semicolon-separated after upgrade, so this MSYS2 fix is not applied until cache invalidation. Invalidate or version the cache when this format changes and cover a pre-existing zsh cache.
shell := strings.ToLower(os.Getenv(HookFlag))
if shell == "bash" || shell == "zsh" {
- Files reviewed: 21/21 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+937
to
+938
| info, err := os.Stat(filepath.Join(b.packagePath(version), name+"-"+string(version))) | ||
| return err == nil && info.IsDir() && !b.hasPendingInstall(version) |
Comment on lines
+32
to
+33
| shell := strings.ToLower(os.Getenv(HookFlag)) | ||
| if shell == "bash" || shell == "zsh" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix interrupted-install recovery, Windows MSYS2 zsh PATH serialization, and shell detection through same-name executable shims. Add Fish command and option completion with packaging support and preserve Bash/Zsh completion formats.
Validation: CI and three-platform E2E passed on 563ba7b. Windows tests execute native process/file-lock regressions and MSYS2 zsh; Fish tests run with the real shell. The shim test uses a native process fixture rather than a complete Scoop installation.
Fixes #252
Fixes #490
Fixes #238
Fixes #22