Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to switch from term to termcolor #41

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

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
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