Skip to content

Conversation

@Techcable
Copy link
Member

As discussed in slog-rs/slog#267 it appears that the term crate is unmaintained.

This is a draft for switching to term color:

Advantages:

  • termcolor::Write extends std::io::Write (and has unified stderr/stdout times) so we don't have to use the nasty enum
  • termcolor has no custom error type. It just uses std::io::Error

In general this seems to clean things up significantly. However, it has the following caveats:

Disadvantages/Limitations:

  • termcolor has no counterpart to suports_bold. We can't ask "do you support bold?". We can only ask "do you support colors?"

Potential Alternatives:
I think it's good to think about potential alternatives. One alternative is updating to a more modern version of term (like term 0.7)

Here are some other crates listed on the issue:

termcolor (this PR) definitely seems to have less features than term does.

I think crossterm looks extremely promising.

I don't think we should go with yansi because windows support seems second-class.

This has the advantage of being an overall cleaner crate.

However it has a couple of disadvantages.....
@Techcable Techcable added C-Cleanup Category: Internal code cleanup (not affecting API) P-low Low priority labels Feb 9, 2022
@Techcable
Copy link
Member Author

Mostly irrelevant now that term has become maintained and hit v1.0.

@Techcable Techcable closed this Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Cleanup Category: Internal code cleanup (not affecting API) P-low Low priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant