GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — readline: fix behaviour of Interface plugged to a non-terminal output · nodejs/node@b17130a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • readline.js
  • test/parallel
    • test-repl-no-terminal.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/readline.js‎

Copy file name to clipboardExpand all lines: lib/readline.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ function Interface(input, output, completer, terminal) {
274274
input.on('keypress', onkeypress);
275275
input.on('end', ontermend);
276276

277-
// Current line
278-
this.line = '';
279-
280277
this._setRawMode(true);
281278
this.terminal = true;
282279

@@ -292,6 +289,9 @@ function Interface(input, output, completer, terminal) {
292289
self.once('close', onSelfCloseWithTerminal);
293290
}
294291

292+
// Current line
293+
this.line = '';
294+
295295
input.resume();
296296
}
297297

Collapse file

‎test/parallel/test-repl-no-terminal.js‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
const repl = require('repl');
5+
const r = repl.start({ terminal: false });
6+
r.setupHistory('/nonexistent/file', common.mustSucceed());
7+
process.stdin.unref?.();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.