BurntSushi/termcolor

Support more display settings in ColorSpec

brendanzab opened this issue · 5 comments

Hey, I'm wondering if we might be able to expand the set of display settings that termcolor supports? In particular, I'm interested in dim and italic modes. I understand that there are cross-platform concerns to think about though.

Here are some of the lists of attributes supported by other cross-platform libraries, for reference:

I don't necessarily have a problem with doing this, but I'm not going to do the leg work personally. And I'm generally not interested in adding support for the terminfo database, which I think becomes more pertinent as one adds support for more complex features. I would also expect the Windows story to be ironed out too. This probably means ignoring the extra styling when using the console API, but using the correct ANSI escapes when in VT100 emulation mode.

Yeah, I can't get around to this right now, but thought I'd put some feelers out. I know you have a bunch on your plate! Sadly I don't have access to a windows computer, so testing that would be a challenge. Failing this I might try out some of the other crates (although I've been a big fan of how mockable termcolor is).

By terminfo database do you mean the terminfo crate? Eg. EnterDim has an entry. Yes, I can see why you might want to preserve the simplicity of termcolor.

Feel free to close this if you want to keep your issue list clean. But perhaps another friendly soul might be able to help out.

By terminfo database do you mean the terminfo crate?

No, I mean the terminfo database: https://en.wikipedia.org/wiki/Terminfo

The terminfo crate looks like an API to that database, but I will absolutely not depend on it for two reasons. First, it uses the WTFPL, and too many people are afraid to incur a dependency that uses the WTFPL. Second, its documentation is essentially non-existent, so its quality level isn't quite at the point where I'd be comfortable depending on it.

My preference would be to just not use the terminfo database at all. That sounds like a good way to determine what kinds of styles termcolor should support or not. e.g., Styles that are ubiquitous and use the same ANSI escape sequence in all environments. Beyond that, I'd say you're in a more specialized use case and should look for some other crate.

No, I mean the terminfo database: https://en.wikipedia.org/wiki/Terminfo

Ah, right, gotcha! Thanks for bearing with me as I learn more about the fun details of terminals and their incompatibilities. 😅

That sounds like a good way to determine what kinds of styles termcolor should support or not. e.g., Styles that are ubiquitous and use the same ANSI escape sequence in all environments.

Yes, this is a great way of putting it!

Closing this out because I don't think there's anything specifically actionable here. Feel free to open new issues with more specific requests.