Skip to content

Fix origin-mode cursor positioning#6

Open
jchristn wants to merge 2 commits into
tomlm:mainfrom
jchristn:fix/scroll-region-origin-mode
Open

Fix origin-mode cursor positioning#6
jchristn wants to merge 2 commits into
tomlm:mainfrom
jchristn:fix/scroll-region-origin-mode

Conversation

@jchristn
Copy link
Copy Markdown

Summary

This fixes DEC origin-mode cursor positioning with scroll regions:

  • DECSTBM / CSI t;b r now moves the cursor to home after setting the scroll region.
  • CUP / HVP (CSI row;col H / f) now treat row coordinates as relative to the scroll region when DECOM / origin mode is enabled.
  • VPA / CSI row d now applies the same origin-mode row translation.
  • enabling/disabling origin mode still homes the cursor, using the top margin when origin mode is enabled.

Why

Terminal UIs that reserve a bottom prompt/status row commonly set a scroll region for the output area and use origin-relative cursor addressing. Without these semantics, content can be written to the wrong absolute rows and preserved into scrollback incorrectly.

This is a core emulator behavior fix only. It intentionally does not include any host-rendering, PTY, ConPTY, or Termrig-specific compatibility shims.

Validation

  • dotnet test src\XTerm.NET.slnx --no-restore
  • Result: 589 passed, 0 failed

The test run still reports the existing compiler warnings about EscapeSequenceParser.Dcs and Terminal.HyperlinkChanged; this PR did not introduce new warnings.

@jchristn jchristn marked this pull request as ready for review June 1, 2026 01:01
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