[PR #4197] [MERGED] Move reflowing the buffer to TextBuffer #25679

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4197
Author: @zadjii-msft
Created: 1/13/2020
Status: Merged
Merged: 1/14/2020
Merged by: @undefined

Base: masterHead: dev/migrie/f/ResizeWithReflow-001


📝 Commits (3)

  • b5c8c85 let's first move reflowing to the text buffer
  • 9aec694 add a doc comment because I'm not a barbarian
  • c510d12 Hopefully this fixes SA

📊 Changes

3 files changed (+228 additions, -207 deletions)

View changed files

📝 src/buffer/out/textBuffer.cpp (+222 -0)
📝 src/buffer/out/textBuffer.hpp (+2 -0)
📝 src/host/screenInfo.cpp (+4 -207)

📄 Description

Summary of the Pull Request

In pursuit of reflowing the terminal buffer on resize, move the reflow algorithm to the TextBuffer. This does not yet add support for reflowing in the Windows Terminal.

References

#4200 I suppose

PR Checklist

  • There's not really an issue for this yet, I'm just breaking this work up into as many PRs as possible to help the inevitable bisect.
  • I work here
  • Ideally, all the existing tests will pass
  • [n/a] Requires documentation to be updated

Detailed Description of the Pull Request / Additional comments

In SCREEN_INFORMATION::ResizeScreenBuffer, the screenbuffer needs to create a new buffer, and copy the contents of the old buffer into the new one. I'm moving that "copy contents from the old buffer to the new one" step to it's own helper, as a static function on TextBuffer. That way, when the time comes to implement this for the Terminal, the hard part of the code will already be there.

Validation Steps Performed

Ideally, all the tests will still pass.


🔄 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/4197 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 1/13/2020 **Status:** ✅ Merged **Merged:** 1/14/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/f/ResizeWithReflow-001` --- ### 📝 Commits (3) - [`b5c8c85`](https://github.com/microsoft/terminal/commit/b5c8c854cc2d0000a09672112dc20e6a98639713) let's first move reflowing to the text buffer - [`9aec694`](https://github.com/microsoft/terminal/commit/9aec69467cf72c536fca001abc4e82222012307e) add a doc comment because I'm not a barbarian - [`c510d12`](https://github.com/microsoft/terminal/commit/c510d125ce34617dc48be82f1a41654b44979c49) Hopefully this fixes SA ### 📊 Changes **3 files changed** (+228 additions, -207 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/textBuffer.cpp` (+222 -0) 📝 `src/buffer/out/textBuffer.hpp` (+2 -0) 📝 `src/host/screenInfo.cpp` (+4 -207) </details> ### 📄 Description ## Summary of the Pull Request In pursuit of reflowing the terminal buffer on resize, move the reflow algorithm to the TextBuffer. This does _not_ yet add support for reflowing in the Windows Terminal. ## References #4200 I suppose ## PR Checklist * [ ] There's not really an issue for this yet, I'm just breaking this work up into as many PRs as possible to help the inevitable bisect. * [x] I work here * [x] Ideally, all the existing tests will pass * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments In `SCREEN_INFORMATION::ResizeScreenBuffer`, the screenbuffer needs to create a new buffer, and copy the contents of the old buffer into the new one. I'm moving that "copy contents from the old buffer to the new one" step to it's own helper, as a static function on `TextBuffer`. That way, when the time comes to implement this for the Terminal, the hard part of the code will already be there. ## Validation Steps Performed Ideally, all the tests will still pass. --- <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:11:06 +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#25679