[PR #15171] Fix a hang when writing wide glyphs into a 1 column terminal #30478

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

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

State: closed
Merged: Yes


The code changes are mostly self-explanatory: Just skip glyphs
that can never be inserted. I implemented it slightly incorrectly
(a newline will be inserted every time you write such a wide glyph),
but it's a niche issue and I think the simplicity of the fix is
more important than its exact correctness.

It also contains a fix for some severe log spam due to
_PrepareForDoubleByteSequence complaining in this situation.
The spam is so bad that it freezes the app for a few seconds
during text buffer reflow.

Closes #7416

Validation Steps Performed

  • Open an extra pane and run TerminalStress.exe in there
  • Resize to 1 column
  • Doesn't hang
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15171 **State:** closed **Merged:** Yes --- The code changes are mostly self-explanatory: Just skip glyphs that can never be inserted. I implemented it slightly incorrectly (a newline will be inserted every time you write such a wide glyph), but it's a niche issue and I think the simplicity of the fix is more important than its exact correctness. It also contains a fix for some severe log spam due to `_PrepareForDoubleByteSequence` complaining in this situation. The spam is so bad that it freezes the app for a few seconds during text buffer reflow. Closes #7416 ## Validation Steps Performed * Open an extra pane and run `TerminalStress.exe` in there * Resize to 1 column * Doesn't hang ✅
claunia added the pull-request label 2026-01-31 09:41:03 +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#30478