Repository navigation
fix(cli): run the curl installer with Git Bash on Windows - #53029
Merged
Merged
Conversation
A bare `bash` on Windows often resolves to the WSL launcher, which cannot read the downloaded installer at its Windows path. Locate Git Bash through `git --exec-path`, honor OPENCODE_GIT_BASH_PATH, and fail with a clear message before downloading when neither is available.
neriousy
force-pushed
the
windows-installer-bash
branch
from
October 3, 2026 22:19
42a2364 to
5c56a16
Compare
Ichinose-Kazuki
pushed a commit
to Ichinose-Kazuki/opencode
that referenced
this pull request
Oct 7, 2026
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.
Issue for this PR
Closes #52815
Closes #50924
Closes #50950
Type of change
What does this PR do?
opencode upgrade//updatewith the curl method runs the downloaded installer with a barebash. On Windows that often resolves to the WSL launcher (System32\bash.exeor theWindowsAppsalias) because a stock Git for Windows install only putsGit\cmdon PATH. WSL bash can't read the installer at its Windows path, so the upgrade fails with/bin/bash: C:...install: No such file or directory.On Windows the updater now picks the installer's interpreter explicitly:
OPENCODE_GIT_BASH_PATH, the existing documented override already used by the server.git --exec-path(<Git>/mingw64/libexec/git-core→<Git>/bin/bash.exe), which also handles custom install locations such asD:\Program Files\Git.Non-Windows behavior is unchanged.
Related: #51038 targets the same bug by probing
uname -son every bash candidate. This version is smaller and was exercised end to end on Windows (below). It does not support machines with only MSYS2/Cygwin bash and no Git for Windows; those can useOPENCODE_GIT_BASH_PATH.How did you verify your code works?
bun test test/updater-install.test.tsandbun typecheckinpackages/cli;bun run checkfrom the root.USERPROFILE/HOME), the real PATH withGit\binremoved so barebashresolved to the WSL alias, and the real installer and npm package to upgrade 2.0.21 → 2.0.22:Git\cmdon PATH/bin/bash: ...\install: No such file or directoryGit\cmdon PATHC:\Program Files\Git\bin\bash.exe, writesopencode2.cmdgiton PATHgit,OPENCODE_GIT_BASH_PATHsetScreenshots / recordings
CLI only. Failure output when Git Bash can't be found:
Checklist