[BUG] TUI rendering corrupted in neovim's built-in terminal (macOS)

Resolved 💬 11 comments Opened Jan 23, 2026 by mgleonard425 Closed May 3, 2026

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 running Claude Code inside neovim's built-in :terminal, permission prompts and other interactive UI elements render with overlapping/duplicated text. Menu options appear multiple times, text fragments get garbled (e.g., >sc tNocancel), and "Tab to add additional instructions" appears twice.

This issue is only observed when running Claude Code inside neovim's terminal - running in a regular terminal (iTerm2, Terminal.app, etc.) works correctly.

What Should Happen?

UI elements should render cleanly without overlapping or duplication.

Error Messages/Logs

No error messages - this is a visual rendering issue.

Steps to Reproduce

  1. Open neovim
  2. Run :terminal to open a terminal buffer
  3. Run claude to start Claude Code
  4. Trigger any permission prompt (e.g., request a file edit)
  5. Observe garbled/overlapping UI elements in the permission prompt

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.17

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • Terminal width: 120 columns (issue persists even with wide terminal)
  • $TERM: xterm-256color
  • Neovim version: 0.11.5
  • macOS Darwin 24.6.0

Root Cause Analysis

Neovim's :terminal uses libvterm, which does not appear to support synchronized output (DEC mode 2026). This is the protocol modern TUI applications use to prevent screen tearing by batching screen updates.

  • Neovim's own TUI supports mode 2026 (since v0.10), but this is for neovim rendering to a host terminal
  • Neovim's embedded terminal emulator (:terminal) does not appear to support mode 2026 for applications running inside it
  • When Claude Code's TUI sends synchronized output sequences to a terminal that doesn't support them, the cursor positioning and screen updates don't work correctly, causing overlapping/garbled output

This appears similar to #19637 (Windows cmd rendering corruption) - Windows cmd also lacks modern terminal features.

Suggested fix: Claude Code could detect when synchronized output mode 2026 is not supported (via DECRQM query) and fall back to simpler rendering that doesn't rely on it.

References:

View original on GitHub ↗

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