Skip to content

Fix short-lived Unix PTY initialization for v0.1.8 - #62

Merged
whackur merged 1 commit into
code0xff:devfrom
whackur:fix/exited-pty-session
Sep 18, 2026
Merged

whackur merged 1 commit into
code0xff:devfrom
whackur:fix/exited-pty-session

Conversation

@whackur

@whackur whackur commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Short-lived Unix PTY children can exit before ProcessTree::attach queries getpgid/getsid, causing a successful spawn to be rejected and its Created notification to be omitted. The macOS release tests exposed this while starting immediate printf/exit commands.

Derive the session and root process-group identity from the owned child PID: portable-pty establishes setsid before exec, and attach runs before any wait/reap. Retain the invalid-PID guard, TTY handle, Windows Job Object behavior and process-tree termination path.

Add a real-PTY Linux/macOS regression that uses waitid(WEXITED | WNOWAIT) to observe termination without reaping, then verifies attach and explicitly reaps the child. No tests are disabled.

Related to #61. Local Windows and Linux gates and independent custody review are required before merge; GitHub CI supplies native macOS verification. This is a v0.1.8 release blocker fix; no v0.1.8 tag or published Release exists yet.

@whackur
whackur merged commit 2a00ad4 into code0xff:dev Sep 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant