[BUG] Ctrl+E stops at halfway when line contains Japanese/multibyte characters
## Description
When using Ctrl+E (move to end of line) in Claude Code's interactive mode, the cursor stops at approximately half the visual line length when the line contains Japanese or other multibyte characters. Note that Ctrl+A
(move to beginning of line) works correctly.
## Environment
- OS: macOS Darwin 24.5.0
- Claude Code version: 1.0.35 (Claude Code)
- Terminal: [e.g., Terminal.app, iTerm2]
- Shell: [e.g., zsh, bash]
## Steps to Reproduce
- Start Claude Code in interactive mode:
claude - Type a line containing both ASCII and Japanese characters:
Hello こんにちは World
- Press
Ctrl+Ato move to the beginning of the line (this works correctly) - Press
Ctrl+Eto attempt to move to the end of the line - Observe that the cursor stops approximately halfway through the line instead of reaching the end
## Expected Behavior
Ctrl+E should move the cursor to the actual end of the line, after "World".
## Actual Behavior
Ctrl+E stops the cursor at approximately 50% of the visual line position, typically in the middle of the Japanese text.
## Root Cause Analysis
This appears to be specific to the Ctrl+E implementation when handling multibyte characters:
- Japanese characters in UTF-8 use 3 bytes per character
- Japanese characters display as 2 columns width (full-width)
- The
Ctrl+Elogic seems to calculate the end position based on byte count rather than visual column count Ctrl+Aworks correctly, suggesting the issue is isolated to the end-of-line calculation
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗