-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Terminal reports no longer work in Vttest #14208
Comments
OK it seems the problem is that vttest disables We can probably fix this by checking both the virtual key code and the char data when determining whether we've got a repeated key. I'll give that a try now. Hopefully that won't have any unwanted side effects. |
It's actually less complicated that I thought. The fact that all the generated key presses appear to be the same shouldn't be a problem. They always include both a press and release event, so that wouldn't typically be recognised as a repeat. The problem is that we're using a 0 virtual key code to indicate the "clean" state (i.e. when nothing has been pressed). That shouldn't normally match anything, since it's not a valid VK value, but in this case it does. So I guess the solution is to use another value for the clean state - maybe 0xFFFF. |
There's always our trusty friend, |
Yeah, that's a good idea. I was trying to keep things simple but that shouldn't add too much overhead, and feels a lot safer than making another assumption about an unused VK value. |
The way `DECARM` was initially implemented, we checked for repeated key presses by matching the last recorded virtual key code, and used a 0 key code to indicate that no key was pressed. This caused the VT query responses to fail, because they generated key events with a 0 key code, and that would end up being detected as a repeated key that should be suppressed. This PR fixes that issue by using a `std::optional` to track the last key code, so if no key has been pressed we can represent that with `std::nullopt`, and there's no way that can be confused with a genuine key press. The `DECARM` mode was introduced in PR #13981. ## Validation Steps Performed I've manually tested in Vttest to confirm that the query reports are now working again, even when `DECARM` is disabled. I've also checked that `DECARM` itself it still working as expected. Closes #14208
🎉This issue was addressed in #14216, which has now been successfully released as Handy links: |
Windows Terminal version
Commit cacf668
Windows build number
10.0.19044.2006
Other Software
Vttest
Steps to reproduce
vttest
.Expected Behavior
The report received from the terminal should be:
Actual Behavior
In conhost it only seems to receive the initial
ESC
character, while in Terminal it receives nothing at all. And it's not justDA
- other reports fail in a similar way.I think this regression was caused by the recent
DECARM
merge (PR #13981), but I have no idea why. I'm still investigating.The weird thing is that it works correctly in all of my own tests and applications. There's just something about the way vttest is reading the input that is causing it to fail.
The text was updated successfully, but these errors were encountered: