-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Open
Labels
Description
Description
On Windows, shell auto-detection derives a Git Bash path from Bun.which("git"), but currently treats git.exe as a directory when building the bash.exe path. This can cause Opencode to fall back to cmd.exe even when Git Bash is installed.
Plugins
N/A
OpenCode version
dev (local checkout @ 213c0e18a, package packages/opencode v1.1.36)
Steps to reproduce
- Windows with Git for Windows installed (
gitavailable on PATH) - Ensure
SHELLis unset andOPENCODE_GIT_BASH_PATHis unset - Trigger the
bashtool (any tool call that usesShell.acceptable()) - Observe the selected shell path: it may not resolve to the actual Git Bash binary.
Operating System
Windows 11
Terminal
Windows Terminal
Expected
If git.exe is found (e.g. ...\\Git\\cmd\\git.exe), Opencode should derive Git Bash from path.dirname(git) (e.g. ...\\Git\\bin\\bash.exe).
Actual
The derived path may be built from path.join(git, "..", "..", "bin", "bash.exe"), which treats git.exe as a directory and can produce an invalid bash.exe path.
Reactions are currently unavailable