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 can run on macOS/Linux
dev machines. Production callers (commands::bash::spawn_shell_command
and bash_background::registry::detached_shell_command_for) are
#[cfg(windows)].