Skip to content

test(cli): verify PTY foreground handoffs - #150

Merged
steipete merged 1 commit into
mainfrom
claude/fix-pty-foreground-validation
Oct 9, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/fix-pty-foreground-validation

Conversation

@steipete

@steipete steipete commented Oct 8, 2026 •

Copy link
Copy Markdown

Summary

The PTY shell fixture in test/cli/run/no-orphans.test.ts compared tcsetpgrp with zero. Perl POSIX returns undef on failure, and numeric comparison treated that as zero, allowing a failed handoff to proceed without establishing foreground ownership.

Use one helper for both the initial handoff and resume: reject undefined syscall results, then require tcgetpgrp to match the requested process group before continuing. This follows up on #145. The change is limited to the fixture; runtime code, assertions, timeouts and existing platform gates are unchanged.

Validation

  • Actual Perl controls on macOS reproduced the old guard accepting ENOTTY and the corrected helper rejecting it; initial and resume handoffs passed on a real PTY.
  • Exact-head native CI passed for a3cbe02065dc05048fef25541f2a6a9a54350315. Its build commit 364c8d4c54a867190ac2d6ab445e4878126ffb18 has the identical complete source tree. All 14 selected Linux files and 10 selected macOS files passed. The full corrected file recorded exit code 0 and no signal on both platforms: Linux 18 pass / 6 existing skips / 0 fail in 2.105 seconds; macOS 15 pass / 9 existing skips / 0 fail in 1.370 seconds, each across all 24 cases. No CI rerun was requested.
  • Format, JavaScript lint and the scoped P2 review passed. The non-required issue/duplicate review action failed because its service credentials are unavailable; no code finding was produced.

An earlier one-shot Linux validation produced an exact 24-case JUnit report (18 pass / 6 existing skips), including the corrected PTY case, and all 92 captured source/lock files matched their expected hashes. Its Node reporting wrapper then exited 1 because the supplied source archive lacked Git metadata for report links. Bun's exit code and signal were not recorded, so successful teardown under that run's extra local-mode VM-destruction setting remains unverified. That failed run is preserved and was not replayed. The new-head CI results above establish successful full-file exits under the normal CI environment; they do not reconstruct the earlier missing result.

Upstream search found no matching correction for this Perl return-value check; the related terminal-signal and macOS descendant-tracking changes address separate behavior.

@steipete
steipete marked this pull request as ready for review October 8, 2026 22:25
@steipete
steipete merged commit 0b238bc into main Oct 9, 2026
6 of 7 checks passed
@steipete
steipete deleted the claude/fix-pty-foreground-validation branch October 9, 2026 03:24
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