ci-fix: macOS shell wrapper interrupt test intermittently returns 130
The affected coverage run on main failed on macOS in foreground_jobs::interrupted_shell_wrapper_applies_directive_and_cleans_up::case_2 at commit 882e7be5747701f751a0c22c912d60daf94b5286. The test sends Ctrl-C to a foreground Python worker and expects the wrapper command's saved status to be 0; wrapper-caught-status contained 130 at foreground_jobs.rs:1302. The test reached its WRAPPER_CAUGHT marker, so the shell continued after the command. The rerun passed both previously failed coverage jobs.
The failure log has no captured terminal output or wt exit status. It cannot distinguish wt returning 130 from the interactive shell setting that status while handling Ctrl-C. The commit changes directive file reading in fish, Nushell, and PowerShell, plus wt's existence check; this case uses bash. The preceding affected run passed. The evidence points to an intermittent failure, without identifying its cause.
No safe code fix is established. A recurrence needs the shell output and wt exit status to identify the failing path. This issue tracks the macOS wrapper case separately from the recurring Linux final-alias test in #4603, for which #4607 is already open. #4609 addresses a possible pending signal receipt race, but this log does not show whether that mechanism occurred here.
Triage found no reproducible failure or supported fix for this macOS wrapper case. All nine interrupted_shell_wrapper_applies_directive_and_cleans_up cases passed here on Linux with --features shell-integration-tests; the macOS rerun also passed. The first attempt records wrapper-caught-status = 130 in the bash custom-trap case, but no terminal output or separate wt exit status, so it does not identify which process supplied that status.
#4609 addresses a signal-receipt race in a related alias path, but this log does not establish that it caused this failure. I have not opened a speculative fix. If the case recurs, capturing the wrapper's terminal output and wt exit status separately would distinguish a wt return from bash handling Ctrl-C after the command.
Closing: the failure matches the race that #4609 fixed, and this test hasn't failed on main since that fix merged.
The worker catches Ctrl-C and exits 0. A 130 here means bash saw wt killed by SIGINT, not a status wt chose to return. Before #4609, wt could release its last foreground signal lease and restore default SIGINT handling while its handler for that same Ctrl-C was still pending. That kills wt even though the child exited cleanly. --execute runs its child through the same lease that #4609 now releases on the signal owner thread (signal_forwarder.rs), so the fix covers this path and not just aliases. The bash case is consistent with that: with the custom INT trap, bash keeps running the line after a child dies from SIGINT, which is how the test still reached WRAPPER_CAUGHT. With the default disposition, bash would have dropped the rest of the line.
The failing commit 882e7be predates #4609 (d697e94). Since 2026-10-27, no run of ci, affected, or nightly on main has failed in interrupted_shell_wrapper_applies_directive_and_cleans_up, including first attempts that were later rerun. If it comes back on a commit that includes #4609, reopen this issue, since that would point to a second cause.