Skip to content

Avoid some color bleeding (from leftover background colors) and gaps with apple terminal. add ColorState to skip out noop color changes (to be moved to ansipixels later)#56

Merged
ldemailly merged 2 commits intomainfrom
analog_apple_opt
Oct 13, 2025

Conversation

@ldemailly
Copy link
Copy Markdown
Member

@ldemailly ldemailly commented Oct 12, 2025

One key characteristic of what we aim is smallest amount of bytes sent for a given rendering (note we should also optimize the cursor moves like we do in image showing and disc)

before

Screenshot 2025-10-12 at 4 55 33 PM

after

Screenshot 2025-10-12 at 4 55 57 PM

…lso introduce a colorstate to skip out noop color changes (to be moved to ansipixels later)
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces color state optimization to reduce redundant ANSI color codes when rendering pixels. The changes add a ColorState struct to track the last set foreground and background colors, avoiding unnecessary color changes when the same colors are already active.

  • Introduces ColorState to track current foreground/background colors
  • Replaces direct color setting calls with optimized color state methods
  • Reduces redundant ANSI escape sequences by only setting colors when they change

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 12, 2025

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (d2d640d) to head (28e904f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
analog.go 0.00% 18 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main     #56   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          5       5           
  Lines        579     590   +11     
=====================================
- Misses       579     590   +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ldemailly ldemailly changed the title Avoid some bleeding with apple terminal leftover background colors; also introduce a colorstate to skip out noop color changes (to be moved to ansipixels later) Avoid some color bleeding (from leftover background colors) and gaps with apple terminal. add ColorState to skip out noop color changes (to be moved to ansipixels later) Oct 12, 2025
@ldemailly ldemailly merged commit fb88cfd into main Oct 13, 2025
9 checks passed
@ldemailly ldemailly deleted the analog_apple_opt branch October 13, 2025 00:02
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.

2 participants