[PR #15026] Fix DECCRA when copying from a double-width line #30355

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

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

State: closed
Merged: Yes


When a DECCRA operation is copying content that spans a double width
line, it's possible that some range of the bounding rectangle will be
off-screen, and that range is not supposed to be copied. However, the
code checking for off-screen positions was using incorrect coordinates,
so we would mistakenly copy content that shouldn't be copied, and drop
content that should have been copied. This PR fixes that.

References and Relevant Issues

This was a regression introduced in PR #14650 when fixing an issue with
horizontal scrolling of DBCS characters.

Validation Steps Performed

I manually verified this fixes the test case in #15019, and I've also
added a unit test that replicates that case.

Closes #15019

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15026 **State:** closed **Merged:** Yes --- When a `DECCRA` operation is copying content that spans a double width line, it's possible that some range of the bounding rectangle will be off-screen, and that range is not supposed to be copied. However, the code checking for off-screen positions was using incorrect coordinates, so we would mistakenly copy content that shouldn't be copied, and drop content that should have been copied. This PR fixes that. ## References and Relevant Issues This was a regression introduced in PR #14650 when fixing an issue with horizontal scrolling of DBCS characters. ## Validation Steps Performed I manually verified this fixes the test case in #15019, and I've also added a unit test that replicates that case. Closes #15019
claunia added the pull-request label 2026-01-31 09:40:17 +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#30355