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

Color fix #3607

Merged
merged 2 commits into from
Jun 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions __tests__/reporters/console-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const stream = require('stream');
require('chalk').enabled = true;
require('chalk').supportsColor = true;
require('chalk').styles.blue.open = '\u001b[34m';
require('chalk').styles.bold.close = '\u001b[22m';

test('ConsoleReporter.step', async () => {
expect(
Expand Down
5 changes: 5 additions & 0 deletions src/reporters/console/console-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ const tty = require('tty');
type Row = Array<string>;
type InquirerResponses<K, T> = {[key: K]: Array<T>};

// fixes bold on windows
if (process.platform === 'win32' && process.env.TERM && !/^xterm/i.test(process.env.TERM)) {
chalk.styles.bold.close += '\u001b[m';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be submitted upstream to the chalk project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, sounds like we can remove this hack in the future, then.

}

export default class ConsoleReporter extends BaseReporter {
constructor(opts: Object) {
super(opts);
Expand Down