Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Request ansi colors if stderr isn't a tty #55788

Merged
merged 1 commit into from
Nov 9, 2018

Commits on Nov 8, 2018

  1. rustc: Request ansi colors if stderr isn't a tty

    Currently Cargo will always capture the output of rustc meaning that
    rustc is never hooked up to a tty. To retain colors Cargo uses the
    `fwdansi` crate to ensure that ansi color codes are translated to
    windows terminal methods (and ansi codes otherwise just go their natural
    route on Unix).
    
    Cargo passes `--color always` to rustc to ensure that using a pipe
    doesn't trick it into not emitting colors at all. It turns out, however,
    that `--color always` ends up still accidentally using the native shell
    api on native windows shells.
    
    The fix here is to instead pass `AlwaysAnsi` to `termcolor` instead of
    `Always`, ensuring that when `--color always` is passed to rustc and its
    output isn't a terminal, we're always generating ansi colors regardless
    of the platform.
    
    Closes rust-lang#55769
    alexcrichton committed Nov 8, 2018
    Configuration menu
    Copy the full SHA
    255cc1a View commit details
    Browse the repository at this point in the history