Prevent panes from shrinking below 2x2 cells - #20564
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Leonard Hecker (lhecker)
left a comment
There was a problem hiding this comment.
This misses GetProposedDimensions and its std::max. I'm not sure if there are more places.
|
Leonard Hecker (@lhecker) Thanks — I missed those.
Left alone on purpose:
|
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
......wat? Anyway, you (we?) must merge main into this branch. |
|
Merged main into this branch to clear the conflict. Launch.xaml kept the new SettingsExpander layout and the 2-cell minimum. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
|
Leonard Hecker (@lhecker) Dustin L. Howett (@DHowett) CI is green and this has an approval. Ready to merge whenever you have a moment. |
| constexpr int DEFAULT_COLS = 120; | ||
|
|
||
| // VT theoretical minimum (DECSTBM / DECSLRM). A 1-cell viewport can hang | ||
| // TextBuffer::Reflow on a wide glyph (GH#19996). |
There was a problem hiding this comment.
(Leonard Hecker (@lhecker) why would we merge this instead of just fixing the root cause?)
There was a problem hiding this comment.
If we fix the root cause, the wide glyphs get dropped entirely.
Any ideal fix would fix the root cause and also this.
A 1-column reflow of a wide glyph hangs in TextBuffer::Reflow (GH#19996).
GetProposedDimensions and UserResize still allowed a 1-cell viewport, which is the GH#19996 hang path.
00dd952 to
d3b6fe3
Compare
|
Removed the Cursor trailer and rebased onto latest main. I take full ownership of the changes in this PR. On the root-cause question: this PR is the first cut from #19996 (stop 1-cell resize). |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
e7a68df
into
microsoft:main

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.