Ctrl+W and word navigation broken for digits, punctuation, and non-Latin scripts

Resolved 💬 2 comments Opened Mar 24, 2026 by sswthrower Closed Apr 23, 2026

Description

Ctrl+W and other word-based navigation (Alt+Left/Right, Alt+Backspace) only recognize Latin letters as word characters. Digits, punctuation, and non-Latin scripts (Cyrillic, CJK, Arabic, Korean) are treated as non-word filler, causing word deletion to eat through them and into the preceding Latin-letter word.

Steps to Reproduce

  1. Type abc def hij 123 456 789 in the Claude Code input prompt
  2. Press Ctrl+W
  3. Expected: 789 is deleted, leaving abc def hij 123 456
  4. Actual: Everything from hij onward is deleted, leaving abc def

Root Cause

Claude Code's word boundary logic uses Intl.Segmenter with granularity: "word" and relies on the isWordLike property to identify words. The code itself is correct.

The problem is in Bun (Claude Code's embedded runtime). Node.js correctly returns isWordLike: true for digit segments:

{"segment":"abc","index":0,"isWordLike":true}
{"segment":" ","index":3,"isWordLike":false}
{"segment":"123","index":4,"isWordLike":true}

Bun apparently returns isWordLike: false for non-letter segments. Since prevWord() skips all non-word-like segments, Ctrl+W and other word-based navigation treat them as part of the preceding Latin-letter word and delete everything back to its start.

Suggested Fix

Something like /\w/.test(H.segment) instead of isWordLike would fix this regardless of the runtime's Intl.Segmenter implementation.

Prior Issues

This has been reported multiple times and closed each time without a fix:

  • #1943 - Word deletion doesn't work with non-latin alphabet
  • #2239 - Ctrl+W ignores non-Latin words
  • #2742 - Option+Delete incorrectly deletes multiple words in Korean input
  • #3015 - Ctrl+Backspace and Ctrl+Arrow issues with Cyrillic text
  • #10547 - Ctrl+Backspace deletes whole text with Japanese, Arabic, and Korean
  • #11997 - Alt-arrow word navigation broken with Cyrillic and non-Latin characters
  • #34505 - Ctrl+W deletes across space boundaries, eating multiple words

View original on GitHub ↗

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