-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 does not emit color output even with --color always with TERM=tmux-256color #45728
Comments
I have a similar bug on Archlinux. I used to get colored output on this system, but that recently stopped working for rustc. (Cargo is still fine for me.) If I add https://github.com/mirror/ncurses/blob/v6.1/NEWS#L93-L110 @alexcrichton Could rustc switch to whatever Cargo uses for colored terminal output? |
A work-around for my machine was temporarily downgrading the |
Yes rustc should be able to switch at any time |
Thanks @SimonSapin for the workaround! |
Changing |
Another work-around if you're using sh:
This sets |
This crate moves the compiler's error reporting to using the `termcolor` crate from crates.io. Previously rustc used a super-old version of the `term` crate in-tree which is basically unmaintained at this point, but Cargo has been using `termcolor` for some time now and tools like `rg` are using `termcolor` as well, so it seems like a good strategy to take! Note that the `term` crate remains in-tree for libtest. Changing libtest will be a bit tricky due to how the build works, but we can always tackle that later. cc rust-lang#45728
rustc: Migrate to `termcolor` crate from `term` This crate moves the compiler's error reporting to using the `termcolor` crate from crates.io. Previously rustc used a super-old version of the `term` crate in-tree which is basically unmaintained at this point, but Cargo has been using `termcolor` for some time now and tools like `rg` are using `termcolor` as well, so it seems like a good strategy to take! Note that the `term` crate remains in-tree for libtest. Changing libtest will be a bit tricky due to how the build works, but we can always tackle that later. cc rust-lang#45728
@SimonSapin That worked for me as well. I had no colour with |
This crate moves the compiler's error reporting to using the `termcolor` crate from crates.io. Previously rustc used a super-old version of the `term` crate in-tree which is basically unmaintained at this point, but Cargo has been using `termcolor` for some time now and tools like `rg` are using `termcolor` as well, so it seems like a good strategy to take! Note that the `term` crate remains in-tree for libtest. Changing libtest will be a bit tricky due to how the build works, but we can always tackle that later. cc rust-lang#45728
rustc: Migrate to `termcolor` crate from `term` This crate moves the compiler's error reporting to using the `termcolor` crate from crates.io. Previously rustc used a super-old version of the `term` crate in-tree which is basically unmaintained at this point, but Cargo has been using `termcolor` for some time now and tools like `rg` are using `termcolor` as well, so it seems like a good strategy to take! Note that the `term` crate remains in-tree for libtest. Changing libtest will be a bit tricky due to how the build works, but we can always tackle that later. cc rust-lang#45728
I have a similar issue: In my regular terminal emulator (not tmux), there are no colors from rustc (as executed with Inside tmux however, colors work just fine, |
Colors are fixed in the latest nightly (thanks to #48588 \o/) |
This is fixed for me in today’s nigthly, presumably by #48588. |
With the current nightly I still have no colors with |
Terminal colors are still broken with |
@IsaacWoods It works fine for me with ncurses 6.1, even rustup has colors again since the last version 🎉. |
I'm using ncurses 6.1 on Fedora 28 and everything appears to be working fine except for test colors. In #48588 @alexcrichton mentioned that
What is the barrier to migrating libtest from For now, it's leaving my test output looking like this. |
I have an in-progress patch for libtest but I ran into
I'm guessing that's the build issue that @alexcrichton is referring to. I don't know how linking libtest works, but I'm happy to try to fix the build if someone can point me in the right direction. |
libterm: parse extended terminfo format Fixes rust-lang#45728. Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions. The ideal fix for this would be to migrate libtest to use `termcolor` (rust-lang#60349), but that's blocked for the foreseeable future.
libterm: parse extended terminfo format Fixes rust-lang#45728. Modifies libterm to parse the extended terminfo format introduced in ncurses 6.1. This fixes the lack of color in test output for users with newer ncurses versions. The ideal fix for this would be to migrate libtest to use `termcolor` (rust-lang#60349), but that's blocked for the foreseeable future.
rustc
does not emit color output when running under a tmux session withTERM
set correctly totmux-256color
(supported by the latest versions of ncurses) even withcargo +nightly build --color=always
whenTERM
is set totmux-256color
. On the machine in question (macOS) the term file fortmux-256color
is installed andinfocmp
returns the following:Per rust-lang/cargo#2877 cargo should be invoking rustc with the
--color always
flag, and indeed,cargo rustc --color always -- --color always
returns 'Option color given more than once`.Executing
env TERM=xterm-256color cargo build
also does not produce color output, butenv TERM=xterm-256color cargo build --color always
does.The text was updated successfully, but these errors were encountered: