claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Ctrl+E does not move cursor to end of line with Japanese/fullwidth characters

Open masakiaota opened this issue 7 months ago • 1 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [x] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.34 (Claude Code)
  • Operating System: macOS 15.5, Ubuntu 24.04 LTS
  • Terminal: iTerm

Bug Description

When using Ctrl+E (move to end of line) on lines containing Japanese or other fullwidth characters, the cursor does not move to the actual end of the line. It stops in the middle of the line, making text editing difficult for users working with Japanese text.

Steps to Reproduce

  1. Start Claude Code in interactive mode
  2. Type a line containing Japanese text, for example: たとえば、日本語のような全角文字では ctrl+e を押してもカーソルが文末まで移動しない。
  3. Press Ctrl+E to move to end of line
  4. Observe that cursor stops in the middle of the line instead of at the end

Expected Behavior

Cursor should move to the very end of the line, after the final character (。in this example).

Actual Behavior

Cursor stops partway through the line. In the example text, the cursor stops after character, leaving してもカーソルが文末まで移動しない。 unreachable via Ctrl+E.

Additional Context

  • This issue occurs consistently on both macOS 15.5 and Ubuntu 24.04 LTS
  • The issue is reproducible with any Japanese text containing hiragana, katakana, or kanji
  • English-only lines work correctly with Ctrl+E
  • This appears to be related to incorrect calculation of character widths for fullwidth (East Asian) characters
  • Screenshot attached showing the cursor position after pressing Ctrl+E Image

masakiaota avatar Jun 25 '25 04:06 masakiaota

Hi @masakiaota! Can you please try updating to v1.0.38 and see if that fixes the issue? Thanks.

chrislloyd avatar Jul 01 '25 00:07 chrislloyd

Wow working perfectly, I love this. I really appreciated it. @chrislloyd

masakiaota avatar Jul 01 '25 08:07 masakiaota

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 10 '25 14:08 github-actions[bot]