[PR #13665] Fix conpty not emitting colored spaces on the VERY FIRST frame #29700

Open
opened 2026-01-31 09:36:24 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/13665

State: closed
Merged: Yes


This bug arose from a "race condition" in the first frame handling of conpty. We'd try to optimize out spaces if we've cleared the entire frame (which always happens on the first frame). However, doing that even for colored spaces meant that things like powerline prompts could be emitted to conhost during the first frame, and we'd optimize the spaces out. That's silly.

This is hard to repro naturally, but this comment has another repro I used
https://github.com/microsoft/terminal/issues/8341#issuecomment-731310022

Modified to facilitate simpler testing, it looks like:

Before

image

After

image

Co-authored by @DHowett

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13665 **State:** closed **Merged:** Yes --- This bug arose from a "race condition" in the first frame handling of conpty. We'd try to optimize out spaces if we've cleared the entire frame (which always happens on the first frame). However, doing that even for colored spaces meant that things like powerline prompts could be emitted to conhost during the first frame, and we'd optimize the spaces out. That's silly. This is hard to repro naturally, but this comment has another repro I used https://github.com/microsoft/terminal/issues/8341#issuecomment-731310022 Modified to facilitate simpler testing, it looks like: #### Before ![image](https://user-images.githubusercontent.com/18356694/182680119-bb22179c-a328-43f3-b64a-0d1d5773b813.png) #### After ![image](https://user-images.githubusercontent.com/18356694/182680159-805964c5-c4cc-411a-8865-3866fca8d6e9.png) * [x] Closes #8341 * [x] Tests added Co-authored by @DHowett
claunia added the pull-request label 2026-01-31 09:36:24 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29700