fix(desktop): batch PTY output to prevent bun dev crashes in terminal#3001
Conversation
Replace setImmediate with 16ms setTimeout for PTY output flushing to coalesce rapid TUI redraws into coherent frames (~60fps), preventing renderer flooding that caused bun dev to crash.
|
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 (2)
📝 WalkthroughWalkthroughThe PR modifies PTY output batching by switching from event-loop-based flushing via Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
…superset-sh#3001) Replace setImmediate with 16ms setTimeout for PTY output flushing to coalesce rapid TUI redraws into coherent frames (~60fps), preventing renderer flooding that caused bun dev to crash. (cherry picked from commit ce88250)
Summary
setImmediatewith a 16mssetTimeoutfor PTY output flushing, coalescing rapid TUI redraws into coherent ~60fps frames instead of flooding the renderer with tiny per-turn framesworkspaceRunRestartCommandcomputation outside the ref assignment in Terminal.tsx for clarityTest plan
bun devin the desktop terminal and verify it no longer crasheshtop,vim) render correctly without flickeringSummary by cubic
Batch PTY output every 16ms (~60fps) to stop flooding the renderer and fix crashes in the desktop terminal when running
bun dev. Also movedworkspaceRunRestartCommandcomputation out of the ref assignment inTerminal.tsxfor clarity.Written for commit b119527. Summary will update on new commits.
Summary by CodeRabbit