[PR #4671] Clip text to within the row we expect #25887

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Adjusts DrawGlyphRun method inside DirectX renderer to restrict text
to be clipped within the boundaries of the row.

PR Checklist

Detailed Description of the Pull Request / Additional comments

For whatever reason, some of these shade glyphs near U+2591 tend to
extend way above the height of where we expect they should. This didn't
look like a problem in conhost because it clipped every draw inside the
bounds. This therefore applies the same clip logic as people don't
really expect text to pour out of the box.

It could, theoretically, get us into trouble later should someone
attempt zalgo text. But doing zalgo text is more of a silliness that
varies in behavior across rendering platforms anyway.

Validation Steps Performed

  • Ran the old conhost GDI renderer and observed
  • Ran the new Terminal DX renderer and observed
  • Made the code change
  • Observed that the height and approximate display characteristics of
    the U+2591 shade and neighboring characters now matches with the conhost
    GDI style to stay within its lane.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/4671 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Adjusts `DrawGlyphRun` method inside DirectX renderer to restrict text to be clipped within the boundaries of the row. ## PR Checklist * [x] Closes #1703 * [x] I work here. * [x] No tests. * [x] No docs. * [x] I am core contributor. ## Detailed Description of the Pull Request / Additional comments For whatever reason, some of these shade glyphs near U+2591 tend to extend way above the height of where we expect they should. This didn't look like a problem in conhost because it clipped every draw inside the bounds. This therefore applies the same clip logic as people don't really expect text to pour out of the box. It could, theoretically, get us into trouble later should someone attempt zalgo text. But doing zalgo text is more of a silliness that varies in behavior across rendering platforms anyway. ## Validation Steps Performed - Ran the old conhost GDI renderer and observed - Ran the new Terminal DX renderer and observed - Made the code change - Observed that the height and approximate display characteristics of the U+2591 shade and neighboring characters now matches with the conhost GDI style to stay within its lane.
claunia added the pull-request label 2026-01-31 09:12:26 +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#25887