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

(Windows) Consider using standard color scheme when term is xterm like #59

Closed
weikinhuang opened this issue Mar 21, 2015 · 8 comments
Closed

Comments

@weikinhuang
Copy link
Contributor

perhaps check for:

process.platform === 'win32' && !process.env.TERM
or
process.platform === 'win32' && !(/xterm/).test(process.env.TERM || "")

I am suggesting this because I use node through a solarized color shell (admittedly through cygwin ssh).

Thanks.

@shinnn
Copy link

shinnn commented Apr 12, 2015

@weikinhuang Why current version doesn't meet your requirements? Current / expected screenshot is very welcome.

@weikinhuang
Copy link
Contributor Author

Sure thing, here's the screenshot (using SecureCRT, with xterm-256 emulator mode):

image

"use strict";

const chalk = require("chalk");

[ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "gray" ].forEach(function(color) {
    process.stdout.write(chalk[color](color) + " ");
});
process.stdout.write("\n");

[ "bgBlack", "bgRed", "bgGreen", "bgYellow", "bgBlue", "bgMagenta", "bgCyan", "bgWhite" ].forEach(function(color) {
    process.stdout.write(chalk[color](color) + " ");
});
process.stdout.write("\n");

@shinnn
Copy link

shinnn commented Apr 14, 2015

I say again:

Why current version doesn't meet your requirements?

The screenshot looks good to me.

@weikinhuang
Copy link
Contributor Author

Ah, sorry.
Since I'm on a xterm console (instead of cmd or something) I expect that blue would show up as blue and not a grey color even though I'm on windows.

The following would be the expected behavior:
image

I'm specifically referring to the blue foreground text color.

@shinnn
Copy link

shinnn commented Apr 14, 2015

Ah, OK. You meant that chalk should disable these lines on the terminals with solarized color theme?

@weikinhuang
Copy link
Contributor Author

Ya, but not necessarily with a solarized theme, but terminals that supports proper colors.

@kevva
Copy link
Contributor

kevva commented Apr 17, 2015

Can you send a PR?

@weikinhuang
Copy link
Contributor Author

PR sent, I couldn't decide if I should test against xterm or dumb terminal (that's what cmd.exe reports in process.env.TERM).

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 a pull request may close this issue.

3 participants