Computers · Program API v1.2.0
    Preparing search index...

    Function choose

    • Present choices navigable with arrow keys, Enter, or a click.

      Parameters

      • label: string

        Prompt text, limited to 512 characters.

      • choices: string[]

        Array of 1–8 nonempty strings, each at most 128 characters.

      Returns Promise<string>

      The selected label, not an index; rejects for invalid choices or cancellation.

      const route = await terminal.choose("Destination:", ["Archive", "Comms"]);
      terminal.writeLine(`Opening ${route}.`);