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

std::term needs better detection of color terminals #502

Closed
brson opened this issue Jun 15, 2011 · 7 comments
Closed

std::term needs better detection of color terminals #502

brson opened this issue Jun 15, 2011 · 7 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@brson
Copy link
Contributor

brson commented Jun 15, 2011

Right now it just checks the value of $TERM, leaving lots of users unable to see rustc's awesome colored errors

@graydon
Copy link
Contributor

graydon commented Mar 5, 2012

Which other contexts should it be able to detect?

@brson
Copy link
Contributor Author

brson commented Mar 5, 2012

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.

@graydon
Copy link
Contributor

graydon commented Mar 11, 2012

Fair. Wonder if pdcurses might make more sense than terminfo? The former knows its way around windows and some other unusual places.

@brson
Copy link
Contributor Author

brson commented Jul 31, 2012

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.

@pnkfelix
Copy link
Member

pnkfelix commented May 2, 2013

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?

@emberian
Copy link
Member

I'll take this on.

I didn't even know rustc had colored output.

@thestinger
Copy link
Contributor

This is fixed now. Any terminal advertising support for at least 16 colours is supported.

keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
Update conditional-compilation.md
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

5 participants