[PR #4947] Fix VT sequences for Ctrl+Alt+? input #26048

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Ctrl+/ and Ctrl-? are complicated in VT input.

  • C-/ is supposed to be ^_ (the C0 character US)
  • C-? is supposed to be DEL
  • C-M-/ is supposed to be ^[^_ (ESC US)
  • C-M-? is supposed to be ^[^? (ESC DEL)

The astute reader will note that these characters also share the same key on a
standard en-us keyboard layout, which makes the problem even more complicated.
This PR does a better job of handling these weird cases.

References

  • #3079 - At first, I thought this PR would close this issue, but as I've learned below, this won't solve that one. This bug was merely found during that investigation.

PR Checklist

Validation Steps Performed

  • ran tests
  • checked showkey -a in gnome-terminal, which gives you the wrong results for C-M-/, C-M-?
  • checked showkey -a in xterm, which gives you the right results for C-M-/, C-M-?
  • checked showkey -a in conhost
  • checked showkey -a in Windows Terminal
**Original Pull Request:** https://github.com/microsoft/terminal/pull/4947 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Ctrl+/ and Ctrl-? are complicated in VT input. * C-/ is supposed to be `^_` (the C0 character US) * C-? is supposed to be `DEL` * C-M-/ is supposed to be `^[^_` (ESC US) * C-M-? is supposed to be `^[^?` (ESC DEL) The astute reader will note that these characters also share the same key on a standard en-us keyboard layout, which makes the problem even more complicated. This PR does a better job of handling these weird cases. # References * #3079 - At first, I thought this PR would close this issue, but as I've learned below, this won't solve that one. This bug was merely found during that investigation. ## PR Checklist * [x] Related to #3079 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed * ran tests * checked `showkey -a` in gnome-terminal, which gives you the wrong results for C-M-/, C-M-? * checked `showkey -a` in xterm, which gives you the _right_ results for C-M-/, C-M-? * checked `showkey -a` in conhost * checked `showkey -a` in Windows Terminal
claunia added the pull-request label 2026-01-31 09:13:36 +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#26048