Skip to content

Consecutive @inquirer/prompts select() calls hang on second prompt since 2.7.5 #32782

@dahlia

Description

@dahlia

Since Deno 2.7.5, calling @inquirer/prompts's select() more than once in sequence causes the process to hang. The first prompt works fine, but the second prompt never receives input. This worked correctly in 2.7.1.

Reproduction

import { select } from "npm:@inquirer/prompts@7.10.1";

const a = await select({
  message: "Q1",
  choices: [{ name: "A", value: "a" }, { name: "B", value: "b" }],
});
console.log("A:", a);

const b = await select({
  message: "Q2",
  choices: [{ name: "X", value: "x" }, { name: "Y", value: "y" }],
});
console.log("B:", b);
$ deno run --allow-all repro.ts

Select an option for Q1 and press Enter: Q2 appears but hangs, ignoring all keyboard input.

Versions

  • Broken: Deno 2.7.5 (both deno run and deno compile)
  • Working: Deno 2.7.1

Tested on macOS 26.1 (aarch64).

Likely cause

This is probably a side effect of one (or both) of:

  • fix(ext/node): make TTY stdout/stderr indestructible #32530 — made TTY stdout/stderr indestructible. @inquirer/core creates a MuteStream piped to process.stdout for each prompt and calls output.end() + rl.close() on completion. The indestructible stdout change may leave the stream or pipe in a state that prevents the next readline interface from receiving stdin events.
  • fix(ext/node): multiple readline improvements #32538 — added ERR_USE_AFTER_CLOSE guard to readline.write(). This could interfere with cleanup between consecutive prompts if a write lands after close().

Both PRs were shipped in 2.7.5, which lines up with the regression window.

Context

This breaks any CLI tool that uses @inquirer/prompts for multi-step interactive flows. We hit this in Fedify CLI where fedify init asks several questions in sequence—the Homebrew distribution (built with deno compile) hangs after the first prompt (see fedify-dev/fedify#623).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions