Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VT mouse sequences don't work when DECARM is disabled #16510

Closed
j4james opened this issue Dec 31, 2023 · 0 comments · Fixed by #16511
Closed

VT mouse sequences don't work when DECARM is disabled #16510

j4james opened this issue Dec 31, 2023 · 0 comments · Fixed by #16511
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase

Comments

@j4james
Copy link
Collaborator

j4james commented Dec 31, 2023

Windows Terminal version

1.19.3172.0

Windows build number

10.0.19045.3803

Other Software

Vttest

Steps to reproduce

  1. Open a WSL shell in Windows Terminal.
  2. Run vttest.
  3. Select the Normal Mouse Tracking test (menu 11.8.5.4)
  4. Click somewhere in the terminal window.

Expected Behavior

You should see the mouse escape sequence starting with <27> [ M <32> output near the top of the page, and a 1 output wherever you've clicked.

Actual Behavior

Some of the characters in the mouse sequence are lost, so it starts with <27> <32>, and there is nothing output in the cell where you've clicked.

This is similar to the problem we had with the Device Attribute reports not working in vttest because it disables auto-repeat mode (#14208). But in this case the lost key events are coming from conpty passing the mouse sequences through TerminalInput::HandleKey, so it only affects Windows Terminal.

The fact that the mouse sequences are being treated as keypresses is already questionable, and I think that's likely the cause of #15083, but I also think HandleKey should be capable of accepting a sequence of key events with a 0 virtual key (as a form of input "passthrough"), without DECARM getting in the way.

So my proposed solution is this: before we even check for repeated keys, if we receive a key-down event, and the virtual key code is 0 or VK_PACKET (which serves a similar purpose), then we should immediately return the given UnicodeChar value as the HandleKey output.

@j4james j4james added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 31, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Dec 31, 2023
@zadjii-msft zadjii-msft added Product-Conhost For issues in the Console codebase Help Wanted We encourage anyone to jump in on these. Area-VT Virtual Terminal sequence support and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jan 3, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants