Hard reset disables win32-input-mode #19996

Open
opened 2026-01-31 07:00:00 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (May 27, 2023).

Windows Terminal version

1.18.1421.0

Windows build number

10.0.19045.2913

Other Software

No response

Steps to reproduce

  1. Start Windows Terminal.
  2. Open up a WSL bash shell with the debug tap enabled.
  3. Press some keys and note the escape sequences that are generated in the debug pane.
  4. Execute reset.
  5. Press some more keys and note what is generated in the debug pane now.

Expected Behavior

I'd expected to see win32-input-mode escape sequences for every key press.

Actual Behavior

After the reset, win32-input-mode is disabled, and the key presses are just passed through as ASCII, or basic VT100 escape for things like arrow keys.

I think this was a regression introduced in PR #14444 when I made the RIS operation fully reset all input modes. Technically that was the right thing to do, but for conpty to work correctly, it would now also need to re-request any non-default modes it needs from the conpty client.

I'm not sure how best to fix this. The HardReset implementation can't just return false to pass through the RIS sequence anymore. It would probably need to call a new "reset" method in the renderer that the VT engine would pass on as an RIS with additional mode requests. It must also then return true to prevent the state machine trying to pass through the RIS a second time.

I don't know if anyone has any better ideas.

Originally created by @j4james on GitHub (May 27, 2023). ### Windows Terminal version 1.18.1421.0 ### Windows build number 10.0.19045.2913 ### Other Software _No response_ ### Steps to reproduce 1. Start Windows Terminal. 2. Open up a WSL bash shell with the debug tap enabled. 3. Press some keys and note the escape sequences that are generated in the debug pane. 4. Execute `reset`. 5. Press some more keys and note what is generated in the debug pane now. ### Expected Behavior I'd expected to see win32-input-mode escape sequences for every key press. ### Actual Behavior After the reset, win32-input-mode is disabled, and the key presses are just passed through as ASCII, or basic VT100 escape for things like arrow keys. I think this was a regression introduced in PR #14444 when I made the `RIS` operation fully reset all input modes. Technically that was the right thing to do, but for conpty to work correctly, it would now also need to re-request any non-default modes it needs from the conpty client. I'm not sure how best to fix this. The `HardReset` implementation can't just return false to pass through the `RIS` sequence anymore. It would probably need to call a new "reset" method in the renderer that the VT engine would pass on as an `RIS` with additional mode requests. It must also then return true to prevent the state machine trying to pass through the `RIS` a second time. I don't know if anyone has any better ideas.
claunia added the Issue-BugIn-PRArea-VTNeeds-Tag-FixProduct-Conpty labels 2026-01-31 07:00:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19996