Skip to content

Commit 72d659a

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 d049919 commit 72d659a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎lib/readline.js‎

Lines changed: 5 additions & 1 deletion
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+
constwasInRawMode=this.input.isRaw;
187+
186188
if(typeofthis.input.setRawMode==='function'){
187-
returnthis.input.setRawMode(mode);
189+
this.input.setRawMode(mode);
188190
}
191+
192+
returnwasInRawMode;
189193
};
190194

191195

0 commit comments

Comments
 (0)