[PR #14046] [MERGED] Add support for selective erase operations #29897

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14046
Author: @j4james
Created: 9/20/2022
Status: Merged
Merged: 10/7/2022
Merged by: @carlos-zamora

Base: mainHead: feature-selective-erase


📝 Commits (6)

  • f19599f Add support for the DECSCA sequence.
  • 4587f4d Report DECSCA state with DECRQSS.
  • 5b9f548 Add support for DECSED and DECSEL sequences.
  • 6d462be Extend units tests to cover selective erasure.
  • 78ec87d Add missing overrides.
  • 22b1296 Make the most of the til::rect bool operator.

📊 Changes

15 files changed (+350 additions, -19 deletions)

View changed files

📝 src/buffer/out/TextAttribute.cpp (+13 -2)
📝 src/buffer/out/TextAttribute.hpp (+2 -0)
📝 src/host/ut_host/ScreenBufferTests.cpp (+118 -13)
📝 src/inc/conattrs.hpp (+1 -1)
📝 src/terminal/adapter/DispatchTypes.hpp (+7 -0)
📝 src/terminal/adapter/ITermDispatch.hpp (+3 -0)
📝 src/terminal/adapter/adaptDispatch.cpp (+126 -3)
📝 src/terminal/adapter/adaptDispatch.hpp (+5 -0)
📝 src/terminal/adapter/adaptDispatchGraphics.cpp (+32 -0)
📝 src/terminal/adapter/termDispatch.hpp (+3 -0)
📝 src/terminal/adapter/ut_adapter/adapterTest.cpp (+15 -0)
📝 src/terminal/parser/OutputStateMachineEngine.cpp (+16 -0)
📝 src/terminal/parser/OutputStateMachineEngine.hpp (+3 -0)
📝 src/terminal/parser/telemetry.cpp (+3 -0)
📝 src/terminal/parser/telemetry.hpp (+3 -0)

📄 Description

This PR adds support for the selective erase escape sequences: DECSED,
DECSEL, and DECSCA. They provide a way of marking certain areas of
the screen as "protected", so you can erase the content everywhere else
without affecting those protected areas.

This adds another bit in the CharacterAttributes enum to track the
protected status of each cell, and an operation triggered by the
DECSCA sequence which can toggle that bit in the active attributes.

There there are two new erase operations triggered by the DECSED and
DECSEL sequences, which work similar to the existing ED (erase in
display) and EL (erase in line) operations, but which only apply to
unprotected cells.

I've also updated the DECRQSS settings request, so you can query the
active protected attribute status.

Validation Steps Performed

I've manually confirmed that we pass the selective erase tests in Vttest
now, and I've also manually tested some more complicated edge cases and
confirmed that we match the behavior of the hardware VT240 emulator in
MAME.

For unit testing I've extended the existing erase tests to cover
selective erase as an additional option, I've added a test covering the
DECSCA sequence, and I've extended the DECRQSS adapter test to
confirm the attribute reporting is working.

Closes #14029


🔄 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/14046 **Author:** [@j4james](https://github.com/j4james) **Created:** 9/20/2022 **Status:** ✅ Merged **Merged:** 10/7/2022 **Merged by:** [@carlos-zamora](https://github.com/carlos-zamora) **Base:** `main` ← **Head:** `feature-selective-erase` --- ### 📝 Commits (6) - [`f19599f`](https://github.com/microsoft/terminal/commit/f19599f51fece8d8dcdc9249f6b04fa1de6ae4c1) Add support for the DECSCA sequence. - [`4587f4d`](https://github.com/microsoft/terminal/commit/4587f4d005ab3f02ba424f2f850f8698e6c6d167) Report DECSCA state with DECRQSS. - [`5b9f548`](https://github.com/microsoft/terminal/commit/5b9f5485b74c8183ec39b0637c5c3976eee5b477) Add support for DECSED and DECSEL sequences. - [`6d462be`](https://github.com/microsoft/terminal/commit/6d462be66264f4148ece0d03ccab642cb267ecdb) Extend units tests to cover selective erasure. - [`78ec87d`](https://github.com/microsoft/terminal/commit/78ec87d5037a1693b9e04d336e934871543661e9) Add missing overrides. - [`22b1296`](https://github.com/microsoft/terminal/commit/22b1296bbcd8680f2447265b8237a1185eb7b177) Make the most of the til::rect bool operator. ### 📊 Changes **15 files changed** (+350 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/TextAttribute.cpp` (+13 -2) 📝 `src/buffer/out/TextAttribute.hpp` (+2 -0) 📝 `src/host/ut_host/ScreenBufferTests.cpp` (+118 -13) 📝 `src/inc/conattrs.hpp` (+1 -1) 📝 `src/terminal/adapter/DispatchTypes.hpp` (+7 -0) 📝 `src/terminal/adapter/ITermDispatch.hpp` (+3 -0) 📝 `src/terminal/adapter/adaptDispatch.cpp` (+126 -3) 📝 `src/terminal/adapter/adaptDispatch.hpp` (+5 -0) 📝 `src/terminal/adapter/adaptDispatchGraphics.cpp` (+32 -0) 📝 `src/terminal/adapter/termDispatch.hpp` (+3 -0) 📝 `src/terminal/adapter/ut_adapter/adapterTest.cpp` (+15 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.cpp` (+16 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.hpp` (+3 -0) 📝 `src/terminal/parser/telemetry.cpp` (+3 -0) 📝 `src/terminal/parser/telemetry.hpp` (+3 -0) </details> ### 📄 Description This PR adds support for the selective erase escape sequences: `DECSED`, `DECSEL`, and `DECSCA`. They provide a way of marking certain areas of the screen as "protected", so you can erase the content everywhere else without affecting those protected areas. This adds another bit in the `CharacterAttributes` enum to track the protected status of each cell, and an operation triggered by the `DECSCA` sequence which can toggle that bit in the active attributes. There there are two new erase operations triggered by the `DECSED` and `DECSEL` sequences, which work similar to the existing `ED` (erase in display) and `EL` (erase in line) operations, but which only apply to unprotected cells. I've also updated the `DECRQSS` settings request, so you can query the active protected attribute status. ## Validation Steps Performed I've manually confirmed that we pass the selective erase tests in Vttest now, and I've also manually tested some more complicated edge cases and confirmed that we match the behavior of the hardware VT240 emulator in MAME. For unit testing I've extended the existing erase tests to cover selective erase as an additional option, I've added a test covering the `DECSCA` sequence, and I've extended the `DECRQSS` adapter test to confirm the attribute reporting is working. Closes #14029 --- <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:37:30 +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#29897