From 8f7c4f250fc32c60fc80ce232dcea77efa63a17e Mon Sep 17 00:00:00 2001 From: Salman Aljammaz Date: Mon, 8 Jul 2013 15:45:14 +0100 Subject: [PATCH] tty: no readline when TERM==dumb To stop the REPL from spitting ANSI control codes on terminals which don't support them. (Fixes #5344) --- src/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node.js b/src/node.js index 02aee1708c4f..197d2aac9a89 100644 --- a/src/node.js +++ b/src/node.js @@ -142,7 +142,8 @@ useGlobal: true, ignoreUndefined: false }; - if (parseInt(process.env['NODE_NO_READLINE'], 10)) { + if (parseInt(process.env['NODE_NO_READLINE'], 10) || + process.env['TERM'] === 'dumb') { opts.terminal = false; } if (parseInt(process.env['NODE_DISABLE_COLORS'], 10)) {