Skip to content

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

@j4james

Description

@j4james

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsProduct-ConhostFor issues in the Console codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions