[PR #15075] [MERGED] Filter out control characters that don't do anything #30383

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15075
Author: @j4james
Created: 3/30/2023
Status: Merged
Merged: 4/5/2023
Merged by: @zadjii-msft

Base: mainHead: fix-control-chars


📝 Commits (4)

  • a0459a0 Filter out control characters that don't do anything.
  • 899f772 Extend the NUL unit test to cover other control characters.
  • d20f295 Add "answerback" to dictionary.
  • 0554777 Update src/terminal/parser/OutputStateMachineEngine.cpp

📊 Changes

3 files changed (+44 additions, -19 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+1 -0)
📝 src/host/ut_host/ScreenBufferTests.cpp (+23 -14)
📝 src/terminal/parser/OutputStateMachineEngine.cpp (+20 -5)

📄 Description

On a real VT terminal, most of the control characters that don't do
anything are supposed to be filtered out, and not written to the buffer.
Up to to now, though, we've only been filtering out NUL. This PR
extends our control processing to filter the remaining characters that
aren't supposed to be displayed.

We introduced filtering for the NUL control in PR #3015.

The are two special cases worth mentioning.

  1. The SUB control's main purpose is to the cancel a control sequence
    that is in progress, but it also needs to output an error character (a
    reverse question mark) to the display.

  2. The DEL control is typically filtered out, but when a 96-character
    set is designated, it can sometimes be mapped to a printable glyph that
    needs to be displayed.

Validation Steps Performed

I've manually tested that all the controls that are meant to be filtered
out are no longer being displayed.

I've also extended the existing NUL unit test to cover the full set of
controls characters that are supposed to be filtered.

Closes #10786


🔄 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/15075 **Author:** [@j4james](https://github.com/j4james) **Created:** 3/30/2023 **Status:** ✅ Merged **Merged:** 4/5/2023 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `fix-control-chars` --- ### 📝 Commits (4) - [`a0459a0`](https://github.com/microsoft/terminal/commit/a0459a0c5c40f9348b64fb75034a4b6d5cfb8a37) Filter out control characters that don't do anything. - [`899f772`](https://github.com/microsoft/terminal/commit/899f772a9c075384b0bd7a20add68196ef1c8531) Extend the NUL unit test to cover other control characters. - [`d20f295`](https://github.com/microsoft/terminal/commit/d20f295ed4436a5504caf86928cf5ffb5d637479) Add "answerback" to dictionary. - [`0554777`](https://github.com/microsoft/terminal/commit/0554777b5699eb74c00131fc8a6ea2ceadc7da32) Update src/terminal/parser/OutputStateMachineEngine.cpp ### 📊 Changes **3 files changed** (+44 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+1 -0) 📝 `src/host/ut_host/ScreenBufferTests.cpp` (+23 -14) 📝 `src/terminal/parser/OutputStateMachineEngine.cpp` (+20 -5) </details> ### 📄 Description On a real VT terminal, most of the control characters that don't do anything are supposed to be filtered out, and not written to the buffer. Up to to now, though, we've only been filtering out `NUL`. This PR extends our control processing to filter the remaining characters that aren't supposed to be displayed. We introduced filtering for the `NUL` control in PR #3015. The are two special cases worth mentioning. 1. The `SUB` control's main purpose is to the cancel a control sequence that is in progress, but it also needs to output an error character (a reverse question mark) to the display. 2. The `DEL` control is typically filtered out, but when a 96-character set is designated, it can sometimes be mapped to a printable glyph that needs to be displayed. ## Validation Steps Performed I've manually tested that all the controls that are meant to be filtered out are no longer being displayed. I've also extended the existing `NUL` unit test to cover the full set of controls characters that are supposed to be filtered. Closes #10786 --- <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:29 +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#30383