[PR #14396] Clean up CodepointWidthDetector #30080

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

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

State: closed
Merged: Yes


My long-term plan is to replace the CodepointWidth enum with a simple integer
return value that indicates the amount of columns a codepoint is wide.
This is necessary so that we can return 0 for ZWJs (zero width joiners).

This initial commit represents a cleanup effort around CodepointWidthDetector.
Since less code runs faster, this change has the nice side-effect of running
roughly 5-10% faster across the board. It also drops the binary size by ~1.2kB.

Validation Steps Performed

  • CodepointWidthDetectorTests passes
  • U+26bf ("`u{26bf}" inside pwsh) is a wide glyph
    in OpenConsole and narrow one in Windows Terminal
**Original Pull Request:** https://github.com/microsoft/terminal/pull/14396 **State:** closed **Merged:** Yes --- My long-term plan is to replace the `CodepointWidth` enum with a simple integer return value that indicates the amount of columns a codepoint is wide. This is necessary so that we can return 0 for ZWJs (zero width joiners). This initial commit represents a cleanup effort around `CodepointWidthDetector`. Since less code runs faster, this change has the nice side-effect of running roughly 5-10% faster across the board. It also drops the binary size by ~1.2kB. ## Validation Steps Performed * `CodepointWidthDetectorTests` passes ✅ * U+26bf (``"`u{26bf}"`` inside pwsh) is a wide glyph in OpenConsole and narrow one in Windows Terminal ✅
claunia added the pull-request label 2026-01-31 09:38:32 +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#30080