[PR #1267] [MERGED] The InputStateMachine should dispatch Intermediate characters #24557

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/1267
Author: @zadjii-msft
Created: 6/14/2019
Status: ✅ Merged
Merged: 6/14/2019
Merged by: @zadjii-msft

Base: master ← Head: dev/migrie/b/1209-alt-intermediate-conpty


📝 Commits (4)

📊 Changes

8 files changed (+102 additions, -2 deletions)

View changed files

📝 OpenConsole.sln (+3 -0)
📝 src/terminal/parser/IStateMachineEngine.hpp (+1 -0)
📝 src/terminal/parser/InputStateMachineEngine.cpp (+13 -0)
📝 src/terminal/parser/InputStateMachineEngine.hpp (+1 -0)
📝 src/terminal/parser/OutputStateMachineEngine.cpp (+12 -0)
📝 src/terminal/parser/OutputStateMachineEngine.hpp (+1 -0)
📝 src/terminal/parser/stateMachine.cpp (+10 -2)
📝 src/terminal/parser/ut_parser/InputEngineTest.cpp (+61 -0)

📄 Description

Summary of the Pull Request

The OutputStateMachine needs to collect "Intermediate" characters to be able to call Designate G0 Character Set (as well as other sequences we don't yet support).

However, the InputStateMachine used by conpty to process input should not collect these characters. The input engine uses \x1b as an indicator that a key was pressed with Alt. For keys like /, we want to dispatch the key immediately, instead of collecting it and leaving us in the Escape state.

PR Checklist


🔄 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/1267 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 6/14/2019 **Status:** ✅ Merged **Merged:** 6/14/2019 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `master` ← **Head:** `dev/migrie/b/1209-alt-intermediate-conpty` --- ### 📝 Commits (4) - [`e672f6a`](https://github.com/microsoft/terminal/commit/e672f6a8aa162249da5478f4c9a6e7b171b8622e) Add a test for this case - [`3c7c666`](https://github.com/microsoft/terminal/commit/3c7c666dcaeea566d2485cf1172e1611e2c69840) Fix this bug - [`1581efd`](https://github.com/microsoft/terminal/commit/1581efd03d01746975b1eddcbbe5668e260d8178) Add more commenting to this test - [`84394b3`](https://github.com/microsoft/terminal/commit/84394b30defe00205e55bb433711db054b3856cf) runformat ### 📊 Changes **8 files changed** (+102 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `OpenConsole.sln` (+3 -0) 📝 `src/terminal/parser/IStateMachineEngine.hpp` (+1 -0) 📝 `src/terminal/parser/InputStateMachineEngine.cpp` (+13 -0) 📝 `src/terminal/parser/InputStateMachineEngine.hpp` (+1 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.cpp` (+12 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.hpp` (+1 -0) 📝 `src/terminal/parser/stateMachine.cpp` (+10 -2) 📝 `src/terminal/parser/ut_parser/InputEngineTest.cpp` (+61 -0) </details> ### 📄 Description ## Summary of the Pull Request The OutputStateMachine needs to collect "Intermediate" characters to be able to call [`Designate G0 Character Set`](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Controls-beginning-with-ESC) (as well as other sequences we don't yet support). However, the InputStateMachine used by conpty to process input should _not_ collect these characters. The input engine uses `\x1b` as an indicator that a key was pressed with `Alt`. For keys like `/`, we want to dispatch the key immediately, instead of collecting it and leaving us in the Escape state. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #1209 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [x] I've discussed this with core contributors already. --- <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:03:59 +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#24557