-
Notifications
You must be signed in to change notification settings - Fork 449
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
fixed support-colors condition orders, this should fix cygwin issues #154
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,10 +37,6 @@ module.exports = (function () { | |
return true; | ||
} | ||
|
||
if (process.stdout && !process.stdout.isTTY) { | ||
return false; | ||
} | ||
|
||
if (process.platform === 'win32') { | ||
return true; | ||
} | ||
|
@@ -49,12 +45,16 @@ module.exports = (function () { | |
return true; | ||
} | ||
|
||
if (process.env.TERM === 'dumb') { | ||
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { | ||
return true; | ||
} | ||
|
||
if (process.stdout && !process.stdout.isTTY) { | ||
return false; | ||
} | ||
|
||
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { | ||
return true; | ||
if (process.env.TERM === 'dumb') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switching the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was done on purpose since if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { is moved to below if ('COLORTERM' in process.env) { and moved ontop of if (process.stdout && !process.stdout.isTTY) { But this change does something since it now works in windows, and Linux. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This last check could not be omitted because it is the default anyway. |
||
} | ||
|
||
return false; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this check below all the others means this will create messy text files when redirecting the output to a text file via
>output.txt
. If this happens will then depend on the platform.win32
for example will have this problem, other platforms may not, depending on the order of the checks below.