Wait before drawing the frame when receiving ESC[2J #21261

Open
opened 2026-01-31 07:38:03 +00:00 by claunia · 0 comments
Owner

Originally created by @a-usr on GitHub (Feb 16, 2024).

Description of the new feature/enhancement

Wait before drawing ( or creating ) a frame when ESC[2J (Clear Screen) is received until either a set time (e.g. 2 ms) has passed or additional data is received from stdout or stderr. This is to prevent flickering caused by applications (that do frame-based rendering, e.g TUI applications) that clear the screen before writing the next frame to it. If such a feature already exists, I propose making the timeout higher.

Worth noting is that the Flickering seems to be more intense on windows 11 vs on windows 10. Do the two platforms have different max framerates or is the framerate not capped at all and its caused by a hardware difference?

Proposed technical implementation details (optional)

Originally created by @a-usr on GitHub (Feb 16, 2024). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Wait before drawing ( or creating ) a frame when ESC[2J (Clear Screen) is received until either a set time (e.g. 2 ms) has passed or additional data is received from stdout or stderr. This is to prevent flickering caused by applications (that do frame-based rendering, e.g TUI applications) that clear the screen before writing the next frame to it. If such a feature already exists, I propose making the timeout higher. Worth noting is that the Flickering seems to be more intense on windows 11 vs on windows 10. Do the two platforms have different max framerates or is the framerate not capped at all and its caused by a hardware difference? <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 07:38:04 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21261