Expand description
Shared Windows shell selection for foreground and background bash commands.
Mirrors OpenCode’s resolver:
$SHELLenv var (typically points at git-bash on Windows dev setups).pwsh.exe(PowerShell 7+).powershell.exe(Windows PowerShell 5.1).- Git-for-Windows
bash.exediscovered next togiton PATH (catches users who installed Git for Windows but never set$SHELL). cmd.exe(universal floor — always reachable on every Windows SKU).
POSIX shells (bash, sh, zsh, ksh, dash) are invoked as <shell> -c <cmd>
the same way Unix does. PowerShell variants take their -Command shape;
cmd.exe takes /D /C.
Compiled on all platforms so the cross-platform retry-decision unit
tests in commands::bash::try_spawn_with_fallback (test-only — see the
Windows foreground bash path in crate::commands::bash) can run on
macOS/Linux dev machines. The production Windows background spawn path
at bash_background::registry::detached_shell_command_for is the live
caller.