Underline ANSI escape leaks in nvim terminal — reset sequence never emitted

Resolved 💬 3 comments Opened Apr 7, 2026 by carlosnsr Closed Apr 11, 2026

Description

When running Claude Code inside nvim's embedded terminal, underline formatting (\e[4m) is emitted for markdown rendering but the corresponding reset sequence (\e[0m or \e[24m) is never sent. This causes all subsequent terminal output to remain underlined until the user manually runs reset.

Steps to Reproduce

  1. Open nvim and launch a terminal buffer (:term)
  2. Run claude inside the nvim terminal
  3. Observe that some output text becomes underlined and never stops

Expected Behavior

ANSI underline should be reset after each formatted span, so only the intended text is underlined.

Actual Behavior

Underline attribute leaks — once enabled it is never cleared, causing all following output to be underlined.

Workaround

Setting "theme": "plain" in ~/.claude/settings.json disables markdown formatting and avoids the issue.

Environment

  • Running inside nvim embedded terminal (:term)
  • Platform: macOS

View original on GitHub ↗

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