Skip to content

Cmd+Backspace and Opt+Backspace silently dropped in Warp (kitty mode legacy-byte fallback needed in opentui) #25267

Closed as not planned

Description

@cogsovereign

Summary

When running opencode in Warp terminal, Cmd+Backspace and Opt+Backspace do nothing in the chat input box. They work as expected (delete-to-line-start / delete-word-backward) in Ghostty.

Root cause: Warp's kitty keyboard implementation is inconsistent — it sends legacy single-byte control codes (\x15, \x17) for Cmd/Opt+Backspace even when kitty mode is active, while sending CSI u sequences for plain Ctrl+U / Ctrl+W. opentui's parser, after negotiating kitty mode, appears to drop these legacy bytes for keys that should arrive as CSI u.

This is partly a Warp bug (filed at warpdotdev/Warp), but a robustness fix in opentui — accepting legacy bytes alongside CSI u in kitty mode — would unblock affected users immediately.

Reproduction

  1. Open Warp terminal (current stable, kitty keyboard protocol enabled)
  2. Run opencode (v1.14.31)
  3. In the chat input, type hello world test
  4. Press Cmd+Delete — nothing happens (expected: line cleared)
  5. Press Opt+Delete — nothing happens (expected: word deleted)
  6. Press Ctrl+U — line clears ✓
  7. Press Ctrl+W — word deletes ✓

Evidence

Captured the actual byte sequences Warp sends opencode (with kitty keyboard mode pushed via \x1b[>1u):

Cmd+Delete  → 15                              (legacy \x15, single byte)
Opt+Delete  → 17                              (legacy \x17, single byte)
Ctrl+U      → 1b 5b 31 31 37 3b 35 75        (= ESC[117;5u, kitty CSI u)
Ctrl+W      → 1b 5b 31 31 39 3b 35 75        (= ESC[119;5u, kitty CSI u)

Test script used:

cat > /tmp/keytest.py << 'PY'
import sys, tty, termios, os
sys.stdout.write('\x1b[>1u'); sys.stdout.flush()
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
    tty.setraw(fd)
    while True:
        c = os.read(fd, 1)
        sys.stdout.write('%02x ' % c[0]); sys.stdout.flush()
        if c == b'q': break
finally:
    termios.tcsetattr(fd, termios.TCSADRAIN, old)
    sys.stdout.write('\x1b[<u\r\n')
PY
python3 /tmp/keytest.py

Suggested fix

In opentui's keypress parser (packages/core/src/parse.keypress.ts per librarian analysis), when kitty mode is active, also accept legacy single-byte control codes as fallback:

  • \x15 → { name: "u", ctrl: true }
  • \x17 → { name: "w", ctrl: true }
  • \x1b\x7f → { name: "backspace", meta: true }

These already parse correctly in non-kitty mode. The fix is making sure kitty mode doesn't gate them out.

Environment

  • macOS
  • Warp terminal (stable, kitty support enabled)
  • opencode v1.14.31

Workarounds

  • Use Ctrl+U / Ctrl+W (works, sent as proper CSI u that opentui parses)
  • Use Ghostty (correctly encodes Cmd/Opt+Backspace as CSI u)

Related

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 1, 2026
  2. github-actions commented on May 1, 2026

    @github-actions
    Contributor

    This issue might be related to existing issues. Please check:

    For keybind-related issues, please also check our pinned keybinds documentation: #4997

  3. self-assigned this
    on May 1, 2026
  4. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  5. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions