From 4d93f09fd6d59be2857d239840348df89a917721 Mon Sep 17 00:00:00 2001 From: Harshal Patel Date: Fri, 26 Jun 2026 04:35:11 +0530 Subject: [PATCH 1/2] fix(prompts): calculate multi-select vertical offsets using post-wrapped line counts --- packages/prompts/src/multi-select.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/prompts/src/multi-select.ts b/packages/prompts/src/multi-select.ts index e5db7069..0a94c5d2 100644 --- a/packages/prompts/src/multi-select.ts +++ b/packages/prompts/src/multi-select.ts @@ -170,7 +170,7 @@ export const multiselect = (opts: MultiSelectOptions) => { ) .join('\n'); // Calculate rowPadding: title lines + footer lines (error message + trailing newline) - const titleLineCount = title.split('\n').length; + const titleLineCount = title.split('\n').length - 1; const footerLineCount = footer.split('\n').length + 1; // footer + trailing newline return `${title}${prefix}${limitOptions({ output: opts.output, @@ -184,7 +184,7 @@ export const multiselect = (opts: MultiSelectOptions) => { } default: { const prefix = hasGuide ? `${styleText('cyan', S_BAR)} ` : ''; - const titleLineCount = title.split('\n').length; + const titleLineCount = title.split('\n').length - 1; const footerLines = showInstructions ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, hasGuide) : hasGuide From 62ce5a41fcaeedec20a5cf1262422310ac7a845e Mon Sep 17 00:00:00 2001 From: Harshal Patel Date: Fri, 26 Jun 2026 04:47:08 +0530 Subject: [PATCH 2/2] chore: add changeset for multiselect overflow fix --- .changeset/smooth-turtles-fix.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/smooth-turtles-fix.md diff --git a/.changeset/smooth-turtles-fix.md b/.changeset/smooth-turtles-fix.md new file mode 100644 index 00000000..c5a3491d --- /dev/null +++ b/.changeset/smooth-turtles-fix.md @@ -0,0 +1,5 @@ +--- +'@clack/prompts': patch +--- + +Fix terminal cursor line-tracking offsets in MultiSelectPrompt to prevent option text from visually overwriting itself on smaller displays.