-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
std::term needs better detection of color terminals #502
Comments
Which other contexts should it be able to detect? |
I was thinking it should use terminfo instead of a hardcoded list of color terminals. Also, if possible it should not write control characters when stdout/err are redirected. |
Fair. Wonder if pdcurses might make more sense than terminfo? The former knows its way around windows and some other unusual places. |
io::writer has a get_type method that uses isatty to determine if it's doing console output, but std::term doesn't use it. |
Cool stuff, I had not heard of pdcurses before. Seems like a potentially interesting project for a contributor to take on. But also probably need not distract core dev? Update: I did look at pdcurses while on vacation. It is seemed to be a strange beast; in particular, it advertises support for unusual places (windows, dos, etc), but the support for unix hosts appeared to be limited to just x11; I was not able to get it to target a non-x11 console on my XO's vt100 terminal (and thus you'd still need to use something like terminfo when you were not running atop x11). Does this jibe with others understandings of pdcurses, i.e., that it is not meant to be a uniform replacement for terminfo, but rather a configure-time selected alternative to terminfo? |
I'll take this on. I didn't even know rustc had colored output. |
This is fixed now. Any terminal advertising support for at least 16 colours is supported. |
add pipe2 to non-OSX BSD's rust-lang/libc#500
Update conditional-compilation.md
Made a mistake in rust-lang#502
* Update benchmark.yml
Conflicts: compiler/rustc_driver/src/lib.rs src/llvm-project (sub-module) src/tools/cargo (sub-module) src/tools/rust-analyzer (sub-module) Updates required: modified: compiler/rustc_codegen_rmc/src/compiler_interface.rs modified: compiler/rustc_codegen_rmc/src/context/goto_ctx.rs modified: compiler/rustc_codegen_rmc/src/overrides/stubs/rust_stubber.rs modified: compiler/rustc_monomorphize/src/collector.rs modified: src/test/rmc/Enum/result3.rs Note: We added a loop unwind option to rmc/Enum/result3.rs test. The merge uncovered an issue, filed here: rust-lang#540.
After the merge, the patterns.md file was modified and the code tested shifted one line. Update the dashboard props file to match the new location.
Right now it just checks the value of $TERM, leaving lots of users unable to see rustc's awesome colored errors
The text was updated successfully, but these errors were encountered: