mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
readline: fix behaviour of Interface plugged to a non-terminal output
Fixes: https://github.com/nodejs/node/issues/36773 PR-URL: https://github.com/nodejs/node/pull/36774 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
9d35b92c73
commit
fffdaeb4c9
2 files changed
+10
-3
No files matched your search
+3
-3
@@ -282,9 +282,6 @@ function Interface(input, output, completer, terminal) {
|
||||
input.on('keypress', onkeypress);
|
||||
input.on('end', ontermend);
|
||||
|
||||
// Current line
|
||||
this.line = '';
|
||||
|
||||
this._setRawMode(true);
|
||||
this.terminal = true;
|
||||
|
||||
@@ -300,6 +297,9 @@ function Interface(input, output, completer, terminal) {
|
||||
self.once('close', onSelfCloseWithTerminal);
|
||||
}
|
||||
|
||||
// Current line
|
||||
this.line = '';
|
||||
|
||||
input.resume();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
|
||||
const repl = require('repl');
|
||||
const r = repl.start({ terminal: false });
|
||||
r.setupHistory('/nonexistent/file', common.mustSucceed());
|
||||
process.stdin.unref?.();
|
||||
Reference in new issue
Block a user