Skip to content

Insufficient Bash detection on Win32 #22054

Closed as not planned
Closed as not planned

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

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 11, 2026
  2. github-actions commented on Apr 11, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from these (e.g. specifically about MSYS2 non-standard layouts or WSL bash exclusion), please clarify the difference so maintainers can track it separately.

  3. FrankHB commented on Apr 11, 2026

    @FrankHB
    Author

    If your issue is distinct from these (e.g. specifically about MSYS2 non-standard layouts or WSL bash exclusion), please clarify the difference so maintainers can track it separately.

    The point is that GNU Bash is independent to Git. Even if Git on Windows has bundled Bash because it depends on (both for development and for deployment) MSys (and now MSYS2) shell components including bash, it should not be assumed as the only way. And since all current Git for Windows packages are based on MSYS2 and few people build upstream Git in other way, it is easy to learn that MSYS2 is actually a more popular way to get a working bash on Windows.

    It is also not that simple to say "non-standard", although some of the alternatives are considered unsupported by the official Git for Windows project. However, it is outdated in the sense of availability, becuase now the MSYS2 official packages have native Win32 packages without the need to edit /etc/pacman.conf : just to use the upstream MSYS2 instead.

    See this Git for Windows document for some further clarification.

  4. Hona commented on Apr 12, 2026

    @Hona
    Member

    if the bash.exe isn't in PATH how should we find it?
    There's some git bash improvements I want to do, but additionally we shouldnt rely on bash as much.

    For other bash executables we should support it

  5. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions