[PR #16352] Fix ConPTY inputs incorrectly being treated as plain text #30906

Closed
opened 2026-01-31 09:43:44 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


This is my proposal to avoid aborting ConPTY input parsing because a read accidentally got split up into more than one chunk. This happens a lot with WSL for me, as I often get (for instance) a \x1b[67;46;99;0;32; input followed immediately by a 1_ input. The current logic would cause both of these to be flushed out to the client application.

This PR fixes the issue by only flushing either a standalone escape character or a escape+character combination. It basically limits the previous code to just VTStates::Ground and VTStates::Escape.

I'm not using the _state member, because VTStates::OscParam makes no distinction between \x1b] and \x1b]1234 and I only want to flush the former. I felt like checking the contents of run directly is easier to understand.

Related to #16343

Validation Steps Performed

  • win32-input-mode sequences are now properly buffered
  • Standalone alt-key combinations are still being flushed
**Original Pull Request:** https://github.com/microsoft/terminal/pull/16352 **State:** closed **Merged:** Yes --- This is my proposal to avoid aborting ConPTY input parsing because a read accidentally got split up into more than one chunk. This happens a lot with WSL for me, as I often get (for instance) a `\x1b[67;46;99;0;32;` input followed immediately by a `1_` input. The current logic would cause both of these to be flushed out to the client application. This PR fixes the issue by only flushing either a standalone escape character or a escape+character combination. It basically limits the previous code to just `VTStates::Ground` and `VTStates::Escape`. I'm not using the `_state` member, because `VTStates::OscParam` makes no distinction between `\x1b]` and `\x1b]1234` and I only want to flush the former. I felt like checking the contents of `run` directly is easier to understand. Related to #16343 ## Validation Steps Performed * win32-input-mode sequences are now properly buffered ✅ * Standalone alt-key combinations are still being flushed ✅
claunia added the pull-request label 2026-01-31 09:43:44 +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#30906