[BUG] Prompt edit box is capturing all mouse input as text
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?
Claude Version: 2.0.9 (Claude Code)
Mac Uname -a: Darwin Richards-MacBook-Pro.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 arm64
Claude code, at some point, starts capturing all the mouse movement as text in the edit box. I didn't do anything special, and I can't pinpoint what triggers it. It just happens after about an hour - that's the best correlation I have. Stopping and restarting claude code fixes it. Claude will still be able to interpret some commands, recognizing that "the user seems to have sent some screen control codes by accident"
I'm just using the standard mac terminal.
<img width="1552" height="997" alt="Image" src="https://github.com/user-attachments/assets/8d66f73a-0541-4df7-9f99-586b5937e090" />
What Should Happen?
Anthropic should protect the claude prompt box from mouse input.
Error Messages/Logs
Steps to Reproduce
Install claude code 2.0.9 on mac osx. Just use it for a while. You'll start to see screen control codes flood the prompt box when you move the mouse.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.9
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Same here, but much worse with the new
edit in nvimfeature.I suppose this is a dup of a lot of other issues, but it's really unclear as to why it's happening, and none of the issues that it is a dup of are still open, so this is going to be abandoned at some point. It's probably related to developing a TUI - the mouse input gets captured by the TUI, and claude code doesn't shut down tuis properly. If it could just shut the TUI apps down completely after each run, maybe this wouldn't happen. I mean, this does not affect a lot of users, but it's valid and seems to affect TUI users and nvim users, at least.
I have the same issue, not sure what causes it but it started happening a few days ago.
@jriskin are you using a TUI or neovim? Testing something that uses mouse input in a terminal?
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Don't close this issue. This is an automatic message by Fresh - a bot against stale bots.
I'm having this issue as well.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Upvote or comment on that issue, so maybe it gets noticed.
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.