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
- Run
opencode on Win32 with Bash installed.
- Request to run any shell commands.
- Bash is not used.
Screenshot and/or share link
No response
Operating System
Windows 10
Terminal
No response
Description
Currently Bash detection on Win32 assume
bash.exefrom Git installation is used. However there can be different layout, e.g. UCRT64git.exeon a raw MSYS2 installation set up bypacman -S ucrt64/mingw-w64-ucrt-x86_64-git, which will leadgitexecutable file found in/ucrt64/binrelative to the MSYS2 root directory. (It may worth noting MSYS2 also have packagemsys/gitof MSys/Cygwin but some packages likegit-lfsare only available for native Win32 variants.) In such casesshell.tswon't find the correct path ofbash.exe.Moreover, if
bash.exeis in the path, it should be used. Thebash.exefor WSL is in a well-known location so it should be easy to exclude. It can be also detected by check the output ofbash --version, the WSL one will havex86_64-pc-linux-gnubut no MSYS/Cygwin Bash should havelinux-gnuin the target.Plugins
No response
OpenCode version
1.4.3
Steps to reproduce
opencodeon Win32 with Bash installed.Screenshot and/or share link
No response
Operating System
Windows 10
Terminal
No response