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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13039
Author: @j4james
Created: 5/5/2022
Status: Merged
Merged: 5/5/2022
Merged by: @undefined

Base: mainHead: fix-setviewportposition


📝 Commits (1)

  • 0867b10 Don't change the viewport position when in the alt buffer.

📊 Changes

1 file changed (+7 additions, -3 deletions)

View changed files

📝 src/cascadia/TerminalCore/TerminalApi.cpp (+7 -3)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13039 **Author:** [@j4james](https://github.com/j4james) **Created:** 5/5/2022 **Status:** ✅ Merged **Merged:** 5/5/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `fix-setviewportposition` --- ### 📝 Commits (1) - [`0867b10`](https://github.com/microsoft/terminal/commit/0867b10cf24ea6bdb66c28b55a789b913267b71f) Don't change the viewport position when in the alt buffer. ### 📊 Changes **1 file changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalCore/TerminalApi.cpp` (+7 -3) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:34:22 +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#29347