[PR #4197] Move reflowing the buffer to TextBuffer #25684

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

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

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/4197 **State:** closed **Merged:** Yes --- ## 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.
claunia added the pull-request label 2026-01-31 09:11:07 +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#25684