Prevent panes from shrinking below 2x2 cells - #20564
Open
zhangxaochen wants to merge 2 commits into
Open
Conversation
A 1-column reflow of a wide glyph hangs in TextBuffer::Reflow (GH#19996). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Leonard Hecker (lhecker)
requested changes
Aug 20, 2026
Leonard Hecker (lhecker)
left a comment
Member
There was a problem hiding this comment.
This misses GetProposedDimensions and its std::max. I'm not sure if there are more places.
GetProposedDimensions and UserResize still allowed a 1-cell viewport, which is the GH#19996 hang path.
Author
|
Leonard Hecker (@lhecker) Thanks — I missed those.
Left alone on purpose:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Raise the visible terminal minimum from 1×1 cells to 2×2 cells so a pane or window can no longer reach a 1-column viewport (keyboard, mouse,
split-pane,wt --size,initialCols/initialRows, or VT resize).This is a mitigation. It closes the hang for users, but does not fix
TextBuffer::Reflowwhen a 2-column glyph is copied into a 1-column row.TextBufferstill accepts a 1-column size; Cascadia no longer asks for one.Closes #19996.
References and Relevant Issues
ROW::_uncheckedIsTrailer→ROW::_adjustForward→ROW::WriteHelper::Finish→ROW::CopyTextFrom→TextBuffer::Reflow("resizing a 2-column glyph to a single column with reflow explodes the terminal")
resizePaneXAML layout. The splitter can still reach 1 cell, so the hang remains.DECSTBMheight ≥ 2,DECSLRMwidth ≥ 2).Detailed Description of the Pull Request / Additional comments
Shared floor is
MINIMUM_VISIBLE_CELLS(2) inDefaultSettings.h.TermControl::MinimumSize/GetProposedDimensions/GetNewDimensionsControlCorecreate and_refreshSizeUnderLock(theUserResizehang path)Terminal::Create/CreateFromSettings/UserResizeHwndTerminalinitialCols/initialRowsclamp and the Launch page minimumPane::_GetMinSize/_ClampSplitPosition/_CalcSnappedDimension/PreCalculateCanSplitstill consumeMinimumSize(), so pane resize stays covered.Left alone on purpose:
TextBuffer/ conhost 1×1 — remaining Reflow root-causeConptyConnection/AppHostmax(..., 1)— PTY size and pixel clamps, not cell countsASCII-only panes already survived a 1-cell clamp. Wide glyphs (CJK, emoji, starship prompts) did not.
Validation Steps Performed
WindowsTerminalDev) and Store 1.24.11911 withecho 音楽🎵测试in view, then shrink the left pane to the stop.TextBuffer::Reflow←Terminal::UserResize←ControlCore::_refreshSizeUnderLock←TermControl::_SwapChainSizeChanged. Render thread blocked on the same console lock.echo hello) stopped at minimum width and stayed responsive.PR Checklist
ScreenSizeLimitsTestnow expects the 2-cell floor.DeserializationTestsclampsinitialRows: -1000000to 2.