[PR #13933] [MERGED] Pass through line rendition attributes over conpty #29829

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13933
Author: @j4james
Created: 9/6/2022
Status: Merged
Merged: 9/9/2022
Merged by: @undefined

Base: mainHead: conpty-line-rendition


📝 Commits (2)

  • 82c8029 Pass through line rendition attributes over conpty.
  • 0f727e0 Use CoordType for PrepareLineTransform parameters.

📊 Changes

12 files changed (+72 additions, -15 deletions)

View changed files

📝 src/renderer/atlas/AtlasEngine.cpp (+1 -1)
📝 src/renderer/atlas/AtlasEngine.h (+1 -1)
📝 src/renderer/base/RenderEngineBase.cpp (+2 -2)
📝 src/renderer/dx/DxRenderer.cpp (+2 -2)
📝 src/renderer/dx/DxRenderer.hpp (+2 -2)
📝 src/renderer/gdi/gdirenderer.hpp (+2 -2)
📝 src/renderer/gdi/state.cpp (+2 -2)
📝 src/renderer/inc/IRenderEngine.hpp (+1 -1)
📝 src/renderer/inc/RenderEngineBase.hpp (+2 -2)
📝 src/renderer/vt/paint.cpp (+51 -0)
📝 src/renderer/vt/state.cpp (+2 -0)
📝 src/renderer/vt/vtrenderer.hpp (+4 -0)

📄 Description

This PR introduces a mechanism for passing through line rendition
attributes to the conpty client, so we can support double-width and
double-height text in Windows Terminal.

Line renditions were first implemented in conhost (with the GDI
renderer) in PR #8664, and were implemented in the DX renderer in PR
#13102.

By default this won't add any additional overhead to the conpty output,
but as soon as there is any usage of double-size text, we switch to a
mode in which every line output will be prefixed with a line rendition
sequence. This is to ensure that the line attributes in the client
terminal are always in sync with the host.

Since this does add some overhead to the conpty output, we'd prefer not
to remain in this mode longer than necessary. So whenever there is a
full repaint of the entire viewport, we check to see if all of the lines
are single-width. If that is the case, we can then safely skip the line
rendition sequences in future updates.

One other small optimization is when the conpty update is only writing
out a single character (this is something we already check for). When
that is the case, we can safely skip the line rendition prefix, because
a single character update should never include a change of the line
rendition.

Validation Steps Performed

I've manually tested that Windows Terminal now passes the double-size
tests in Vttest, and also confirmed various edge cases are working
correctly in my own double-size tests.

Closes #11595


🔄 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/13933 **Author:** [@j4james](https://github.com/j4james) **Created:** 9/6/2022 **Status:** ✅ Merged **Merged:** 9/9/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `conpty-line-rendition` --- ### 📝 Commits (2) - [`82c8029`](https://github.com/microsoft/terminal/commit/82c80297956a00d47e5e3a7d3afbf1548905b648) Pass through line rendition attributes over conpty. - [`0f727e0`](https://github.com/microsoft/terminal/commit/0f727e0372469c20936bd26950a352a63015f051) Use CoordType for PrepareLineTransform parameters. ### 📊 Changes **12 files changed** (+72 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/atlas/AtlasEngine.cpp` (+1 -1) 📝 `src/renderer/atlas/AtlasEngine.h` (+1 -1) 📝 `src/renderer/base/RenderEngineBase.cpp` (+2 -2) 📝 `src/renderer/dx/DxRenderer.cpp` (+2 -2) 📝 `src/renderer/dx/DxRenderer.hpp` (+2 -2) 📝 `src/renderer/gdi/gdirenderer.hpp` (+2 -2) 📝 `src/renderer/gdi/state.cpp` (+2 -2) 📝 `src/renderer/inc/IRenderEngine.hpp` (+1 -1) 📝 `src/renderer/inc/RenderEngineBase.hpp` (+2 -2) 📝 `src/renderer/vt/paint.cpp` (+51 -0) 📝 `src/renderer/vt/state.cpp` (+2 -0) 📝 `src/renderer/vt/vtrenderer.hpp` (+4 -0) </details> ### 📄 Description This PR introduces a mechanism for passing through line rendition attributes to the conpty client, so we can support double-width and double-height text in Windows Terminal. Line renditions were first implemented in conhost (with the GDI renderer) in PR #8664, and were implemented in the DX renderer in PR #13102. By default this won't add any additional overhead to the conpty output, but as soon as there is any usage of double-size text, we switch to a mode in which every line output will be prefixed with a line rendition sequence. This is to ensure that the line attributes in the client terminal are always in sync with the host. Since this does add some overhead to the conpty output, we'd prefer not to remain in this mode longer than necessary. So whenever there is a full repaint of the entire viewport, we check to see if all of the lines are single-width. If that is the case, we can then safely skip the line rendition sequences in future updates. One other small optimization is when the conpty update is only writing out a single character (this is something we already check for). When that is the case, we can safely skip the line rendition prefix, because a single character update should never include a change of the line rendition. ## Validation Steps Performed I've manually tested that Windows Terminal now passes the double-size tests in _Vttest_, and also confirmed various edge cases are working correctly in my own double-size tests. Closes #11595 --- <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:37:07 +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#29829