Skip to content

Preserve rows below partial scroll regions#10

Open
jchristn wants to merge 3 commits into
tomlm:mainfrom
jchristn:fix/top-anchored-scroll-region
Open

Preserve rows below partial scroll regions#10
jchristn wants to merge 3 commits into
tomlm:mainfrom
jchristn:fix/top-anchored-scroll-region

Conversation

@jchristn

@jchristn jchristn commented Jun 2, 2026

Copy link
Copy Markdown

Summary

  • Treat only full-screen scroll regions as eligible for scrollback promotion
  • Keep top-anchored partial scroll regions in-place so rows below the bottom margin are preserved
  • Use active-buffer coordinates for IL / CSI Ps L and DL / CSI Ps M when normal-buffer scrollback exists
  • Ignore DL / CSI Ps M when the cursor is outside the scroll region, matching IL
  • Add regression tests covering reserved bottom prompt/status rows

Why

Prompt-oriented terminal applications can reserve a bottom input/status row while scrolling output above it. A top-anchored partial scroll region must not promote the reserved row into scrollback.

The same visual artifact can occur after normal-buffer scrollback exists if insert/delete-line operations splice using viewport-relative ScrollBottom rather than YBase + ScrollBottom. In that case old scrollback rows can be edited instead of the active screen, allowing prompt/status content such as > or > to reappear higher in the viewport.

DL also needs the same scroll-region guard as IL; delete-line operations outside the active scroll region should be ignored so reserved prompt/status rows are not shifted.

Tests

  • dotnet test src\XTerm.NET.slnx

@jchristn jchristn marked this pull request as ready for review June 2, 2026 04:58
@jchristn jchristn force-pushed the fix/top-anchored-scroll-region branch from c193f32 to 2532dce Compare June 2, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant