Cotal TypeScript packages
    Preparing search index...

    Function untilInputEnds

    • Ask one clack prompt that ends when its input does. Ctrl-D on an empty line closes clack's own readline without settling the prompt, and so does a closed stdin; the process then drains and exits 13 with Node's unsettled top-level await warning. Both are answered here as the cancel Ctrl-C gives, so the caller's own cancelled branch reports and exits.

      A Ctrl-D is acted on only after every keypress listener ran and only when it left the input paused, which is what a closed readline does. Mid-line it deletes, as readline has it.

      Type Parameters

      • T

      Parameters

      • ask: (signal: AbortSignal) => Promise<symbol | T>
      • input: Readable = process.stdin

      Returns Promise<symbol | T>