From d59df4792f17321577ef4ad22cb1a9df893e15f8 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Mon, 16 Mar 2026 20:05:33 -0400 Subject: [PATCH] fix redraw bug in component select --- pkg/component/prompt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/component/prompt.go b/pkg/component/prompt.go index 23dd59d..e541f78 100644 --- a/pkg/component/prompt.go +++ b/pkg/component/prompt.go @@ -220,8 +220,8 @@ func promptChoiceInteractive(name string, choices []Choice, defaultValue string, } func redrawInteractiveChoiceLines(lines []string, previousLineCount int) { - if previousLineCount > 1 { - fmt.Fprintf(os.Stdout, "\r\x1b[%dA", previousLineCount-1) + if previousLineCount > 0 { + fmt.Fprintf(os.Stdout, "\r\x1b[%dA", previousLineCount) } else { fmt.Fprint(os.Stdout, "\r") } @@ -231,7 +231,7 @@ func redrawInteractiveChoiceLines(lines []string, previousLineCount int) { fmt.Fprint(os.Stdout, "\x1b[1B\r") } } - if previousLineCount > 1 { + if previousLineCount > 0 { fmt.Fprintf(os.Stdout, "\x1b[%dA\r", previousLineCount-1) } else { fmt.Fprint(os.Stdout, "\r")