[BUG] iterm2's claude code window auto input with \^]
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 I enter Claude Code in iTerm2, I can see the input prompt and the / command works as expected. However, when I switch to another window and then return to iTerm2, the prompt disappears, and the / command no longer works. I have to press the delete key a few times to restore normal behavior. After pressing Enter and checking the history, I noticed that \^] is automatically added when I switch back to iTerm2. Could you please help me understand what might be causing this and how to resolve it? Thank you so much.
What Should Happen?
Expected: No matter how I switch between windows, I should be able to call up commands with / immediately, without needing to press the delete key several times.
Error Messages/Logs
Steps to Reproduce
- open iterm2 and input claude and enter
- there's some prompt and use / and some command showed for me
- switch window to chrome and return to iterm2
- prompt is gone and use / can't see nothing
- press delete key and everythins is ok
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.0.5
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗