[PR #3935] [MERGED] Add Ctrl+Backspace support #25572

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3935
Author: @mkitzan
Created: 12/12/2019
Status: Merged
Merged: 1/13/2020
Merged by: @undefined

Base: masterHead: Ctrl+Backspace


📝 Commits (7)

  • f3e63d0 Adds Ctrl+Backspace support
  • f31e398 Changed key sequence needed to be updated in tests
  • d100fa3 Fix so test INPUT_RECORD is correct
  • 2fae701 Changed ^H to ctrl+bksp
  • ac19743 Minor changes
  • f98a5f5 Merge branch 'master' into Ctrl+Backspace
  • 4b1522d Fixed issues related to recent InputStateMachineEngine changes

📊 Changes

2 files changed (+8 additions, -2 deletions)

View changed files

📝 src/terminal/parser/InputStateMachineEngine.cpp (+4 -2)
📝 src/terminal/parser/ut_parser/InputEngineTest.cpp (+4 -0)

📄 Description

Summary of the Pull Request

Changes the Ctrl+Backspace input sequence and how it is processed by InputStateMachineEngine. Now Ctrl+Backspace deletes a whole word at a time on CMD and PS.

References

PR Checklist

  • Closes Fonts with programming ligatures show weird behavior (#755)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed -> made minor edits to tests
  • 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: #755

Detailed Description of the Pull Request / Additional comments

Changed the input sequence for Ctrl+Backspace to \x1b\x8 so the sequence would pass through _DoControlCharacter. Changed _DoControlCharacter to process \b in a way which forms the correct INPUT_RECORDs to delete whole words.

Validation Steps Performed

Ctrl+Backspace works 🎉


🔄 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/3935 **Author:** [@mkitzan](https://github.com/mkitzan) **Created:** 12/12/2019 **Status:** ✅ Merged **Merged:** 1/13/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `Ctrl+Backspace` --- ### 📝 Commits (7) - [`f3e63d0`](https://github.com/microsoft/terminal/commit/f3e63d03eb9916210ed63650f1ed54a96b4b945b) Adds Ctrl+Backspace support - [`f31e398`](https://github.com/microsoft/terminal/commit/f31e3988d510675e74360ed28f275fe4a1b0716e) Changed key sequence needed to be updated in tests - [`d100fa3`](https://github.com/microsoft/terminal/commit/d100fa3ba335d6310d657152336036ef3a2efc50) Fix so test INPUT_RECORD is correct - [`2fae701`](https://github.com/microsoft/terminal/commit/2fae7012e63b6e4df24e7fca1918a9c0827b5b28) Changed ^H to ctrl+bksp - [`ac19743`](https://github.com/microsoft/terminal/commit/ac1974368b6fdbbb77b7c2ed51baff51f570d3d9) Minor changes - [`f98a5f5`](https://github.com/microsoft/terminal/commit/f98a5f5014c03ef8bef30077c24716c6043006a7) Merge branch 'master' into Ctrl+Backspace - [`4b1522d`](https://github.com/microsoft/terminal/commit/4b1522d0332801736a75bb4cefe53f1e4a2525de) Fixed issues related to recent InputStateMachineEngine changes ### 📊 Changes **2 files changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/terminal/parser/InputStateMachineEngine.cpp` (+4 -2) 📝 `src/terminal/parser/ut_parser/InputEngineTest.cpp` (+4 -0) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Changes the <kbd>Ctrl+Backspace</kbd> input sequence and how it is processed by `InputStateMachineEngine`. Now <kbd>Ctrl+Backspace</kbd> deletes a whole word at a time on CMD and PS. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #755 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed -> made minor edits to tests * [ ] Requires documentation to be updated * [x] 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: #755 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments Changed the input sequence for <kbd>Ctrl+Backspace</kbd> to `\x1b\x8` so the sequence would pass through `_DoControlCharacter`. Changed `_DoControlCharacter` to process `\b` in a way which forms the correct `INPUT_RECORD`s to delete whole words. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed <kbd>Ctrl+Backspace</kbd> works 🎉 --- <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:10:22 +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#25572