diff --git a/lib/readline.js b/lib/readline.js index ee2fe1de86e..957bb817580 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -182,9 +182,13 @@ Interface.prototype.setPrompt = function(prompt) { Interface.prototype._setRawMode = function(mode) { + const wasInRawMode = this.input.isRaw; + if (typeof this.input.setRawMode === 'function') { - return this.input.setRawMode(mode); + this.input.setRawMode(mode); } + + return wasInRawMode; };