From 6d86e00284f4453ecfb8f33ce9a80eeeb0e94fe8 Mon Sep 17 00:00:00 2001 From: veilor-org Date: Wed, 6 May 2026 10:30:06 +0100 Subject: [PATCH] fix(installer): swap gum input --password for bash read -srp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `gum input --password` corrupts the linux fbcon since v0.5.27 — the bubbletea screen-restore writes back the previous menu buffer because the framebuffer terminfo entry lacks `civis/cnorm` cursor-hide sequences, leaving a duplicate "Install" plus a stray "T" rendered on top of the password field. The fix is a single termios echo-off via `read -srp`: no redraw, no glitch, no dependency on gum's TUI layer for the one screen where it broke. Header still rendered through `gum style` so visual parity with the disk picker / confirm box is preserved. Whiptail fallback path unchanged (passwordbox there has always rendered cleanly). --- overlay/usr/local/bin/veilor-installer | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/overlay/usr/local/bin/veilor-installer b/overlay/usr/local/bin/veilor-installer index 999766a..52d0905 100644 --- a/overlay/usr/local/bin/veilor-installer +++ b/overlay/usr/local/bin/veilor-installer @@ -150,10 +150,30 @@ prompt_input() { } # prompt_password
+# +# v0.6: gum-path replaced with bash `read -srp` because `gum input +# --password` rendered as a duplicate-"Install" + stray-T artefact on +# the linux fbcon since v0.5.27 (Agent 7 of the v0.6 polish research +# wave traced this to gum's bubbletea screen-restore writing back the +# previous menu buffer when the framebuffer terminfo lacked +# `civis/cnorm` cursor-hide sequences). bash `read -srp` is a single +# write to stdout + termios echo-off — no redraw, no glitch. Header +# rendered separately via gum style for visual parity with the rest +# of the installer. prompt_password() { local header=$1 if [[ $TUI == gum ]]; then - gum input --password --header "$header" + # Render the prompt header as a styled box so it looks at home + # next to the other gum prompts, then collect the password via + # plain bash read on the next line. `read -s` disables echo, + # `read -p` writes the prompt to stderr (so command-substitution + # callers still get the password on stdout cleanly). + gum style --foreground "${VEILOR_FG:-15}" --border rounded \ + --border-foreground "${VEILOR_DIM:-240}" --padding "0 2" -- "$header" + local pw + read -srp " password: " pw + echo >&2 # newline after silent read so next prompt isn't on same line + printf '%s' "$pw" else whiptail --title "veilor-os" --passwordbox "$header" 10 60 \ 3>&1 1>&2 2>&3