Preserve terminal stderr for subprocesses - #181
Conversation
Capture stderr before Ahoy installs its internal drain pipe so child processes inherit the original terminal descriptor. Closes ahoy-cli#180
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughAhoy now captures stderr at startup for subprocesses. Child stderr bypasses Ahoy’s drain pipe, while Ahoy’s own stderr remains drained. Tests verify routing between startup and execution-time streams. ChangesStderr routing
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change preserves child-process stderr behavior while isolating Ahoy's internal drain, with focused regression coverage; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The implementation addresses issue
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Why this approach
Of the alternatives discussed in #180, this passes the original stderr directly to subprocesses. It preserves the exact inherited descriptor for terminals, files, and pipes without adding terminal detection or a new dependency.
Testing
go test -race ./...bats tests(132 tests passed or skipped as platform-specific)/dev/fd/2changes from a pipe to the terminal character device.Closes #180
Summary by CodeRabbit
Bug Fixes
Tests
Documentation