fix(hooks): require successful shell probe in observe runner (#2403)

Require observe-runner shell detection to accept only candidates whose probe exits successfully, avoiding Windows WSL launcher false positives.
This commit is contained in:
JongHyeok Park 2026-07-14 10:31:12 +09:00 committed by GitHub
parent 40927950c4
commit ed38744605
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}