fix: flush stdout in CLI help output#41
Conversation
The deprecatedWriter may buffer output. Without an explicit flush before posix.exit(), the help text can be silently truncated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded an explicit Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Greptile SummaryThis PR adds an explicit The fix is consistent with the existing pattern elsewhere in this file: the Confidence Score: 5/5Safe to merge — the single-line fix is correct, low-risk, and consistent with the existing flush pattern in the file. The only finding is a P2 style suggestion to migrate away from No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant main as main()
participant stdout as stdout (deprecatedWriter)
participant posix as posix.exit(0)
main->>stdout: print("Usage: ghostty ...")
main->>stdout: print(help text)
main->>stdout: flush() ← added by this PR
stdout-->>main: ok
main->>posix: exit(0)
Note over posix: _exit() — does NOT flush<br/>application buffers
|
Summary
stdout.flush()call beforeposix.exit(0)in CLI help output pathdeprecatedWriterTest plan
ghostty +help(or any invalid action) and verify full help text is printedghostty +help | cat🤖 Generated with Claude Code
Summary by cubic
Ensure CLI help text prints fully by flushing stdout before exit. Prevents truncated output when output is buffered or piped.
Written for commit 9c5b401. Summary will update on new commits.
Summary by CodeRabbit