diff options
author | Anna Henningsen <anna@addaleax.net> | 2016-05-08 03:29:43 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2016-06-18 20:44:21 +0200 |
commit | dc57b9e78fa0c64ce83c1e54a01e95fccb88e301 (patch) | |
tree | 73f5fa39b5aa9e89e987107bafbcdadf3c950626 /lib/readline.js | |
parent | 0815b9401d087202cd64458b6906a5225929fc5d (diff) | |
download | android-node-v8-dc57b9e78fa0c64ce83c1e54a01e95fccb88e301.tar.gz android-node-v8-dc57b9e78fa0c64ce83c1e54a01e95fccb88e301.tar.bz2 android-node-v8-dc57b9e78fa0c64ce83c1e54a01e95fccb88e301.zip |
readline: return old status from _setRawMode
Return the previous raw mode setting from the internal `_setRawMode`
so that is easier to reset it to its original state later.
PR-URL: https://github.com/nodejs/node/pull/6635
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/readline.js')
-rw-r--r-- | lib/readline.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/readline.js b/lib/readline.js index ee2fe1de86..957bb81758 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; }; |