Skip to content

Control key modifier chords interpreted incorrectly when using custom keyboard layout #13319

@cheryllium

Description

@cheryllium

Windows Terminal version

1.13.11431.0

Windows build number

10.0.19044.0

Other Software

NOTE: I've also reproduced the issue in a separate environment using Ubuntu 20.04 in WSL v1.

Steps to reproduce

Prerequisite: set up environment

  1. Install Programmer Dvorak using linked binary and add it to your keyboard layouts so that it can be enabled as you wish.
  2. Install WSL with wsl --install and install Ubuntu 22.04 from the Microsoft store

Reproduce the issue

I will give two examples of the problem. However, these are not the only cases where behavior is incorrect. I thought this may be sufficient for now, but if more examples would be helpful, let me know and I'll spend some time compiling a longer list.

  1. Open Windows Terminal tab into Ubuntu WSL
  2. Make sure you are in Programmer Dvorak keyboard layout.
  3. Run showkey -a which will allow you to type on the keyboard. It will display information about the keys typed in real time.

Example 1:

  1. Type ] (on physical QWERTY keyboards, hit the 0 key)
  2. Type Ctrl + ] (press same key while holding Ctrl)

Example 2:

  1. Type [ (on physical QWERTY keyboards, hit the 2 key)
  2. Type Ctrl + [ (press same key while holding Ctrl)

Expected Behavior

$ showkey -a

Press any keys - Ctrl-D will terminate this program

[        91 0133 0x5b
^[       27 0033 0x1b
]        93 0135 0x5d
^]       29 0035 0x1d

When the control key is held, it should display ^ followed by the key that was pressed, as above.

Actual Behavior

$ showkey -a

Press any keys - Ctrl-D will terminate this program

[        91 0133 0x5b
^_       31 0037 0x1f
]        93 0135 0x5d
^^       30 0036 0x1e

In this output, it shows Windows Terminal interprets Ctrl + [ as Ctrl + _, and interprets Ctrl + ] as Ctrl + ^ instead.

I considered this could be an issue with Programmer Dvorak, WSL, or otherwise. But after some testing, I think it is a Windows Terminal bug because:

  • I get expected behavior in multiple Linux-only environments I have tried
  • I get expected behavior in Windows Command Prompt, which implies Programmer Dvorak is getting interpreted correctly by Windows itself (so, it is working correctly on the OS level)

I am more than happy to gather/provide further information within my capabilities, clarify anything in this report, and help out as much as I can to debug and fix this problem.
I am currently attempting to set up a development environment to try and debug this further, but I have no experience with this project or Windows application development, so realistically I won't be able to help implement a fix at this time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-InputRelated to input processing (key presses, mouse, etc.)Help 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-ConptyFor console issues specifically related to conptyProduct-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions