Terminal background color stuck on red after crash in Neovim integration
Description
When pasting a large amount of text into the Claude Code input in Neovim, the Claude Code window crashes and exits immediately. Upon reopening with :ClaudeCode, the terminal buffer has a persistent red background that cannot be cleared.
Steps to Reproduce
- Open Neovim
- Run
:ClaudeCodeto open Claude Code - Paste a very large text into the input field
- Claude Code crashes and exits
- Run
:ClaudeCodeagain - The Claude Code window now has a red background
Expected Behavior
The Claude Code window should display with normal colors after reopening, or gracefully handle large input without crashing.
Actual Behavior
- The window crashes when large text is pasted
- After reopening, the output area has a bright red background
- Other Neovim windows in the same session display correctly
- Workarounds like
:bd!,reset,Ctrl-l, and terminal reset escape sequences do not fix the issue
Environment
- OS: macOS (Darwin 24.6.0)
- Neovim: v0.11.5
- Terminal: (not specified)
- Claude Code version: 2.0.72
Screenshots
<img width="1440" height="890" alt="Image" src="https://github.com/user-attachments/assets/d7ed50a4-5d66-4d9f-a903-909151a68025" />
Screenshots showing the red background issue are attached below. The first screenshot shows the Claude Code window with bright red background on the output area. The second screenshot shows the same issue with the input field visible at the bottom.
(Note: Screenshots were provided by the reporter but cannot be attached via CLI. The issue shows a bright red background in the Claude Code terminal buffer while other Neovim windows display normally.)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗