Files
oh-my-pi/crates
roboomp 5bfad210a6 fix(tui): recognized Ghostty's super+alt+backspace as word delete
Ghostty on macOS reports Option+Backspace as kitty modifier 11
(wire) = 10 (mask) = super(8) | alt(2). The native key matcher only
recognised shift/ctrl/alt, so:

- format_kitty_key in crates/pi-natives/src/keys.rs rejected any
  sequence whose effective modifier had bits beyond shift/ctrl/alt
  set; parseKey returned undefined for \x1b[127;11u.
- parse_key_id recognised only those three modifiers, so even an
  explicit 'super+alt+backspace' degraded to 'alt+backspace' and
  could not match an actual super+alt encoded press.
- The editor's matchesKey(data, 'alt+backspace') branch was never
  reached and Option+Backspace either no-op'd or fell through to
  single-character delete.

Added a MOD_SUPER constant, taught parse_key_id, format_with_mods,
and format_kitty_key about the super bit, added super+alt+backspace
(and super+alt+delete / super+alt+d) to tui.editor.deleteWord*
defaults, and broadened the editor's direct matchesKey calls to
accept the super+alt variants. Existing alt+backspace / alt+d /
alt+delete paths are untouched, so the legacy ESC+DEL workaround
keeps working too.

Added Rust unit tests for the super modifier (positive and
negative for hyper/meta sequences we still drop) and TS
regressions in keys.test.ts and editor.test.ts that exercise
\x1b[127;11u end-to-end.

Fixes #2064
2026-06-07 16:17:29 +00:00
..