claude-code - 💡(How to fix) Fix Backspace/Ctrl+Backspace keys reversed in CLI on Windows PowerShell [1 participants]

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…
GitHub stats
anthropics/claude-code#51841Fetched 2026-04-23 07:43:30
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

On Windows 11 PowerShell, Claude Code CLI has reversed backspace behavior:

  • Pressing Backspace deletes an entire word (should delete one character)
  • Pressing Ctrl+Backspace deletes one character (should delete a word)

This is the opposite of standard terminal behavior and PSReadLine's correct keybindings.

Environment:

  • Platform: Windows 11 Pro
  • Shell: PowerShell
  • PSReadLine keybindings: Correct (verified with Get-PSReadLineKeyHandler)
    • Backspace is mapped to BackwardDeleteChar ✓
    • Ctrl+Backspace is mapped to BackwardKillWord ✓

Issue appears to be in Claude Code CLI's input handler on Windows, not the shell configuration.

extent analysis

TL;DR

The issue may be resolved by adjusting the input handler in Claude Code CLI to correctly interpret Backspace and Ctrl+Backspace key presses on Windows 11.

Guidance

  • Verify that the issue is indeed specific to Claude Code CLI by testing Backspace and Ctrl+Backspace in a standard PowerShell prompt to confirm the expected behavior.
  • Investigate the input handler implementation in Claude Code CLI to identify where the key press events are being processed and corrected.
  • Check for any platform-specific code paths in the input handler that might be causing the reversed behavior on Windows 11.
  • Consider temporarily using a different terminal or shell to isolate if the issue is specific to PowerShell or a more general problem with Claude Code CLI on Windows.

Notes

The provided information suggests the issue lies within Claude Code CLI's input handling on Windows, but without access to the codebase, it's challenging to provide a precise fix. The problem does not seem to be related to PSReadLine keybindings, as they are correctly configured.

Recommendation

Apply workaround: Given the issue appears to be specific to Claude Code CLI's input handler on Windows, and without a clear indication of a version fix, applying a workaround or fix directly to the input handler code seems most appropriate. This could involve modifying how key press events are interpreted to match standard terminal behavior.

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 Backspace/Ctrl+Backspace keys reversed in CLI on Windows PowerShell [1 participants]