feat: emit ANSI cursor shape escape sequences based on VIM mode

Resolved 💬 1 comment Opened May 12, 2026 by shanetimmerman-figma Closed Jun 12, 2026

Summary

When editorMode is set to "vim" in settings.json, Claude Code should emit ANSI cursor shape escape sequences when switching between normal and insert mode — just like full Vim/Neovim does.

Desired behavior

  • Normal mode → block cursor (\e[2 q)
  • Insert mode → line/bar cursor (\e[6 q)
  • Replace mode → underline cursor (\e[4 q)
  • On exit, restore the terminal's original cursor shape (\e[0 q)

Why

Terminal cursor shape is one of the most useful visual indicators of the current VIM mode. Without it, users in vim editor mode have no passive feedback about which mode they're in — they have to look at status text (if any) or try typing to find out.

Most modern terminals (iTerm2, Ghostty, WezTerm, Kitty, etc.) support these escape sequences natively. Full Vim/Neovim emits them by default. It would be a low-effort, high-value addition to Claude Code's VIM mode.

References

  • ANSI cursor shape sequences: ESC [ Ps SP q (DECSCUSR)
  • Ps = 0, 1 → blinking block; Ps = 2 → steady block
  • Ps = 3 → blinking underline; Ps = 4 → steady underline
  • Ps = 5 → blinking bar; Ps = 6 → steady bar

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗