Skip to content

Commit da1dffb

Browse files
addaleaxFishrock123
authored andcommitted
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: #6635 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 14d3794 commit da1dffb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/readline.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,13 @@ Interface.prototype.setPrompt = function(prompt) {
183183

184184

185185
Interface.prototype._setRawMode = function(mode) {
186+
const wasInRawMode = this.input.isRaw;
187+
186188
if (typeof this.input.setRawMode === 'function') {
187-
return this.input.setRawMode(mode);
189+
this.input.setRawMode(mode);
188190
}
191+
192+
return wasInRawMode;
189193
};
190194

191195

0 commit comments

Comments
 (0)