Download and install MSYS2 into C:\Users\UserName\MSYS2. Confirm the installation has msys2.exe, ucrt64.exe, and other shell variants present. Open msys2.exe directly and run pacman -S git to verify pacman works and git installs correctly. Verify you can use both tools in the shell before proceeding.
Locate your OpenCode v1.1 installation. Find OpenCode.exe at a path like C:\Users\UserName\AppData\Local\OpenCode\OpenCode.exe. Confirm opencode-cli.exe is also present in the same directory. Test the CLI by running opencode-cli.exe web to ensure it boots correctly.
Shut down OpenCode. Close the web interface and any running OpenCode processes.
Open PowerShell and run:
$ENV:MSYSTEM = "MSYS"
$ENV:OPENCODE_GIT_BASH_PATH = "C:\Users\UserName\MSYS2\usr\bin\bash.exe"
$ENV:SHELL = "C:\Users\UserName\MSYS2\usr\bin\bash.exe"
& "C:\Users\UserName\AppData\Local\OpenCode\opencode-cli.exe" serve --port 8193Leave this PowerShell window open. The server is now running on port 8193 with MSYS2 bash as the default shell.
Open a new PowerShell window and run:
& "C:\Users\UserName\AppData\Local\OpenCode\OpenCode.exe" --connect localhost:8193The Desktop app will launch and connect to your MSYS2-backed server.
If the Desktop app previously connected to the built-in server, it may ignore your new server connection. Click Status at the top of the OpenCode Desktop window. Click Manage Servers. Select and configure the server details for localhost:8193. Confirm the connection is active. Later on when you are sure things all work you use the Manage Servers button in the Status area and set the new server as the default one and/or delete older servers.
When you first run bash commands in OpenCode, you may notice make and other tools installed in MSYS2 are not found because the Windows PATH is being used instead of the MSYS PATH. Fix this by creating a proper .bashrc in your MSYS2 home directory.
In OpenCode's bash tool, run:
cat > ~/.bashrc << 'BASHRC'
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
BASHRCSource the profile:
source ~/.bashrcVerify tools are now accessible:
which make
make --version
echo $MSYSTEMYou should see make located at /usr/bin/make, version 4.4.1 (or your installed version), and $MSYSTEM prints MSYS.
Keep the CLI server window open while using the Desktop app. This is your connection to the MSYS2-backed shell environment. The environment variables (MSYSTEM, OPENCODE_GIT_BASH_PATH, SHELL) are only active in that PowerShell window and inherited by the sidecar processes it spawns. If you close the server window, the Desktop app will lose its connection; restart both windows. This setup avoids the Windows Start Menu shortcut limitation (which cannot pass custom environment variables) by explicitly running the server with the correct environment.
Problem: Desktop app says server unavailable. Ensure the CLI server PowerShell window is still open and shows no errors. Verify the port 8193 is not in use by another process.
Problem: $MSYSTEM shows MINGW64 instead of MSYS. The $ENV:MSYSTEM = "MSYS" line in the server startup was skipped or not set. Re-run the server startup command exactly as shown, including all three environment variable lines.
Problem: Tools like make still not found after .bashrc update. Verify .bashrc was created: run cat ~/.bashrc and confirm the PATH export is there. Run source ~/.bashrc again to reload it. Check /usr/bin/make exists: ls -l /usr/bin/make.