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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13665
Author: @zadjii-msft
Created: 8/3/2022
Status: ✅ Merged
Merged: 8/8/2022
Merged by: @undefined

Base: main ← Head: dev/migrie/b/8341-by-itself


📝 Commits (4)

📊 Changes

4 files changed (+114 additions, -6 deletions)

View changed files

📝 src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp (+73 -0)
📝 src/host/ut_host/ConptyOutputTests.cpp (+28 -0)
📝 src/inc/TestUtils.h (+6 -2)
📝 src/renderer/vt/paint.cpp (+7 -4)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13665 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 8/3/2022 **Status:** ✅ Merged **Merged:** 8/8/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/8341-by-itself` --- ### 📝 Commits (4) - [`ac9e9a3`](https://github.com/microsoft/terminal/commit/ac9e9a331add189a0743bef264e5d19439073fb7) add a test - [`aba6caf`](https://github.com/microsoft/terminal/commit/aba6caf1763bf2c7a45f875ba12a53c3abd720bf) HAX: Try to fix the conpty first frame boog - [`1fdd632`](https://github.com/microsoft/terminal/commit/1fdd6325b255c2bc8661963c4a8c29447785220e) cleanup - [`414f210`](https://github.com/microsoft/terminal/commit/414f2104e7ce363c0e5760425796c890d549dd6f) spel ### 📊 Changes **4 files changed** (+114 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp` (+73 -0) 📝 `src/host/ut_host/ConptyOutputTests.cpp` (+28 -0) 📝 `src/inc/TestUtils.h` (+6 -2) 📝 `src/renderer/vt/paint.cpp` (+7 -4) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:36:22 +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#29695