[BUG] Japanese IME: editing mid-text duplicates trailing characters

Resolved 💬 2 comments Opened Mar 7, 2026 by tokyoweb3 Closed Apr 5, 2026

Description

When typing Japanese text in the Claude Code CLI prompt and moving the cursor back to insert characters mid-text, the trailing characters after the cursor get duplicated/overwritten based on the number of characters typed.

Steps to Reproduce

  1. Open Claude Code CLI
  2. Type Japanese text, e.g. あああいいいえええ
  3. Move the cursor to just before えええ
  4. Start typing ううう

Expected Behavior

The text should become あああいいいうううえええ — the new characters are inserted at the cursor position without affecting trailing text.

Actual Behavior

  • Typing ううう (3 chars) results in the text becoming えええ — the trailing characters overwrite the input
  • Typing うううう (4 chars) results in うえええ — only the character exceeding the trailing text length appears, followed by the duplicated trailing text

The duplication pattern appears to correlate with the relationship between the number of inserted characters and the number of trailing characters after the cursor.

Environment

  • OS: macOS (Sonoma 14+)
  • Terminal: macOS default Terminal / iTerm2
  • IME: macOS built-in Japanese IME
  • Claude Code version: latest

Related Issues

  • #1547 (IME input causes performance issues and duplicate conversion candidates)
  • #19207 (IME cursor position support for CJK input)
  • #1306 (Japanese input UX improvements)

View original on GitHub ↗

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