1
0

Clear the input buffer when asking for confirmation in the setup script

This commit is contained in:
2025-10-13 11:53:35 +02:00
parent 452ce614ef
commit b25a30615b

View File

@@ -24,8 +24,12 @@ trap 'echo -e "\n\033[1;31mError: Script \"$SCRIPT_PATH\" failed at line $LINENO
# </init> # </init>
# <core> # <core>
# Ask for confirmation before running the script
while true; do while true; do
read -p "Do you want to run the setup script? [Y/n]: " -n 1 -r REPLY read -p "Do you want to run the setup script? [Y/n]: " -n 1 -r REPLY
# Clear the input buffer and add a newline
while read -t 0.001 TMP; do continue; done
echo echo
# Convert to lowercase and default to 'y' if empty # Convert to lowercase and default to 'y' if empty