Skip to content

Insufficient Bash detection on Win32 #22054

@FrankHB

Description

@FrankHB

Description

Currently Bash detection on Win32 assume bash.exe from Git installation is used. However there can be different layout, e.g. UCRT64 git.exe on a raw MSYS2 installation set up by pacman -S ucrt64/mingw-w64-ucrt-x86_64-git, which will lead git executable file found in /ucrt64/bin relative to the MSYS2 root directory. (It may worth noting MSYS2 also have package msys/git of MSys/Cygwin but some packages like git-lfs are only available for native Win32 variants.) In such cases shell.ts won't find the correct path of bash.exe.

Moreover, if bash.exe is in the path, it should be used. The bash.exe for WSL is in a well-known location so it should be easy to exclude. It can be also detected by check the output of bash --version, the WSL one will have x86_64-pc-linux-gnu but no MSYS/Cygwin Bash should have linux-gnu in the target.

Plugins

No response

OpenCode version

1.4.3

Steps to reproduce

  1. Run opencode on Win32 with Bash installed.
  2. Request to run any shell commands.
  3. Bash is not used.

Screenshot and/or share link

No response

Operating System

Windows 10

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions