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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15171
Author: @lhecker
Created: 4/12/2023
Status: Merged
Merged: 4/14/2023
Merged by: @lhecker

Base: mainHead: dev/lhecker/7416-wide-glyph-deadlock


📝 Commits (1)

  • d11f69c Fix a hang when writing wide glyphs into a 1 column terminal

📊 Changes

2 files changed (+16 additions, -12 deletions)

View changed files

📝 src/buffer/out/textBuffer.cpp (+0 -4)
📝 src/terminal/adapter/adaptDispatch.cpp (+16 -8)

📄 Description

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

🔄 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/15171 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 4/12/2023 **Status:** ✅ Merged **Merged:** 4/14/2023 **Merged by:** [@lhecker](https://github.com/lhecker) **Base:** `main` ← **Head:** `dev/lhecker/7416-wide-glyph-deadlock` --- ### 📝 Commits (1) - [`d11f69c`](https://github.com/microsoft/terminal/commit/d11f69cae7df45a4484cd14ea53d9c9aeec9c28e) Fix a hang when writing wide glyphs into a 1 column terminal ### 📊 Changes **2 files changed** (+16 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/textBuffer.cpp` (+0 -4) 📝 `src/terminal/adapter/adaptDispatch.cpp` (+16 -8) </details> ### 📄 Description 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 ✅ --- <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:41:01 +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#30473