claude-code - 💡(How to fix) Fix Ctrl+K (clear input) is adjacent to Ctrl+J (newline) — easy to accidentally wipe prompt

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Problem

Ctrl+K clears the current input line, and Ctrl+J submits (newline/enter). These are adjacent keys, making it easy to accidentally clear a long prompt you were composing — with no undo.

Why it matters

  • No undo for cleared input
  • Ctrl+K is a standard readline binding for "kill to end of line" (not "clear screen"), so the current behavior is also inconsistent with readline expectations
  • Risk is higher when typing quickly or on keyboards where K and J are close

Suggested fix

Either:

  1. Remap Ctrl+K to its standard readline meaning (kill to end of line, not full clear), or
  2. Add an undo buffer (Ctrl+Z or Ctrl+_) to restore the last cleared input, or
  3. Require a confirmation or a less common key combo for the destructive clear action

Environment

Claude Code CLI

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Ctrl+K (clear input) is adjacent to Ctrl+J (newline) — easy to accidentally wipe prompt