Skip to content

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Oct 21, 2024

Previously the linePrefix would end with RESET and wipe out the colors after each line; now we parse each line and look at the ending color and print that at the start of the next line. There'll be some overhead, but fansi.Str is pretty fast so hopefully it's OK

Tested manually, we can see the multi-line ansi colors that were problematic earlier now work, both preserving color, going from color to non-color and color to non-color

Screenshot 2024-10-21 at 6 52 15 PM

Fixes #3793

@lihaoyi lihaoyi merged commit b8217f3 into com-lihaoyi:main Oct 21, 2024
24 checks passed
@lefou lefou added this to the 0.12.0 milestone Oct 21, 2024
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.

PromptLogger does not properly preserve ansi colors across newlines
2 participants