[PR #15630] WIP: Pass through VT input unmodified #30688

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

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

State: closed
Merged: No


⚠️ This is just an idea for discussion. What do you all think about this?

This cannot be merged as is, because I modified Terminal::_systemMode, but I actually need to transmit the DISABLE_NEWLINE_AUTO_RETURN flag from the conhost side properly. I don't know how to do that and only after I do, this can be merged.

This follows a different approach than the original. Instead of splitting the console API into a non-VT and VT style implementation via an interface and virtual dispatch, this one will focus on using if/else conditions. Most importantly, it hooks into WriteChars() to bypass the VtEngine renderer and send the given input directly to the ConPTY client. This ensures we preserve the VT input as-is and improves throughput ~7x.

My hope is that in the future we don't disable VtEngine, but rather enable it for all console APIs individually and flush it before returning from the console call. Then we can work towards reimplementing each such console API in terms of VT sequences if ConPTY is enabled (i.e. using if() and early returns).

This still doesn't work 100% with pwsh. It doubles each typed character and then only removes every second character when backspacing. I can't quite figure out what's going on.

Validation Steps Performed

TBD

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15630 **State:** closed **Merged:** No --- ⚠️ This is just an idea for discussion. What do you all think about this? ❌ This cannot be merged as is, because I modified `Terminal::_systemMode`, but I actually need to transmit the `DISABLE_NEWLINE_AUTO_RETURN` flag from the conhost side properly. I don't know how to do that and only after I do, this can be merged. This follows a different approach than the original. Instead of splitting the console API into a non-VT and VT style implementation via an interface and virtual dispatch, this one will focus on using if/else conditions. Most importantly, it hooks into `WriteChars()` to bypass the `VtEngine` renderer and send the given input directly to the ConPTY client. This ensures we preserve the VT input as-is and improves throughput ~7x. My hope is that in the future we don't disable `VtEngine`, but rather enable it for all console APIs individually and flush it before returning from the console call. Then we can work towards reimplementing each such console API in terms of VT sequences if ConPTY is enabled (i.e. using `if()` and early returns). This still doesn't work 100% with pwsh. It doubles each typed character and then only removes every second character when backspacing. I can't quite figure out what's going on. ## Validation Steps Performed TBD
claunia added the pull-request label 2026-01-31 09:42:21 +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#30688