Skip to content

Conversation

@slang25
Copy link

@slang25 slang25 commented Jan 10, 2026

Problem

When setting the terminal background to a translucent or transparent background, the canvas writing approach ends up stacking up stale content. This PR fixes that.

My first draft actually looked at the background color to decide if it was opaque and then skipped the clearRect for that scenario, however I don't think there is a perf hit here so have gone for the more simple approach, if you'd prefer this other approach then please let me know 🙂

Summary

  • Add clearRect before fillRect in canvas rendering methods to properly clear previous content
  • Fixes content piling up when using transparent/translucent background colors
  • Ensures selection highlighting clears properly with transparent backgrounds

Test plan

  • Set terminal background to a transparent color (e.g., rgba(0,0,0,0))
  • Verify terminal content clears properly instead of accumulating
  • Verify selection highlighting works correctly

🤖 Generated with Claude Code

When using a transparent background color, fillRect composites rather than
replaces pixels. Add clearRect before fillRect in renderLine, clear, and
renderScrollbar to properly erase previous content before applying the
background color. This fixes content piling up when using transparent
backgrounds and ensures selection highlighting clears properly.

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant