Skip to content

No console colors on Windows 7 #55769

@jminer

Description

@jminer

I just updated Rust at work, and now rustc has no colors in the console (Cargo still does). I'm using Windows 7 64-bit with Rust MSVC 32-bit. I tried 1.29 stable and it worked, but 1.30 stable and the latest nightly don't work. I have tried both cmd.exe and PowerShell and both look the same. This is a big regression in usability, so I'll probably downgrade back to a working version.

rustc_no_colors

Activity

ehuss

ehuss commented on Nov 8, 2018

@ehuss
Contributor

I can confirm this happens on Windows 8, and can confirm it is caused by rust-lang/cargo#5862.
cc @kennytm, @alexcrichton

kennytm

kennytm commented on Nov 8, 2018

@kennytm
Member

Will cargo run --color=always enable the colors?

ehuss

ehuss commented on Nov 8, 2018

@ehuss
Contributor

--color=always does not seem to have an effect. It is passing --color=always to rustc, but for some reason rustc is not returning content with ANSI codes. If you run rustc manually on the command line, the colors seem to work.

added a commit that references this issue on Nov 8, 2018
255cc1a
alexcrichton

alexcrichton commented on Nov 8, 2018

@alexcrichton
Member

Thanks for the report @jminer! I think this'll get fixed by #55788

@kennytm I think we only tested msys shells earlier, right? I think we're hitting this branch of termcolor which I guess means that this is succeeding somehow. It's not entirely clear to me why that's all somehow not failing but I'm pretty sure that asking for AlwaysAnsi will do the trick

kennytm

kennytm commented on Nov 8, 2018

@kennytm
Member

@alexcrichton previously i did have tested on cmd.exe, but i haven't followed the recent changes which might have broken it

alexcrichton

alexcrichton commented on Nov 8, 2018

@alexcrichton
Member

Hm ok, that's worrisome! If #55788 doesn't do the trick I can try to investigate later, but it'll be quite awhile before I have a windows computer to test on again

added a commit that references this issue on Nov 8, 2018
de60b44
added a commit that references this issue on Nov 9, 2018
d293d1e
alexcrichton

alexcrichton commented on Nov 12, 2018

@alexcrichton
Member

For posterity there was some discussion of why this isn't actually fixed on nightly right now, and @kennytm has a PR to termcolor which should fix this

MSxDOS

MSxDOS commented on Jun 4, 2019

@MSxDOS

Any chance this is getting fixed in the nearest future?

mati865

mati865 commented on Jun 4, 2019

@mati865
Member

@MSxDOS I pinged termcolor author and he is reviewing PR mentioned above so this should get fixed on nightly soon.

kennytm

kennytm commented on Jun 4, 2019

@kennytm
Member

Nah we still need to go through the package release and update Cargo.lock processes 🙃

phansch

phansch commented on Jun 4, 2019

@phansch
Member

When this gets fixed, is there a possibility of adding some sort of UI test for this? This would be helpful for ensuring colors continue to work, when implementing #59346

moxian

moxian commented on Jun 22, 2019

@moxian
Contributor

termcolor-1.0.5 was released containing the fix.
I thought I'd update Cargo.lock and PR the change, but I've built rustc with termcolor-1.0.5. and I still can't see the rustc color output when run by cargo. So either I did something wrong when updating/rebuilding rustc, or BurntSushi/termcolor#10 didn't fix the issue...

ehuss

ehuss commented on Jun 22, 2019

@ehuss
Contributor

@moxian it should work, but there is a bug in Cargo where colors are not working correctly, so that's why I have not updated things here, yet. I filed kennytm/fwdansi#1 but I have not heard back from @kennytm, yet.

ehuss

ehuss commented on Jul 31, 2020

@ehuss
Contributor

This should be fixed on the latest nightly (2020-07-31) via rust-lang/cargo#8540 and #74923.

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

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ehuss@alexcrichton@kennytm@jminer@mati865

      Issue actions

        No console colors on Windows 7 · Issue #55769 · rust-lang/rust