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

Comments

Projects
None yet
5 participants
@brson
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

This comment has been minimized.

Show comment
Hide comment
@graydon

graydon Mar 5, 2012

Contributor

Which other contexts should it be able to detect?

Contributor

graydon commented Mar 5, 2012

Which other contexts should it be able to detect?

@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson Mar 5, 2012

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@graydon

graydon Mar 11, 2012

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@brson

brson Jul 31, 2012

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@pnkfelix

pnkfelix May 2, 2013

Member

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?

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?

@cmr

This comment has been minimized.

Show comment
Hide comment
@cmr

cmr May 13, 2013

Member

I'll take this on.

I didn't even know rustc had colored output.

Member

cmr commented May 13, 2013

I'll take this on.

I didn't even know rustc had colored output.

@thestinger

This comment has been minimized.

Show comment
Hide comment
@thestinger

thestinger Jun 6, 2013

Contributor

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

Contributor

thestinger commented Jun 6, 2013

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

@thestinger thestinger closed this Jun 6, 2013

keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment