[PR #13039] Stop the viewport being moved when in the alt buffer #29352

Open
opened 2026-01-31 09:34:23 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/13039

State: closed
Merged: Yes


Summary of the Pull Request

When TerminalDispatch was merged with AdaptDispatch in PR #13024,
that broke the Terminal's EraseAll operation in the alt buffer. The
problem was that the EraseAll implementation makes a call to
SetViewportPosition which wasn't taking the alt buffer into account,
and thus modified the main viewport instead.

This PR corrects that mistake. If we're in the alt buffer, the
SetViewportPosition method now does nothing, since the alt buffer
viewport should always be at 0,0.

References

This was a regression introduced in PR #13024.

PR Checklist

Validation Steps Performed

I've confirmed that the test case reported in issue #13038 is no longer
failing. I've also made sure the ED 2 and ED 3 sequences are still
working correctly in the main buffer.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/13039 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request When `TerminalDispatch` was merged with `AdaptDispatch` in PR #13024, that broke the Terminal's `EraseAll` operation in the alt buffer. The problem was that the `EraseAll` implementation makes a call to `SetViewportPosition` which wasn't taking the alt buffer into account, and thus modified the main viewport instead. This PR corrects that mistake. If we're in the alt buffer, the `SetViewportPosition` method now does nothing, since the alt buffer viewport should always be at 0,0. ## References This was a regression introduced in PR #13024. ## PR Checklist * [x] Closes #13038 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [x] I've discussed this with core contributors already. Issue number where discussion took place: #13038 ## Validation Steps Performed I've confirmed that the test case reported in issue #13038 is no longer failing. I've also made sure the `ED 2` and `ED 3` sequences are still working correctly in the main buffer.
claunia added the pull-request label 2026-01-31 09:34:23 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29352