Permalink
Browse files

detect isatty

  • Loading branch information...
Hsiaoming Yang
Hsiaoming Yang committed Dec 27, 2012
1 parent fb59579 commit 86fd5abc060131e321c02c9ed42c32b7443dc1bd
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/color.js
View
@@ -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

0 comments on commit 86fd5ab

Please sign in to comment.