Skip to content

Commit

Permalink
Add rxvt color support (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
KayLeung authored and sindresorhus committed Oct 18, 2017
1 parent d2e32f7 commit f82b61a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ let supportLevel = (() => {
return 2;
}

if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(env.TERM)) {
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}

Expand Down
6 changes: 6 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ test('return level 1 if `TEAMCITY_VERSION` is in env and is >= 9.1', t => {
t.is(result.level, 1);
});

test('support rxvt', t => {
process.env = {TERM: 'rxvt'};
const result = importFresh('.');
t.is(result.level, 1);
});

test('prefer level 2/xterm over COLORTERM', t => {
process.env = {COLORTERM: '1', TERM: 'xterm-256color'};
const result = importFresh('.');
Expand Down

0 comments on commit f82b61a

Please sign in to comment.