Skip to content

Commit

Permalink
readline: return old status from _setRawMode
Browse files Browse the repository at this point in the history
Return the previous raw mode setting from the internal `_setRawMode`
so that is easier to reset it to its original state later.

PR-URL: #6635
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
addaleax authored and Fishrock123 committed Jun 27, 2016
1 parent 14d3794 commit da1dffb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,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;
};


Expand Down

0 comments on commit da1dffb

Please sign in to comment.