Shift+Option+Backspace (kitty CSI 127;4u) deletes to end of line instead of a word
Summary
In the prompt input, with the kitty keyboard protocol active, Shift+Option+Delete (Shift+Alt+Backspace) deletes the entire rest of the line instead of doing a word-level delete. Claude Code appears to have no binding for the Shift+Alt+Backspace CSI-u sequence and falls back to kill-to-end-of-line.
Environment
- Claude Code:
2.1.209 - macOS:
26.5(build 25F71) - Reproduces in terminals that fully implement the kitty keyboard protocol (e.g. Orca
1.4.137). Does not reproduce in Cursor's integrated terminal, which falls back to legacy encoding (see below).
Steps to reproduce
- Run Claude Code in a terminal with full kitty-keyboard-protocol support.
- Type a few words in the prompt and place the cursor mid-line.
- Press
Shift+Option+Delete.
Expected
Word-level delete, same as Option+Delete.
Actual
Deletes everything to the end of the line (kill-to-end-of-line).
Byte-level evidence
Captured with a raw-mode reader that enables modifyOtherKeys + kitty progressive enhancement (\x1b[>4;2m\x1b[>1u) — i.e. the same modes Claude Code turns on. Kitty format is CSI <keycode> ; <modifier> u, where modifier = 1 + bitmask (Shift=1, Alt=2) and keycode 127 = Backspace:
| Keys | Full kitty terminal (Orca) | Cursor (partial kitty) |
|------|----------------------------|------------------------|
| Option+Delete | \x1b[127;3u (Alt+BS) → works (word delete) | \x17 (^W, legacy) → works |
| Shift+Option+Delete | \x1b[127;4u (Shift+Alt+BS) → broken (kills line) | \x1b[127;4u (identical bytes) |
The terminal encoding is standard and identical across terminals — Cursor emits the byte-identical \x1b[127;4u for this chord. The defect is that Claude Code does not map CSI 127;4u to a word delete. It works in Cursor only because Claude Code there stays in legacy mode and never receives the CSI-u form (it gets \x1b\x7f, which it handles).
Suggested fix
Treat modified-Backspace CSI-u sequences (CSI 127;<mod>u) as a word delete (matching Option+Delete / ^W) instead of falling through to kill-to-end-of-line.