[PR #8870] Fix #8458: Handle all Ctrl-key combinations #27320

Open
opened 2026-01-31 09:21:18 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/8870

State: closed
Merged: Yes


Pressing Ctrl+\ produces ^\ using the US keyboard layout, thanks to Ctrl-key mappings inside the keyboard layout, whereas some layouts, like the UK extended layout, don't contain those. This causes the character value to be zero and previously caused no VT sequence to be generated under these situations. This PR employs MapVirtualKeyW to infer the missing characters.
As a side effect this PR effectively causes all major keys on the keyboard to produce Ctrl+combinations now.

PR Checklist

Validation Steps Performed

Compared all major keys in combination with Ctrl with the app store version of Terminal using showkey in WSL. All keys that previously worked still appear to continue to work.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8870 **State:** closed **Merged:** Yes --- Pressing Ctrl+\ produces `^\` using the US keyboard layout, thanks to Ctrl-key mappings inside the keyboard layout, whereas some layouts, like the UK extended layout, don't contain those. This causes the character value to be zero and previously caused no VT sequence to be generated under these situations. This PR employs `MapVirtualKeyW` to infer the missing characters. As a side effect this PR effectively causes _all_ major keys on the keyboard to produce Ctrl+combinations now. ## PR Checklist * [x] Closes #8458 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests passed ## Validation Steps Performed Compared all major keys in combination with Ctrl with the app store version of Terminal using `showkey` in WSL. All keys that previously worked still appear to continue to work.
claunia added the pull-request label 2026-01-31 09:21:18 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27320