Skip to content

feat: Replace unzip with @zip.js/zip.js for Windows compatibility#662

Merged
thdxr merged 2 commits into
anomalyco:devfrom
ClayWarren:fix/windows-unzip-issue
Jul 24, 2025
Merged

feat: Replace unzip with @zip.js/zip.js for Windows compatibility#662
thdxr merged 2 commits into
anomalyco:devfrom
ClayWarren:fix/windows-unzip-issue

Conversation

@ClayWarren

Copy link
Copy Markdown
Contributor

feat: Replace unzip with @zip.js/zip.js for Windows compatibility

 **Problem:**
 Users on Windows encountered an "Executable not found in $PATH: 'unzip'" error when running `opencode.exe`, as the
  application relied on the `unzip` command for extracting `fzf.exe` and `rg.exe`. This external dependency caused issues on systems where `unzip` was not pre-installed or configured in the PATH.
 
 **Solution:**
 This PR replaces the usage of the external `unzip` command with the `@zip.js/zip.js` library for handling `.zip` file
  extraction on Windows. This change affects the download and extraction logic for `fzf.exe` in `src/file/fzf.ts` and
  `rg.exe` in `src/file/ripgrep.ts`.
 
**Benefits:**
- Improves Windows compatibility and robustness by removing the dependency on an external `unzip` executable.
- Ensures a more consistent and reliable installation experience for Windows users.
- The solution is implemented using a cross-platform JavaScript library, integrating seamlessly with the existing Bun
  runtime.

Resolves Issue #608

This commit replaces the external 'unzip' command with the '@zip.js/zip.js' library for extracting fzf.exe and rg.exe on Windows. This resolves the 'Executable not found in /Users/claywarren/.nvm/versions/node/v23.6.1/bin:/opt/homebrew/opt/ruby/bin:/Users/claywarren/.nvm/versions/node/v23.6.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/usr/local/go/bin:/opt/homebrew/opt/ruby/bin:/Users/claywarren/.nvm/versions/node/v23.6.1/bin:/Users/claywarren/.cargo/bin:/Users/claywarren/Library/Application Support/Code/User/globalStorage/github.copilot-chat/debugCommand: unzip' error, making opencode.exe more robust on Windows systems.
@thdxr
thdxr self-requested a review July 4, 2025 15:23
@thdxr thdxr self-assigned this Jul 4, 2025
@maharshi365

Copy link
Copy Markdown
Contributor

@ClayWarren i tested this and it works, but there are merge conflicts. if you get a chance to update so that it can be merge would be great!

@thdxr
thdxr merged commit d50ae8e into anomalyco:dev Jul 24, 2025
pepperpepperpepper pushed a commit to pepperpepperpepper/opencode that referenced this pull request Jul 29, 2025
achembarpu pushed a commit to achembarpu/opencode that referenced this pull request Aug 4, 2025
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants