[PR #15541] Move AdaptDispatch::_FillRect into TextBuffer #30666

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

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

State: closed
Merged: Yes


This commit makes 2 changes:

  • Expose dirty-range information from ROW::CopyTextFrom
    This will allow us to call TriggerRedraw, which is an aspect
    I haven't previously considered as something this API needs.
  • Add a FillRect API to TextBuffer and refactor AdeptDispatch
    to use that API. Even if we determine that the new text APIs are
    unfit (for instance too difficult to use), this will make it simpler
    to write efficient implementations right inside TextBuffer.

Since the new FillRect API lacks bounds checks the way WriteLine
has them, it breaks AdaptDispatch::_EraseAll which failed to adjust
the bottom parameter after scrolling the contents. This would result
in more rows being erased than intended.

Validation Steps Performed

  • chcp 65001
  • Launch pwsh
  • "`e[29483`$x" fills the viewport with cats
  • ResizeTraditional still doesn't work any worse than it used to
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15541 **State:** closed **Merged:** Yes --- This commit makes 2 changes: * Expose dirty-range information from `ROW::CopyTextFrom` This will allow us to call `TriggerRedraw`, which is an aspect I haven't previously considered as something this API needs. * Add a `FillRect` API to `TextBuffer` and refactor `AdeptDispatch` to use that API. Even if we determine that the new text APIs are unfit (for instance too difficult to use), this will make it simpler to write efficient implementations right inside `TextBuffer`. Since the new `FillRect` API lacks bounds checks the way `WriteLine` has them, it breaks `AdaptDispatch::_EraseAll` which failed to adjust the bottom parameter after scrolling the contents. This would result in more rows being erased than intended. ## Validation Steps Performed * `chcp 65001` * Launch `pwsh` * ``"`e[29483`$x"`` fills the viewport with cats ✅ * `ResizeTraditional` still doesn't work any worse than it used to ✅
claunia added the pull-request label 2026-01-31 09:42:11 +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#30666