From 4c882f677fdef2d01486f8f4d130385498f9a775 Mon Sep 17 00:00:00 2001 From: n1203 <30693884+n1203@users.noreply.github.com> Date: Mon, 15 Dec 2025 23:37:40 +0800 Subject: [PATCH] fix: Add confirmation prompt for empty password in Windows VM setup When user presses Enter without entering a password, prompt with confirmation dialog to either use default password or retry entering a custom password. This prevents accidental use of default password when user expects to enter password input mode. - Wrap password input in validation loop with explicit confirmation - On decline, re-prompt for password entry instead of proceeding - Update placeholder text to clarify behavior --- bin/omarchy-windows-vm | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/bin/omarchy-windows-vm b/bin/omarchy-windows-vm index 3ef9eb1102..53cb37a908 100755 --- a/bin/omarchy-windows-vm +++ b/bin/omarchy-windows-vm @@ -140,13 +140,25 @@ EOF USERNAME="docker" fi - PASSWORD=$(gum input --placeholder="Password (Press enter to use default: admin)" --password --header="Enter Windows password:") - if [ -z "$PASSWORD" ]; then - PASSWORD="admin" - PASSWORD_DISPLAY="(default)" - else - PASSWORD_DISPLAY="(user-defined)" - fi + # Password input with validation loop + while true; do + PASSWORD=$(gum input --placeholder="Enter password (leave empty to use default 'admin' with confirmation)" --password --header="Enter Windows password:") + + if [ -z "$PASSWORD" ]; then + # If password is empty, ask user what they want to do + if gum confirm "Use default password 'admin'?"; then + PASSWORD="admin" + PASSWORD_DISPLAY="(default)" + break + else + # User wants to enter a password, loop again + continue + fi + else + PASSWORD_DISPLAY="(user-defined)" + break + fi + done # Display configuration summary gum style \