Skip to content

Commit dd9aab0

Browse files
rubenfiszelc4spar
andauthoredSep 28, 2024
fix(prompt): increase buffer size of input prompts for nodejs to allow 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>
1 parent 62fa792 commit dd9aab0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎prompt/_generic_prompt.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Cursor } from "@cliffy/ansi/cursor-position";
22
import { type Tty, tty } from "@cliffy/ansi/tty";
3+
import { getRuntimeName } from "@cliffy/internal/runtime/runtime-name";
34
import { type KeyCode, parse } from "@cliffy/keycode";
45
import {
56
bold,
@@ -363,7 +364,7 @@ export abstract class GenericPrompt<
363364

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

369370
if (isTty) {

0 commit comments

Comments
 (0)
Failed to load comments.