Making default color scheme compatible for windows terminal displays#222
Making default color scheme compatible for windows terminal displays#222robinbernon wants to merge 5 commits intoconsole-rs:mainfrom
Conversation
|
@pksunkara thoughts? |
|
Looks okay to me, but I am wondering which windows terminals doesnt support these chars? |
|
I am thinking that this should not be gated on OS but on term application's unicode support. |
|
These Unicode characters are just not supported on any windows terminals right now. Perhaps a request to support them could be filed somewhere but for now I think the changes will have to be made here. |
I'm guessing this is just a windows problem. Guessing all Unix based systems should be able to support the same list of Unicode chars? (Or at lease should all include the ones here?) |
|
Please use https://docs.rs/console/latest/console/struct.TermFeatures.html#method.wants_emoji instead of gating on OS. And please make sure to test it manually on your terminal. |
@pksunkara I've done as asked. It's decided by .wants_emoji() now :) |
| #[cfg(feature = "fuzzy-select")] | ||
| fuzzy_match_highlight_style: Style::new().for_stderr().bold(), | ||
| inline_selections: true, | ||
| if Term::stdout().features().wants_emoji() { |
There was a problem hiding this comment.
You can store this in a variable and use it in emoji lines instead of this big if condition block.
There was a problem hiding this comment.
Sorry do you mind clarifying what you mean here? I dont understand. Do you want a variable for the term features?
There was a problem hiding this comment.
let has_emoji = Term::stderr().features().wants_emoji();
// later
ColorfulTheme {
error_prefix: style((if has_emoji { "✘" } else { "×" }).to_string()).for_stderr().red(),
}|
Hey, @robinbernon can you make the changes, please? It would be valuable for Windows users. |
Fixing default color scheme to be compatible with windows terminal displays.