diff --git a/scripts/hooks/observe-runner.js b/scripts/hooks/observe-runner.js index 28e7f4fb0..c046d75f0 100644 --- a/scripts/hooks/observe-runner.js +++ b/scripts/hooks/observe-runner.js @@ -61,7 +61,10 @@ function findShellBinary() { stdio: 'ignore', windowsHide: true }); - if (!probe.error) { + // Require the probe to actually succeed, not just spawn: Windows' + // System32\bash.exe (WSL launcher) spawns even with no distro installed but + // exits non-zero, so `!probe.error` alone would treat it as a usable shell. + if (!probe.error && probe.status === 0) { return candidate; } }