[BUG] Pasting Japanese text breaks the prompt input
Resolved 💬 3 comments Opened Apr 1, 2025 by kumeS Closed Apr 2, 2025
Below is the complete bug report written in English:
---
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude CLI
- Claude CLI version: 0.2.57 (Claude Code)
- Operating System: e.g., macOS 15.3
- Terminal: Terminal App
Bug Description
When pasting Japanese text into the Claude CLI, the application encounters an error and then immediately closes. The error message is as follows:
Error: Failed to find wrapped line in original text
at DN2.measureWrappedText (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:940:399)
at new DN2 (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:937:713)
at p7.fromText (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:934:1222)
at p7.modifyText (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:935:1557)
at p7.insert (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:935:1615)
at file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1182:21
at y0 (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1183:40)
at wrappedOnInput (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1183:624)
at file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:837:2736
at I.G.batchedUpdates (file:///Users/sas/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:50720)
Steps to Reproduce
- Open the Claude CLI.
- Paste a block of text containing Japanese characters.
- Observe that the application immediately closes after displaying the error message.
Expected Behavior
The expected behavior is that the Claude CLI should correctly handle and display Japanese text without triggering errors or causing the application to close.
Actual Behavior
Upon pasting Japanese text, the application fails to find a wrapped line in the original text, resulting in an error that causes the CLI to close unexpectedly.
Additional Context
- This issue may be related to how the tool processes text wrapping, especially for non-Latin characters.
- It could also indicate a potential bug in the text measurement or wrapping functionality within the CLI.
- Please include any additional logs, screenshots, or details about your configuration (e.g., Node.js version, specific settings) when reporting this issue to facilitate troubleshooting.
---
Feel free to adjust any placeholder values to match your specific environment details before submitting the report.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗