Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 72d659a

Browse filesBrowse 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
Copy full SHA for 72d659a

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎lib/readline.js‎

Copy file name to clipboardExpand all lines: lib/readline.js
+5-1Lines 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+
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.