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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15026
Author: @j4james
Created: 3/21/2023
Status: Merged
Merged: 3/22/2023
Merged by: @zadjii-msft

Base: mainHead: fix-deccra-dwl


📝 Commits (2)

📊 Changes

2 files changed (+54 additions, -1 deletions)

View changed files

📝 src/host/ut_host/ScreenBufferTests.cpp (+52 -0)
📝 src/terminal/adapter/adaptDispatch.cpp (+2 -1)

📄 Description

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


🔄 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/15026 **Author:** [@j4james](https://github.com/j4james) **Created:** 3/21/2023 **Status:** ✅ Merged **Merged:** 3/22/2023 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `fix-deccra-dwl` --- ### 📝 Commits (2) - [`5c9faf2`](https://github.com/microsoft/terminal/commit/5c9faf2964abed6910f704280935c75828d91b8f) Fix offscreen test in DECCRA. - [`f814aeb`](https://github.com/microsoft/terminal/commit/f814aebaec9e31b2f6430c19ef07710031053685) Add a unit test. ### 📊 Changes **2 files changed** (+54 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/host/ut_host/ScreenBufferTests.cpp` (+52 -0) 📝 `src/terminal/adapter/adaptDispatch.cpp` (+2 -1) </details> ### 📄 Description 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 --- <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:40:16 +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#30350