Skip to content

Commit

Permalink
debugger: disable colours on win32
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Sep 27, 2011
1 parent 040cf02 commit 1a832a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/_debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ var util = require('util'),
inherits = util.inherits,
spawn = require('child_process').spawn;

var disableColors = true;
if (process.platform != 'win32') {
disableColors = process.env.NODE_DISABLE_COLORS ? true : false;
}

exports.start = function(argv, stdin, stdout) {
argv || (argv = process.argv.slice(2));

Expand Down Expand Up @@ -670,7 +675,7 @@ function SourceUnderline(sourceText, position, tty) {
tail = sourceText.slice(position);

// Colourize char if stdout supports colours
if (tty) {
if (tty && !disableColors) {
tail = tail.replace(/(.+?)([^\w]|$)/, '\033[32m$1\033[39m$2');
}

Expand Down

0 comments on commit 1a832a0

Please sign in to comment.