Skip to content

Commit

Permalink
fix(prompt): increase buffer size of input prompts for nodejs to allo…
Browse files Browse the repository at this point in the history
…w paste of more than 8 chars (#739)

Co-authored-by: Benjamin Fischer <c4spar@gmx.de>
Co-authored-by: Benjamin Fischer <61995275+c4spar@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 28, 2024
1 parent 62fa792 commit dd9aab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prompt/_generic_prompt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Cursor } from "@cliffy/ansi/cursor-position";
import { type Tty, tty } from "@cliffy/ansi/tty";
import { getRuntimeName } from "@cliffy/internal/runtime/runtime-name";
import { type KeyCode, parse } from "@cliffy/keycode";
import {
bold,
Expand Down Expand Up @@ -363,7 +364,7 @@ export abstract class GenericPrompt<

/** Read user input from stdin. */
#readChar = async (): Promise<Uint8Array> => {
const buffer = new Uint8Array(8);
const buffer = new Uint8Array(getRuntimeName() === "deno" ? 8 : 4096);
const isTty = this.settings.reader.isTerminal();

if (isTty) {
Expand Down

0 comments on commit dd9aab0

Please sign in to comment.