[PR #2235] Fixed Ctrl+Alt shortcuts conflicting with AltGr #24870

Closed
opened 2026-01-31 09:05:50 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


Summary of the Pull Request

This moves the detection of AltGr keypresses in front of the shortcut handling.
This allows one to have Ctrl+Alt shortcuts, while simultaneously being able to use the AltGr key for special characters.

References

This fixes a regression in v0.3.2142.0, which automatically creates Ctrl+Alt+[0-9] shortcuts for switching between tabs. These conflicted with the detection of the AltGr key. in SendKeyEvent().
Refixes #521.

PR Checklist

  • Closes #521, Closes Feature Request (#2254)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

This PR has the flaw that it doesn't allow one to define AltGr shortcuts anymore.
Considering that it's probably more important to get a fix out of the door quickly I personally see this as a minor flaw though. VS Code has the same "flaw" for instance and doesn't allow AltGr combinations either.
We could fix it more correctly later on, by modifying the IKeyBindings interface and KeyChord class.

Validation Steps Performed

  • Enter AltGr-characters on my german keyboard and ensuring they appear in my shell.
  • Ensure that Ctrl+Alt+[0-9] shortcuts simultaneously work.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/2235 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This moves the detection of AltGr keypresses in front of the shortcut handling. This allows one to have Ctrl+Alt shortcuts, while simultaneously being able to use the AltGr key for special characters. ## References This fixes a regression in v0.3.2142.0, which automatically creates `Ctrl+Alt+[0-9]` shortcuts for switching between tabs. These conflicted with the detection of the AltGr key. in `SendKeyEvent()`. Refixes #521. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #521, Closes #2254 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments This PR has the flaw that it doesn't allow one to define AltGr shortcuts anymore. Considering that it's probably more important to get a fix out of the door quickly I personally see this as a minor flaw though. VS Code has the same "flaw" for instance and doesn't allow AltGr combinations either. We could fix it more correctly later on, by modifying the `IKeyBindings` interface and `KeyChord` class. ## Validation Steps Performed * Enter AltGr-characters on my german keyboard and ensuring they appear in my shell. * Ensure that `Ctrl+Alt+[0-9]` shortcuts simultaneously work.
claunia added the pull-request label 2026-01-31 09:05:50 +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#24870