tail = sourceText.slice(position);
// Colourize char if stdout supports colours
- if (tty) {
+ if (tty && !repl.disableColors) {
tail = tail.replace(/(.+?)([^\w]|$)/, '\033[32m$1\033[39m$2');
}
var context;
-var disableColors = true;
+exports.disableColors = true;
if (process.platform != 'win32') {
- disableColors = process.env.NODE_DISABLE_COLORS ? true : false;
+ exports.disableColors = process.env.NODE_DISABLE_COLORS ? true : false;
}
this.commands = {};
defineDefaultCommands(this);
- if (rli.enabled && !disableColors && exports.writer === util.inspect) {
+ if (rli.enabled && !exports.disableColors && exports.writer === util.inspect) {
// Turn on ANSI coloring.
exports.writer = function(obj, showHidden, depth) {
return util.inspect(obj, showHidden, depth, true);