File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ var fs = require("fs");
2020var rl = require ( 'readline' ) ;
2121var context ;
2222
23+ var disableColors = process . env . NODE_DISABLE_COLORS ? true : false ;
24+
2325function cwdRequire ( id ) {
2426 if ( id . match ( / ^ \. \. \/ / ) || id . match ( / ^ \. \/ / ) ) {
2527 id = path . join ( process . cwd ( ) , id ) ;
@@ -54,7 +56,7 @@ function REPLServer(prompt, stream) {
5456 return self . complete ( text ) ;
5557 } ) ;
5658
57- if ( rli . enabled ) {
59+ if ( rli . enabled && ! disableColors ) {
5860 // Turn on ANSI coloring.
5961 exports . writer = function ( obj , showHidden , depth ) {
6062 return sys . inspect ( obj , showHidden , depth , true ) ;
Original file line number Diff line number Diff line change @@ -1746,6 +1746,7 @@ static void PrintHelp() {
17461746 " NODE_DEBUG Print additional debugging output.\n "
17471747 " NODE_MODULE_CONTEXTS Set to 1 to load modules in their own\n "
17481748 " global contexts.\n "
1749+ " NODE_DISABLE_COLORS Set to 1 to disable colors in the REPL\n "
17491750 " \n "
17501751 " Documentation can be found at http://nodejs.org/api.html"
17511752 " or with 'man node'\n " );
You can’t perform that action at this time.
0 commit comments