fix(installer): swap gum input --password for bash read -srp
`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).
This commit is contained in:
parent
abb67841f1
commit
63c5e199d9
1 changed files with 21 additions and 1 deletions
|
|
@ -150,10 +150,30 @@ prompt_input() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# prompt_password <header>
|
# prompt_password <header>
|
||||||
|
#
|
||||||
|
# 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() {
|
prompt_password() {
|
||||||
local header=$1
|
local header=$1
|
||||||
if [[ $TUI == gum ]]; then
|
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
|
else
|
||||||
whiptail --title "veilor-os" --passwordbox "$header" 10 60 \
|
whiptail --title "veilor-os" --passwordbox "$header" 10 60 \
|
||||||
3>&1 1>&2 2>&3
|
3>&1 1>&2 2>&3
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue