Expose `chat:deleteToLineStart` action — `Ctrl+U` clear-buffer breaks Mac `cmd+backspace`

Resolved 💬 2 comments Opened Apr 17, 2026 by peter-coulson Closed Apr 17, 2026

Summary

Ctrl+U in the chat input now clears the entire buffer (with Ctrl+Y to restore) instead of the standard Unix readline behavior of "kill to start of line." This breaks Mac cmd+backspace, which terminals translate to Ctrl+U.

Related to #3135 (locked), which raised the same concern for Ctrl+U in an earlier version.

Reproduction

  1. macOS + iTerm2 (reproducible in other terminals that translate cmd+backspaceCtrl+U)
  2. Open Claude Code chat input
  3. Type a multi-word message, position cursor mid-line
  4. Press cmd+backspace

Expected: Text from cursor to start of line is deleted (standard Mac / readline behavior).
Actual: Entire input buffer is cleared.

Why this matters

cmd+backspace → "delete to start of line" is a universal macOS text-editing convention, working in every native text field and most terminal apps. Claude Code is currently the exception. Users who rely on this shortcut lose it entirely inside Claude Code while it continues to work everywhere else on the OS.

Attempted workaround that doesn't work

Setting "ctrl+u": null in ~/.claude/keybindings.json under the Chat context has no effect — the clear-buffer handler appears to be hardcoded in the text input widget below the keybinding layer, so it can't be unbound or remapped from user config.

Proposed fix

Expose a chat:deleteToLineStart (or chat:killLine) action in the keybinding system. Users could then bind it to ctrl+u themselves, restoring the readline-compatible behavior without reverting the current Ctrl+U → clear-buffer behavior (which has its own UX merits with Ctrl+Y restore).

Environment

  • Claude Code: 2.1.112
  • OS: macOS
  • Terminal: iTerm2

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗