[PR #7340] Preprocess and convert C1 controls to their 7 bit equivalent #26901

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

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

State: closed
Merged: Yes


C1 control characters are now first converted to their 7 bit equivalent.
This allows us to unify the logic of C1 and C0 escape handling. This
also adds support for SOS/PM/APC string.

  • Unify the logic for C1 and C0 escape handling by converting C1 to C0
    beforehand. This adds support for various C1 characters, including
    IND(8/4), NEL(8/5), HTS(8/8), RI(8/13), SS2(8/14), SS3(8/15),
    OSC(9/13), etc.
  • Add support for SOS/PM/APC escape sequences. Fixes #7032
  • Use "Variable Length String" logic to unify the string termination
    handling of OSC, DCS and SOS/PM/APC. This fixes an issue where OSC
    action is successfully dispatched even when terminated with non-ST
    character. Introduced by #6328, the DCS PassThrough is spared from
    this issue. This PR puts them together and add test cases for them.

References:
https://vt100.net/docs/vt510-rm/chapter4.html
https://vt100.net/emu/dec_ansi_parser

Closes #7032
Closes #7317

**Original Pull Request:** https://github.com/microsoft/terminal/pull/7340 **State:** closed **Merged:** Yes --- C1 control characters are now first converted to their 7 bit equivalent. This allows us to unify the logic of C1 and C0 escape handling. This also adds support for SOS/PM/APC string. * Unify the logic for C1 and C0 escape handling by converting C1 to C0 beforehand. This adds support for various C1 characters, including IND(8/4), NEL(8/5), HTS(8/8), RI(8/13), SS2(8/14), SS3(8/15), OSC(9/13), etc. * Add support for SOS/PM/APC escape sequences. Fixes #7032 * Use "Variable Length String" logic to unify the string termination handling of OSC, DCS and SOS/PM/APC. This fixes an issue where OSC action is successfully dispatched even when terminated with non-ST character. Introduced by #6328, the DCS PassThrough is spared from this issue. This PR puts them together and add test cases for them. References: https://vt100.net/docs/vt510-rm/chapter4.html https://vt100.net/emu/dec_ansi_parser Closes #7032 Closes #7317
claunia added the pull-request label 2026-01-31 09:18:48 +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#26901