Fix Shift+Backspace deleting a word instead of a character#11563
Fix Shift+Backspace deleting a word instead of a character#11563TylerBuilds-Official wants to merge 1 commit into
Conversation
On Windows, winit's text_with_all_modifiers() returns 0x08 (Ctrl+H) for Shift+Backspace, which readline-style TUIs interpret as backward-kill-word. Add a fallback in to_escape_sequence that emits DEL (0x7f) for unmodified and shift-only backspace. Fixes warpdotdev#11342
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @TylerBuilds-Official on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
|
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Overview
This PR changes legacy terminal keystroke encoding so unmodified and Shift+Backspace emit DEL (0x7f) before falling back to platform-provided text, and adds a regression test for plain Backspace and Shift+Backspace.
Concerns
- The implementation looks aligned with the linked bug and no security concerns were found in the changed lines.
- For this user-facing terminal behavior change, please include screenshots or a short screen recording demonstrating it working end to end. The PR description checks the screenshots box, but the
Screenshots / Videossection is empty.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Description
On Windows, Shift+Backspace in TUIs running inside Warp (Claude Code, fish, ipython, psql, etc.) deletes an entire word instead of a single character. Root cause:
winit'stext_with_all_modifiers()returns0x08(Ctrl+H) for Shift+Backspace on Windows, which readline-style line editors universally bind tobackward-kill-word. Every other terminal tested on Windows (WezTerm, Windows Terminal, vanilla PowerShell, bash) emits0x7f(DEL) for both plain and Shift+Backspace.Fix adds a fallback to
to_escape_sequenceincrates/warp_terminal/src/model/escape_sequences.rsthat emits DEL forbackspacewhen no earlier branch in the chain claims it. Guarded to unmodified or shift-only keystrokes so Ctrl/Alt/Cmd+Backspace continue to flow through their existing paths untouched.Linked Issue
Fixes #11342
ready-to-specorready-to-implement.Testing
Added regression test
test_shift_backspace_emits_del_sequenceinescape_sequences_tests.rsasserting bothbackspaceandshift-backspacekeystrokes producevec![C0::DEL]viato_escape_sequence. Before the fix, both fail (the chain returnsNoneand the caller falls back to OS-provided chars, which is0x08for Shift+Backspace on Windows). After the fix, both pass.Byte-level evidence captured before opening this PR (script + outputs in #11342):
Warp before fix: Backspace →
0x7f, Shift+Backspace →0x08Warp after fix: Backspace →
0x7f, Shift+Backspace →0x7fWezTerm (same machine, same OS):
0x7ffor both, matching the new Warp behaviorI have manually tested my changes locally with
./script/runScreenshots / Videos
Before the fix:
Holding shift and pressing backspace:

After the fix:

Holding shift and pressing backspace:

Agent Mode
CHANGELOG-BUG-FIX: Fix Shift+Backspace deleting a whole word instead of one character on Windows