claude-code - 💡(How to fix) Fix [BUG] Stale background color artifacts (stale cells) left behind by floating overlays [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53406Fetched 2026-04-26 05:16:43
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1renamed ×1

Error Message

Error Messages/Logs

no error and logs,only like this

Code Example

no error and logs,only like this
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When using Claude Code, floating UI elements (like the "1 new message (ctrl+End) ↓" notification badge) leave behind visual artifacts after they disappear or when the view is scrolled.

These artifacts manifest as solid grey background blocks that obscure the text underneath. The text characters themselves are still rendered correctly, but the background color attribute (SGR) of those cells is not being properly reset.

<img width="1115" height="225" alt="Image" src="https://github.com/user-attachments/assets/4d50b880-2431-45da-82ee-d2a7b5de349b" />

What Should Happen?

When floating UI elements are removed or the view is scrolled, the terminal cells should be completely cleared of their background attributes, returning to the normal terminal background.

Error Messages/Logs

no error and logs,only like this

Steps to Reproduce

  1. Start claude in the Ghostty terminal (running directly, NO tmux involved).
  2. Let the assistant generate a long response and scroll up slightly so the floating badge ("1 new message (ctrl+End) ↓") appears.
  3. Scroll down or wait for the badge to disappear/re-render.
  4. Observe the grey background blocks left behind where the badge used to be.
  5. Note: Pressing Ctrl+L forces a redraw and fixes the visual corruption, indicating an SGR reset sequence is missing when clearing the overlay.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Ghostty, TERM: xterm-ghostty

extent analysis

TL;DR

The issue can likely be fixed by adding an SGR reset sequence when clearing the overlay, similar to what happens when pressing Ctrl+L.

Guidance

  • Investigate the code responsible for clearing the floating UI elements and add an SGR reset sequence to ensure the background attributes are properly reset.
  • Verify that the Ctrl+L keybinding is using an SGR reset sequence to clear the screen, and apply the same logic to the overlay clearance code.
  • Check the terminal settings and configuration to ensure that the xterm-ghostty TERM variable is correctly set and supported by the Claude Code application.
  • Review the Ghostty terminal documentation to see if there are any specific requirements or recommendations for handling SGR sequences and overlay clearance.

Example

No code example is provided as the issue does not include specific code snippets, but the fix likely involves adding an ANSI escape sequence such as \x1b[0m to reset the background color attribute.

Notes

The issue may be specific to the Ghostty terminal and the xterm-ghostty TERM variable, so testing with other terminals and configurations may help determine the root cause.

Recommendation

Apply workaround: Add an SGR reset sequence when clearing the overlay, as this has been shown to fix the visual corruption when pressing Ctrl+L.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING