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

Add rxvt color support #67

Merged
merged 2 commits into from
Oct 18, 2017
Merged

Add rxvt color support #67

merged 2 commits into from
Oct 18, 2017

Conversation

KayLeung
Copy link
Contributor

@sindresorhus
Copy link
Member

What does echo $TERM output? Can you add a test? Like

supports-color/test.js

Lines 215 to 219 in d2e32f7

test('support putty-256color', t => {
process.env = {TERM: 'putty-256color'};
const result = importFresh('.');
t.is(result.level, 2);
});

The text you linked to says that rxvt-unicode is compiled with colors by default, but that doesn't nessecarily mean all rxvt emulators are. Your regex seems a bit loose, unless you can confirm all versions supports colors.

@irfinnew
Copy link

+1 from another rxvt-unicode user.

$TERM is simply rxvt.

The text you linked to says that rxvt-unicode is compiled with colors by default, but that doesn't nessecarily mean all rxvt emulators are. Your regex seems a bit loose, [...]

That applies to pretty much every terminal in that regular expression ;)

Using screen does not imply that the terminal you're viewing screen in supports colors. xterm can be compiled without colors. There's no guarantee the Linux console has colors. So this regular expression is best-effort anyway. If certainty is important, then I suggest using termcap instead of $TERM sniffing.

Anyway, I've used rxvt and derivatives (aterm, Eterm, rxvt-unicode) for about 15 years, and I've never encountered an instance without color support. Meanwhile, NodeJS tools think my terminal can't do color, while it most certainly can.

@sindresorhus
Copy link
Member

Alright. This still needs a test though.

@sindresorhus sindresorhus changed the title Added rxvt color support Add rxvt color support Oct 18, 2017
@sindresorhus sindresorhus merged commit f82b61a into chalk:master Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants