From 38d4e02feb01fb01b84e407901b30d269c2c0c86 Mon Sep 17 00:00:00 2001 From: Roy Osherove Date: Sun, 23 Aug 2026 20:45:19 +0000 Subject: [PATCH] fix(wizard): pass --default=no so default_no prompts actually preselect No MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `confirm()` and `toggle()` only passed an explicit flag on their affirmative branch; the negative branch called `gum confirm` bare. gum's `--default` is a bool declared `default:"true"` (confirm/options.go), and confirm/command.go seeds `choice := o.Default`, so omitting the flag preselects Yes. Every `default_no` prompt was therefore landing on Yes — the opposite of its stated default — and a user pressing Enter opted IN. Affected prompts: - "Protect WebUI with Cognito login? (enterprise-grade)" (:2150) - "Connect KiroCrew to Telegram? ..." (:3411) `toggle()` had the same inversion for any caller passing a false default. Both helpers now pass --default=no explicitly, so neither branch depends on gum's implicit value. bash -n install.sh / uninstall.sh: OK. shellcheck --severity=error: 0 findings. No remaining `$GUM confirm` call site relies on the implicit default. --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 482760e..abd5207 100755 --- a/install.sh +++ b/install.sh @@ -998,7 +998,10 @@ confirm() { if [[ "$default" == "default_yes" ]]; then $GUM confirm --default=yes "$text" < /dev/tty || rc=$? else - $GUM confirm "$text" < /dev/tty || rc=$? + # --default=no is REQUIRED, not redundant: gum's --default is a bool that + # defaults to true, so omitting it preselects Yes and silently inverts every + # default_no prompt. + $GUM confirm --default=no "$text" < /dev/tty || rc=$? fi [[ $rc -eq 130 ]] && { echo ""; cleanup_on_interrupt; } return $rc @@ -1014,7 +1017,7 @@ toggle() { if [[ "$default" == "true" ]]; then $GUM confirm --default=yes " $text" < /dev/tty || rc=$? else - $GUM confirm " $text" < /dev/tty || rc=$? + $GUM confirm --default=no " $text" < /dev/tty || rc=$? fi [[ $rc -eq 0 ]] && printf -v "$var" '%s' "true" || printf -v "$var" '%s' "false" }