[PR #15476] Make sure RIS re-enables win32 input and focus events #30649

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

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

State: closed
Merged: Yes


When an RIS (hard reset) sequence is executed, ConHost will pass that
through to the connected conpty terminal, which results in all modes
being reset to their initial state. To work best, though, conpty needs
to have the win32 input mode enabled, as well as the focus event mode.
This PR addresses that by explicitly requesting the required modes after
an RIS is passed through.

Originally these modes were only set if the --win32input option was
given, but there is really no need for that, since terminals that don't
support them should simply ignore the request. To avoid that additional
complication, I've now removed the option (i.e. ConHost will now always
attempt to set the modes it needs).

I've manually confirmed that keypresses are still passed through with
win32 input sequences after a hard reset, and that focus events are
still being generated. I've also updated the existing conpty round-trip
test for RIS to confirm that it's now also passing through the mode
requests that it needs.

Closes #15461

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15476 **State:** closed **Merged:** Yes --- When an `RIS` (hard reset) sequence is executed, ConHost will pass that through to the connected conpty terminal, which results in all modes being reset to their initial state. To work best, though, conpty needs to have the win32 input mode enabled, as well as the focus event mode. This PR addresses that by explicitly requesting the required modes after an `RIS` is passed through. Originally these modes were only set if the `--win32input` option was given, but there is really no need for that, since terminals that don't support them should simply ignore the request. To avoid that additional complication, I've now removed the option (i.e. ConHost will now always attempt to set the modes it needs). I've manually confirmed that keypresses are still passed through with win32 input sequences after a hard reset, and that focus events are still being generated. I've also updated the existing conpty round-trip test for `RIS` to confirm that it's now also passing through the mode requests that it needs. Closes #15461
claunia added the pull-request label 2026-01-31 09:42:06 +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#30649