Closed DrunkenToast closed 1 month ago
Created a naive POC which already works really well and is promising. I don't think it's very performant however, it's also a bit of an ugly trick with ansi codes right now, it would be better to only keep the resulting style. Wrapping: Color reset:
This is great! Sorry I haven't had time to look into this, I found a bunch of bugs and have been prioritizing that. The only thing I'll add is the logic for splitting text and fit it into the screen is there already but you need to turn text into WeightedTextBlock
and render it via BlockLineText::Weighted
instead of BlockLineText::Preformatted
but that may create other issues.
Hey @DrunkenToast, I just wanted to know I started looking into this. I had to change a few internal things to make this work as expected, but I have a somewhat working version based on yours that parses lines only once after reading them rather than every time they're rendered. Thanks for setting the base for this change!
Hey @DrunkenToast, I just wanted to know I started looking into this. I had to change a few internal things to make this work as expected, but I have a somewhat working version based on yours that parses lines only once after reading them rather than every time they're rendered. Thanks for setting the base for this change!
Awesome! Thanks for the hard work ❤️
closed in favor of #316
Fix #272
Don't write a lot of Rust, so all feedback obviously welcome!
Colored output works, however with the caveat of chunking not working. I am not sure how to approach chunking as it would be likely that I cut through ANSI escapes codes. Keeping track of positions for where to slice seems messy.
Another expected issue is that the reset code clears out the codeblock format colors, not sure if we wanna resolve that too. I was thinking that the rendering could intercept clear codes and apply the chosen colors but I think that is out of scope for this PR.