Skip to content

readline: readline.close() result in process.stdout is unexpected  #30701

@supperchong

Description

@supperchong
  • Version: v12.13.0
  • Platform: 64-bit (Windows)
  • Subsystem:
const readline = require("readline");

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
setTimeout(() => {
    rl.close();
}, 1000);
setInterval(() => {
    console.log('test')
}, 1000);

win10 output(empty)

linux output

test
test
...
const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

setTimeout(() => {
  rl.close();    // process.stdin.isRaw =false
  process.stdin.setRawMode(true); //stop at here
  console.log("asd");
}, 1000);

this code will block without any error

Metadata

Metadata

Assignees

No one assigned

    Labels

    readlineIssues and PRs related to the built-in readline module.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions