[PR #15810] AtlasEngine: Fix ligature splitting for JetBrains Mono #30743

Closed
opened 2026-01-31 09:42:42 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


Some fonts implement ligatures by replacing a string like "&&" with
a whitespace padding glyph, followed by the actual "&&" glyph which
has a 1 column advance width. In that case the algorithm in
_drawTextOverlapSplit will get confused because it strictly scans
the input from left to right, searching for color changes.
The initial color is the glyph's color and so it breaks for such fonts
because then the first split will retain the last column's color.

Validation Steps Performed

  • Use JetBrains Mono
  • Print "`e[91m`&`e[96m&`e[m"
  • Red and blue & appear
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15810 **State:** closed **Merged:** Yes --- Some fonts implement ligatures by replacing a string like "&&" with a whitespace padding glyph, followed by the actual "&&" glyph which has a 1 column advance width. In that case the algorithm in `_drawTextOverlapSplit` will get confused because it strictly scans the input from left to right, searching for color changes. The initial color is the glyph's color and so it breaks for such fonts because then the first split will retain the last column's color. ## Validation Steps Performed * Use JetBrains Mono * Print ``"`e[91m`&`e[96m&`e[m"`` * Red and blue `&` appear ✅
claunia added the pull-request label 2026-01-31 09:42:42 +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#30743