feat: VT margins are meant to be tracked separetly for each page #19626
+136
−24
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.
Fix: Per-Page Scroll Margins (DECSTBM/DECSLRM)
Issue #19625
Scroll margins were tracked globally instead of per-page, causing margins set on one page to incorrectly affect other pages.
Bug Scenario:
Root Cause
_scrollMarginswas a single member variable inAdaptDispatch, shared across all pages. VT spec requires margins to be tracked per-page.Solution
1. Added Per-Page Storage (
PageManager.hpp/cpp)std::array<til::inclusive_rect, MAX_PAGES> _scrollMargins{}GetScrollMargins(pageNumber)andSetScrollMargins(pageNumber, margins)2. Updated Margin Management (
adaptDispatch.hpp/cpp)_scrollMarginsvariable_GetVerticalMargins()and_GetHorizontalMargins()to use page-specific margins_DoSetTopBottomScrollingMargins()and_DoSetLeftRightScrollingMargins()to store margins per-page3. Updated Tests (
adapterTest.cpp)ScrollMarginsTestto access margins via PageManagerPerPageScrollMarginsTestto verify page isolationFiles Modified
src/terminal/adapter/PageManager.hppsrc/terminal/adapter/PageManager.cppsrc/terminal/adapter/adaptDispatch.hppsrc/terminal/adapter/adaptDispatch.cppsrc/terminal/adapter/ut_adapter/adapterTest.cppResult
Each page now maintains independent scroll margins
Margins set on page 2 no longer affect page 1
Margins persist correctly when switching between pages
Complies with VT programmer's reference specification