[Bug] Vim-mode Insert inserts escape sequences for Option+Arrow keys
Bug Description
When using vim-mode (enabled via /vim), after opening editor with ctrl-g and returning to prompt, pressing Option+Arrow keys in Insert mode inserts visible noise characters into the prompt instead of handling them gracefully.
This happens within a tmux session (without tmux, when returning from editor, [I is appended).
Expected behaviour: Same as terminal vim - Option+Arrow in Insert mode should either:
- Move cursor by word (common terminal behavior), or
- Be ignored (no-op) [my personal preference]
Actual behaviour: Escape sequences appear as visible garbage characters in the input, eg:
> [O[I[O[I[O[I[O[I[O[I[O[I
Steps to reproduce:
- Enable vim-mode with /vim
- Press
ctrl-gto open editor (mine isEDITOR="bob run nightly") - Exit editor (
:q) - Start typing (Insert mode)
- Press Option+Left or Option+Right
- Observe noise characters inserted into promptEnvironment:
- macOS with tmux
- Standard terminal (Ghostty.app)
Impact:
Users with Option+Arrow bound to tmux pane navigation cannot switch panes without exiting Insert mode first, unlike standard vim behaviour. Exiting Insert mode (ie pressing esc) risks interrupting the agent (by pressing esc twice).
Environment Info
- Platform: darwin
- Terminal: tmux
- Version: 2.0.64
- Feedback ID: 85e27fd3-e07b-4a3d-8bbb-da88c5be0e82
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/10375
- https://github.com/anthropics/claude-code/issues/11391
- https://github.com/anthropics/claude-code/issues/12242
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
This issue has been automatically closed as a duplicate of #10375.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
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.