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

Alt arrow keys on numpad transmit extra characters in conhost #16508

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

Alt arrow keys on numpad transmit extra characters in conhost #16508

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

Commit 63c3573

Windows build number

10.0.19045.3803

Other Software

No response

Steps to reproduce

  1. Open a WSL bash shell in conhost or OpenConsole.
  2. Make sure NumLock is off.
  3. Run showkey -a
  4. Press Alt+RightArrow on the numeric keypad.

Expected Behavior

You should just see the VT escape squence for Alt+RightArrow:

^[[1;3C          27 0033 0x1b
         91 0133 0x5b
         49 0061 0x31
         59 0073 0x3b
         51 0063 0x33
         67 0103 0x43

Actual Behavior

The escape sequence is followed by an extra character, so it looks like this:

^[[1;3C          27 0033 0x1b
         91 0133 0x5b
         49 0061 0x31
         59 0073 0x3b
         51 0063 0x33
         67 0103 0x43
♠       226 0342 0xe2
        153 0231 0x99
        160 0240 0xa0

The problem is that the combination of the Alt key with a digit on the numeric keyboard causes it to be interpreted as an Alt-Numpad input, in addition to the VT key sequence. So when the Alt key is released, it transmits character 6 (the RightArrow digit) in codepage 437, namely .

This is similar to issue #3101, only that was in Windows Terminal, and I think the underlying cause is possibly different.

@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