Repository navigation
fix: orphaned background job exits the same on macOS - #158
Merged
Merged
Conversation
On darwin, eioMeansReaderGone returned the startup terminal flag, so any EIO on a terminal stdout was read as "the reader left" and the run exited 130. A background job orphaned on a live terminal gets EIO too (a plain writer in the same setup gets a real EIO, 10 of 10 in the sel378 macOS test bed), so it exited 130 where Linux exits 9 with the write error. Darwin now asks readerGone(f), as Linux does. The sel378 K4 probe showed the macOS pty poll answers correctly 20 of 20 with the master open (not gone) and closed (gone). Windows is unchanged and the terminal parameter stays in the signature. The new darwin test checks the helper against a live and a closed pipe reader with terminal true and false. It is red on the old body in both cases. CI runs on ubuntu only, so it compiles under the darwin vet but only executes on a Mac. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186m4FrY9RHAiNN1uxztLCp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186m4FrY9RHAiNN1uxztLCp
natevick
marked this pull request as ready for review
November 22, 2026 21:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS, a background job orphaned from a live terminal now exits 9 with the write error, as it does on Linux. It used to exit 130, as if the user had interrupted it.
Linear: SEL-394.
What changed
macOS now decides "the reader is gone" by polling stdout, the same way Linux does, instead of using whether stdout was a terminal at startup. It's a one-line change plus a test.
Checks, on a real arm64 Mac
On Linux:
go veton all three platforms,go test -race, and golangci-lint 1.64.8 pass.Not established
sandbox-exec.🤖 Generated with Claude Code
https://claude.ai/code/session_0186m4FrY9RHAiNN1uxztLCp