[PR #11658] [MERGED] Default all G-sets to ASCII unless ISO-2022 is requested #28698

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11658
Author: @j4james
Created: 10/30/2021
Status: Merged
Merged: 11/3/2021
Merged by: @undefined

Base: mainHead: default-ascii-gsets


📝 Commits (1)

  • d42c05b Set all G-sets to ASCII by default.

📊 Changes

1 file changed (+15 additions, -3 deletions)

View changed files

📝 src/terminal/adapter/terminalOutput.cpp (+15 -3)

📄 Description

Summary of the Pull Request

There is a non-zero subset of applications that randomly output Locking Shift escape sequences which will invoke a character set from G2 or G3 into the left half of the code table. If those G-sets are mapped to Latin1, that can result in the terminal producing output that appears to be broken. This PR now defaults all G-sets to ASCII, to prevent an unintentional Locking Shift from having any effect.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Most other modern terminals also default to ASCII in all G-sets, so this shouldn't break any modern applications. Legacy 8-bit applications may still expect the G2 and G3 sets mapped to Latin1, but they would also need to have the ISO-2022 encoding enabled, so we can keep them happy by setting G2 and G3 correctly when the ISO-2022 encoding is requested.

Validation Steps Performed

I've manually confirmed that echo -e "\en" and echo -e "\eo" no longer have any visible effect on the output (at least without first invoking another character set into G2 or G3). I've also confirmed that they do still work as expected (i.e. selecting Latin1) after enabling the ISO-2022 encoding.


🔄 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/11658 **Author:** [@j4james](https://github.com/j4james) **Created:** 10/30/2021 **Status:** ✅ Merged **Merged:** 11/3/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `default-ascii-gsets` --- ### 📝 Commits (1) - [`d42c05b`](https://github.com/microsoft/terminal/commit/d42c05bc28413ca62584ebe78980a3bde1b27f76) Set all G-sets to ASCII by default. ### 📊 Changes **1 file changed** (+15 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/terminal/adapter/terminalOutput.cpp` (+15 -3) </details> ### 📄 Description ## Summary of the Pull Request There is a non-zero subset of applications that randomly output _Locking Shift_ escape sequences which will invoke a character set from G2 or G3 into the left half of the code table. If those G-sets are mapped to Latin1, that can result in the terminal producing output that appears to be broken. This PR now defaults all G-sets to ASCII, to prevent an unintentional _Locking Shift_ from having any effect. ## PR Checklist * [x] Closes #10408 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [x] I've discussed this with core contributors already. Issue number where discussion took place: #10408 ## Detailed Description of the Pull Request / Additional comments Most other modern terminals also default to ASCII in all G-sets, so this shouldn't break any modern applications. Legacy 8-bit applications may still expect the G2 and G3 sets mapped to Latin1, but they would also need to have the ISO-2022 encoding enabled, so we can keep them happy by setting G2 and G3 correctly when the ISO-2022 encoding is requested. ## Validation Steps Performed I've manually confirmed that `echo -e "\en"` and `echo -e "\eo"` no longer have any visible effect on the output (at least without first invoking another character set into G2 or G3). I've also confirmed that they do still work as expected (i.e. selecting Latin1) after enabling the ISO-2022 encoding. --- <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:30:12 +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#28698