terminal
terminal copied to clipboard
Add support for selective erase operations
Description of the new feature/enhancement
I'd like to add support for the selective erase escape sequences: DECSED, DECSEL, and DECSCA. They provide a way of marking certain areas of the screen as "protected", and then you can easily erase all but the protected areas.
They were typically used in data entry applications, where you'd have a form with static content like the labels that you'd want protected. Then when you needed to reset the form, you could just clear the whole screen (with DECSED), and you wouldn't have to redraw those protected areas of the UI.
I could also see them being useful in certain gaming situations, where you might have a static background (e.g. the maze walls in Pac-Man), which you'd want to protect. Then you could easily clear out all the non-static sprites with DECSED, without losing the static background.
However, the main reason I wanted to add them was as a precursor to doing the rectangular area operations, since once of those (DECSERA) is dependent on protected attributes.
Proposed technical implementation details (optional)
We need another bit in the ExtendedAttributes enum to hold the protected status of each cell, an operation to enable and disable that bit in the active attributes (this is DECSCA), and variants of the EraseInDisplay and EraseInLine methods that only erase the cells that don't have the protected bit set.
Wow! I had no idea these existed. Heck yeah.
:tada:This issue was addressed in #14046, which has now been successfully released as Windows Terminal Preview v1.17.1023.:tada:
Handy links: