Prime sudo up front (sudo -v) — password prompt no longer lands mid-line

First sudo call of the session printed its password prompt straight
into the live progress line: 'Installing (optional): gum[sudo]
password for yuri:' (VM screenshot). sudo -v asks once, on a clean
screen, right after the banner; the timestamp refreshes on every later
sudo use, so one prompt covers the whole run.
This commit is contained in:
Pathfinder
2026-10-27 19:37:20 +01:00
parent a54f14018e
commit 0050f3a4a8
+8
View File
@@ -103,6 +103,14 @@ if [[ ${EUID} -eq 0 ]]; then
exit 1
fi
# Ask for the sudo password ONCE, up front, on a clean screen. Otherwise the
# first sudo call mid-run prints its prompt straight into the live progress
# line ("Installing (optional): gum[sudo] password for yuri:" — VM-proven).
# The timestamp refreshes on every subsequent sudo use, so one prompt covers
# the whole run.
info "Requesting sudo credentials (asked once for the whole run)..."
sudo -v
if [[ "$ASSUME_YES" == "true" && ( -z "$DE" || -z "$TWM" ) ]]; then
err "--yes requires explicit --de and --twm, so nothing is guessed on an"
err "unattended run. Example:"