Skip to content

Fix color bug#94

Merged
patricklx merged 2 commits intomainfrom
fix-color-bug
Apr 22, 2026
Merged

Fix color bug#94
patricklx merged 2 commits intomainfrom
fix-color-bug

Conversation

@patricklx
Copy link
Copy Markdown
Owner

No description provided.

@patricklx
Copy link
Copy Markdown
Owner Author

patricklx commented Apr 22, 2026

🤖 Git AI task started...

Task: Run pnpm install
First Rebase onto main, commit and push

ember-tui/src/render/apply-term-updates.ts is trying to optimise too much the partial updates.
It should split lines into chunks that need updating and override. So not try to optimise ansi codes (like reuse of previous ansi state)

You have max 10min for this task.
Add the 10min stop to your todo list.


Processing... (view live updates in extension)

completed ✅

💰 Cost: 🪙 0.28392779999999995

View full output in the extension

Copy link
Copy Markdown
Owner Author

patricklx commented Apr 22, 2026

🤖 CI Bot - Work Completed

Summary:

  • ✅ pnpm install completed
  • ✅ Rebased onto main
  • ✅ Fixed color bug in apply-term-updates.ts
  • ✅ Tests passing
  • ✅ Changes committed and pushed

Fix Applied:
Removed ANSI code optimization that was causing color bleeding. The updateLineMinimal function now always resets ANSI codes before each segment chunk instead of trying to reuse previous state between contiguous segments.

Changes:

  • Modified updateLineMinimal to always call buffer.push('\x1b[0m') before each segment
  • Removed conditional reset logic that was causing color state to bleed between segments
  • Simplified the code by removing the needsReset check and isFirstSegment special handling

Commit: 68e5071
Time taken: ~3 minutes

- Only reset ANSI codes before non-contiguous segments
- Check if segment starts where previous one ended to determine contiguity
- Preserves color continuity within contiguous segments (e.g., animated reveals)
- Maintains clean color state between non-contiguous segments
- Added comprehensive tests for animated color scenarios
- All 85 tests passing
The updateLineMinimal function was trying to optimize ANSI codes by reusing
previous state between contiguous segments. This caused color bleeding issues.

Changed to always reset ANSI codes before each segment chunk, ensuring clean
state and preventing color from previous segments affecting new content.

Fixes color bug in apply-term-updates.ts
@patricklx patricklx merged commit 10c5936 into main Apr 22, 2026
1 check passed
@patricklx patricklx added the bug Something isn't working label Apr 22, 2026
@github-actions github-actions Bot mentioned this pull request Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant