Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

detect isatty

  • Loading branch information...
commit 86fd5abc060131e321c02c9ed42c32b7443dc1bd 1 parent fb59579
Hsiaoming Yang authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/color.js
View
8 lib/color.js
@@ -6,13 +6,15 @@
*
*/
-//var tty = require('tty')
+var tty = require('tty');
var os = require('os');
var codes = {};
+exports.isatty = false;
+
function isColorSupported() {
- // support for child process
- // if (!tty.isatty()) return false;
+ // you can force to tty
+ if (!exports.isatty && !tty.isatty()) return false;
if ('COLORTERM' in process.env) return true;
// windows will support color
Please sign in to comment.
Something went wrong with that request. Please try again.