term icon indicating copy to clipboard operation
term copied to clipboard

Attempt to switch from `term` to `termcolor`

Open Techcable opened this issue 4 years ago • 0 comments

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.

Techcable avatar Feb 09 '22 23:02 Techcable