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>
This commit is contained in:
parent
0815b9401d
commit
dc57b9e78f
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user