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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4947
Author: @zadjii-msft
Created: 3/16/2020
Status: Merged
Merged: 3/18/2020
Merged by: @undefined

Base: masterHead: dev/migrie/b/3079-C-M-questionmark


📝 Commits (4)

📊 Changes

2 files changed (+98 additions, -6 deletions)

View changed files

📝 src/terminal/adapter/ut_adapter/inputTest.cpp (+29 -0)
📝 src/terminal/input/terminalInput.cpp (+69 -6)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4947 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 3/16/2020 **Status:** ✅ Merged **Merged:** 3/18/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/b/3079-C-M-questionmark` --- ### 📝 Commits (4) - [`313c329`](https://github.com/microsoft/terminal/commit/313c329bed03176b00c0be18872a6f7c8d687f00) Fix VT sequences for Ctrl+Alt+? input - [`6b22fa4`](https://github.com/microsoft/terminal/commit/6b22fa452eab594b6bfb639a6de2e8699342547d) Update src/terminal/input/terminalInput.cpp - [`015e2f4`](https://github.com/microsoft/terminal/commit/015e2f44ee905ec6540c42233e71c7c8c789e0fe) Fix sequences in response to @j4james's comment - [`f032ccf`](https://github.com/microsoft/terminal/commit/f032ccf1a8bcda6469d8cb8349606292a63fa319) Merge branch 'dev/migrie/b/3079-C-M-questionmark' of https://github.com/Microsoft/Terminal into dev/migrie/b/3079-C-M-questionmark ### 📊 Changes **2 files changed** (+98 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/terminal/adapter/ut_adapter/inputTest.cpp` (+29 -0) 📝 `src/terminal/input/terminalInput.cpp` (+69 -6) </details> ### 📄 Description ## 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:13:34 +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#26043