added flush stdout to ask function

This commit is contained in:
Jürg Hallenbarter
2026-01-26 09:10:37 +00:00
parent 67d75289bb
commit c2777be4a3

View File

@@ -26,11 +26,16 @@ ask_app() {
local label="$1"
local default="$2"
local app
while true; do
# Print prompt and flush stdout
printf "%s (default: %s): " "$label" "$default"
fflush
read -r app
app="${app:-$default}"
# check if command exists
if command -v "${app%% *}" >/dev/null 2>&1; then
echo "$app"
return
@@ -41,6 +46,12 @@ ask_app() {
done
}
# Helper function to flush stdout
fflush() {
:
}
# ----------------------------
# Installer
# ----------------------------