[Bug] Vim-mode Insert inserts escape sequences for Option+Arrow keys

Resolved 💬 3 comments Opened Dec 10, 2025 by zubin Closed Dec 14, 2025

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:

  1. Enable vim-mode with /vim
  2. Press ctrl-g to open editor (mine is EDITOR="bob run nightly")
  3. Exit editor (:q)
  4. Start typing (Insert mode)
  5. Press Option+Left or Option+Right
  6. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗