Skip to content

CTRL-C does not quit readline when in infinte loop #40140

Open
@xieyuheng

Description

@xieyuheng

Version

v16.9.1

Platform

Linux cicada 5.14.5-arch1-1 #1 SMP PREEMPT Thu, 16 Sep 2021 11:02:40 +0000 x86_64 GNU/Linux

Subsystem

readline

What steps will reproduce the bug?

const readline = require("readline")

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


rl.on("line", (line) => {
  while (true) {
    // infinte loop
  }
})

How often does it reproduce? Is there a required condition?

always

What is the expected behavior?

CTRL-C should quit readline when in infinte loop

What do you see instead?

CTRL-C does not quit readline when in infinte loop

Additional information

The same issue of the repl code module is fixed: #6612

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions