Skip to content

Compile errors are no longer colorized #49322

Closed

Description

@aloucks

Previously, the line numbers were in cyan and error codes and error underlines were in red.

Possibly related: #48588

image

Activity

  1. retep998 commented on Mar 24, 2018

    @retep998
    Contributor

    cc @alexcrichton who wrote the likely offending PR.

  2. alexcrichton commented on Mar 24, 2018

    @alexcrichton
    Member

    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?

  3. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Mar 24, 2018
  4. aloucks commented on Mar 24, 2018

    @aloucks
    ContributorAuthor

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

  5. ehuss commented on Mar 26, 2018

    @ehuss
    Contributor

    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:

    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.

  6. BurntSushi commented on Mar 26, 2018

    @BurntSushi
    Member

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

  7. ehuss commented on Mar 26, 2018

    @ehuss
    Contributor

    @BurntSushi I don't think this should be closed until a new termcolor release is made and the rust lock file is updated.

  8. alexcrichton commented on Mar 26, 2018

    @alexcrichton
    Member

    Oh awesome thanks so much for the fix here @ehuss! @BurntSushi mind publishing a new version of termcolor so we can test out the fix?

  9. BurntSushi commented on Mar 26, 2018

    @BurntSushi
    Member

    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.6 is on crates.io!

  10. alexcrichton commented on Mar 26, 2018

    @alexcrichton
    Member

    Awesome, thanks!

    @ehuss want to send a PR I can r+? No worries if you're busy though!

  11. ehuss commented on Mar 26, 2018

    @ehuss
    Contributor

    @alexcrichton sure! I'd like to do a build first, but I'll post it soon!

  12. added a commit that references this issue on Mar 27, 2018
    2d05bde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions