[BUG] CLI freezes when holding directional arrow keys to navigate text input
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When typing a long prompt and holding a directional arrow key (← or →) to navigate to a specific word for correction, the CLI occasionally freezes and all input is lost.
This was previously reported in #5303, which was closed due to lack of user response. The issue is still reproducible on the current version.
Environment:
- OS: Ubuntu 24.04.4 LTS
- Kernel: Linux 6.8.0-106-generic x86_64
- Terminal emulator: GNOME Terminal
- Shell: bash
- TERM: xterm-256color
- Claude Code version: 2.1.78
- IntelliJ IDEA version: 2025.3.4 (build 253.32098.37)
What Should Happen?
The cursor should navigate smoothly through the text without freezing.
Error Messages/Logs
The CLI freezes completely when holding directional keys. The process must be killed to regain control, which resets the entire session context — all conversation history and ongoing work is lost.
Steps to Reproduce
- Start a Claude Code session
- Type a long text in the input prompt
- Hold the ← or → arrow key to navigate to a word in the middle of the text
- Observe: the CLI freezes and becomes completely unresponsive — the only way to recover is to kill the process and restart, losing the entire session context in the process
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.78
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
Related to #5303. The issue occurs intermittently, not on every attempt. Pressing arrow keys individually (instead of holding) seems less likely to trigger the freeze.
The bug has been reproduced in two different environments:
- IntelliJ IDEA plugin
- GNOME Terminal
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗