[PR #12719] [MERGED] Don't reflow the alt buffer on resize #29204

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12719
Author: @zadjii-msft
Created: 3/18/2022
Status: ✅ Merged
Merged: 4/15/2022
Merged by: @undefined

Base: main ← Head: dev/migrie/b/3493-no-wrap-alt-buffer


📝 Commits (10+)

  • 83466a4 I think this is the conhost half of the changes
  • e94e08c This quite nearly implements everything for the Terminal half
  • dd702c7 Most of the remaining todos, comments
  • 1209fa4 one last comment
  • bf24cdd more comments are always good
  • dff1b94 spel
  • 60d2c2e fix tests
  • 57280d8 I think this does the whole thing
  • d08d216 defer main buffer resizes till we exit, to try and prevent flashing in conpty. That didn't work, unfortunately
  • 6529579 deferred resizing both in the Terminal and the ConPTY

📊 Changes

10 files changed (+513 additions, -113 deletions)

View changed files

📝 src/cascadia/TerminalCore/Terminal.cpp (+74 -78)
📝 src/cascadia/TerminalCore/Terminal.hpp (+3 -0)
📝 src/cascadia/TerminalCore/TerminalApi.cpp (+9 -2)
📝 src/cascadia/TerminalCore/TerminalSelection.cpp (+4 -4)
📝 src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp (+168 -0)
📝 src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp (+53 -0)
📝 src/host/screenInfo.cpp (+83 -29)
📝 src/host/screenInfo.hpp (+4 -0)
📝 src/host/ut_host/ScreenBufferTests.cpp (+113 -0)
📝 src/renderer/vt/vtrenderer.hpp (+2 -0)

📄 Description

VTE only rewraps the contents of the (normal screen + its scrollback
buffer) on a resize event. It doesn't rewrap the contents of the
alternate screen. The alternate screen is used by applications which
repaint it after a resize event. So, it doesn't really matter. However,
in that short time window, after resizing the terminal but before the
application catches up, this prevents vertical lines

It was really hard to get a gif of this where it happened and was small
enough to upload to GH, but there is one in #12719.

There's something in this branch that fixes a scrolling issue in the
parent PR. I'm partially filing this so I can look at the diffs here and
try and figure out what that is. I kinda want to just take all 3 alt
buffer PRs as a single atomic unit, but splitting them up made sense
from a review standpoint.

Closes #3493


🔄 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/12719 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 3/18/2022 **Status:** ✅ Merged **Merged:** 4/15/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/3493-no-wrap-alt-buffer` --- ### 📝 Commits (10+) - [`83466a4`](https://github.com/microsoft/terminal/commit/83466a4381f897e18a822ddc084ddd7d44872669) I think this is the conhost half of the changes - [`e94e08c`](https://github.com/microsoft/terminal/commit/e94e08c303cd60d86919426105ca3c81e2744221) This quite nearly implements everything for the Terminal half - [`dd702c7`](https://github.com/microsoft/terminal/commit/dd702c769dab6ae261e971ee76ac0530f5a60416) Most of the remaining todos, comments - [`1209fa4`](https://github.com/microsoft/terminal/commit/1209fa40c307be9d3856a8f7440ee654361e613d) one last comment - [`bf24cdd`](https://github.com/microsoft/terminal/commit/bf24cdd4b05091e151b2474f73390438c8f0c96c) more comments are always good - [`dff1b94`](https://github.com/microsoft/terminal/commit/dff1b94016651324ad0a50f9bd32b27369deb684) spel - [`60d2c2e`](https://github.com/microsoft/terminal/commit/60d2c2e26dbfc9497fbb7f03045b3dc93123046a) fix tests - [`57280d8`](https://github.com/microsoft/terminal/commit/57280d8961b11a8dc841b4fd684dcf6e39d34893) I think this does the whole thing - [`d08d216`](https://github.com/microsoft/terminal/commit/d08d21626fe9104b6a907318b7f977af3531ba98) defer main buffer resizes till we exit, to try and prevent flashing in conpty. That didn't work, unfortunately - [`6529579`](https://github.com/microsoft/terminal/commit/65295796f2aa5a5e5a4fcd62fd65679d07b8bb33) deferred resizing both in the Terminal and the ConPTY ### 📊 Changes **10 files changed** (+513 additions, -113 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+74 -78) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+3 -0) 📝 `src/cascadia/TerminalCore/TerminalApi.cpp` (+9 -2) 📝 `src/cascadia/TerminalCore/TerminalSelection.cpp` (+4 -4) 📝 `src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp` (+168 -0) 📝 `src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp` (+53 -0) 📝 `src/host/screenInfo.cpp` (+83 -29) 📝 `src/host/screenInfo.hpp` (+4 -0) 📝 `src/host/ut_host/ScreenBufferTests.cpp` (+113 -0) 📝 `src/renderer/vt/vtrenderer.hpp` (+2 -0) </details> ### 📄 Description VTE only rewraps the contents of the (normal screen + its scrollback buffer) on a resize event. It doesn't rewrap the contents of the alternate screen. The alternate screen is used by applications which repaint it after a resize event. So, it doesn't really matter. However, in that short time window, after resizing the terminal but before the application catches up, this prevents vertical lines It was really hard to get a gif of this where it happened and was small enough to upload to GH, but there is one in #12719. There's something in this branch that fixes a scrolling issue in the parent PR. I'm partially filing this so I can look at the diffs here and try and figure out what that is. I kinda want to just take all 3 alt buffer PRs as a single atomic unit, but splitting them up made sense from a review standpoint. Closes #3493 --- <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:33:29 +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#29204