Skip to content

Use proper ANSI reset codes in Colorize#16052

Merged
straight-shoota merged 4 commits intocrystal-lang:masterfrom
Blacksmoke16:proper-colorize-end-codes
Sep 28, 2025
Merged

Use proper ANSI reset codes in Colorize#16052
straight-shoota merged 4 commits intocrystal-lang:masterfrom
Blacksmoke16:proper-colorize-end-codes

Conversation

@Blacksmoke16
Copy link
Member

@Blacksmoke16 Blacksmoke16 commented Aug 3, 2025

Partially handles #10652. The example in the OP now works as expected, but does NOT solve #10652 (comment); which would require a more substantial refactor.

Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

I'm a bit wary about modifying Colorize while we haven't figured out how to make it thread-safe (#15995). But this seems to be a very straightforward extension of the existing code, so this is probably fine.

@straight-shoota straight-shoota added this to the 1.18.0 milestone Sep 26, 2025
@straight-shoota straight-shoota merged commit f9d2717 into crystal-lang:master Sep 28, 2025
39 checks passed
@straight-shoota straight-shoota changed the title Use proper ANSI reset codes Use proper ANSI reset codes in Colorize Sep 28, 2025
@Blacksmoke16 Blacksmoke16 deleted the proper-colorize-end-codes branch October 14, 2025 20:16
@zw963
Copy link
Contributor

zw963 commented Oct 17, 2025

Thanks a lot for fix this issue, I meet a issue cause by this before.

@crysbot
Copy link
Collaborator

crysbot commented Feb 19, 2026

This pull request has been mentioned on Crystal Forum. There might be relevant details there:

https://forum.crystal-lang.org/t/ansi-sequences-modified-unexpectedly/8722/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants