You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report @aloucks! This is almost for sure due to #48588
The interesting part here is that it looks like rustc is detecting that it should use colors because somet of the messages look bold. It looks, though, like there may be a bug in how rustc is colorizing things as the wrong colors are coming out!
To confirm, @aloucks are you using cmd.exe as a shell here?
I did some investigation on this. It looks like when you use both bold and intense that the color doesn't work. It appears to be due to the fact that termcolor sets the color before issuing the bold VT100 command. The Windows console currently does not support true "bold" fonts, and instead just shows a "bright" color. It seems like setting "bold" is overriding the "intense" color. I've noted a few other people having various issues with bold text at Microsoft/console.
@BurntSushi do you have any particular insight on this? I did a quick fix by just moving the code to set bold to before the write_color in this function:
@ehuss I don't have any special insight, no, but I do recall running into those sorts of problems when adding VT100 support for Windows. I can't remember the details. If re-arranging the ordering fixes things, then that seems like a fine thing to me. I'd be happy to take your patch!
Activity
retep998 commentedon Mar 24, 2018
cc @alexcrichton who wrote the likely offending PR.
alexcrichton commentedon Mar 24, 2018
Thanks for the report @aloucks! This is almost for sure due to #48588
The interesting part here is that it looks like rustc is detecting that it should use colors because somet of the messages look bold. It looks, though, like there may be a bug in how rustc is colorizing things as the wrong colors are coming out!
To confirm, @aloucks are you using
cmd.exeas a shell here?aloucks commentedon Mar 24, 2018
@alexcrichton - Yes, the screen shot is using
cmd.exe. I first noticed it from VSCode with the embedded powershell terminal.I noticed it was showing bold too. It is strange that it detects that it should use color, but doesn't apply it correctly.
ehuss commentedon Mar 26, 2018
I did some investigation on this. It looks like when you use both
boldandintensethat the color doesn't work. It appears to be due to the fact thattermcolorsets the color before issuing the bold VT100 command. The Windows console currently does not support true "bold" fonts, and instead just shows a "bright" color. It seems like setting "bold" is overriding the "intense" color. I've noted a few other people having various issues with bold text at Microsoft/console.@BurntSushi do you have any particular insight on this? I did a quick fix by just moving the code to set bold to before the
write_colorin this function:https://github.com/BurntSushi/ripgrep/blob/d7c9323a689239ac8b29baba63b1c3a26e12afda/termcolor/src/lib.rs#L972-L987
I didn't do significant testing, but it seems to avoid the bold setting from overriding the color setting.
BurntSushi commentedon Mar 26, 2018
@ehuss I don't have any special insight, no, but I do recall running into those sorts of problems when adding VT100 support for Windows. I can't remember the details. If re-arranging the ordering fixes things, then that seems like a fine thing to me. I'd be happy to take your patch!
Fix bold, intense color on Windows 10 console.
ehuss commentedon Mar 26, 2018
@BurntSushi I don't think this should be closed until a new termcolor release is made and the rust lock file is updated.
alexcrichton commentedon Mar 26, 2018
Oh awesome thanks so much for the fix here @ehuss! @BurntSushi mind publishing a new version of
termcolorso we can test out the fix?BurntSushi commentedon Mar 26, 2018
Oh, errm, yeah I didn't mean to close this. I always forget that github does cross repo closes. In any case,
termcolor 0.3.6is on crates.io!alexcrichton commentedon Mar 26, 2018
Awesome, thanks!
@ehuss want to send a PR I can r+? No worries if you're busy though!
ehuss commentedon Mar 26, 2018
@alexcrichton sure! I'd like to do a build first, but I'll post it soon!
Rollup merge of rust-lang#49399 - ehuss:termcolor-update, r=alexcrichton