From de41c0731edc04c74f4a28f76c0714b6a4c71f8b Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Sun, 4 Jan 2026 15:51:05 -0500 Subject: [PATCH] Fix input prompt dropping issue in sanitize script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add input buffer flush before each read prompt to prevent leftover keystrokes from auto-answering prompts. Also add small delay before reboot/shutdown prompts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- rpi/sanitize-for-image.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpi/sanitize-for-image.sh b/rpi/sanitize-for-image.sh index 58481cb..512e1f6 100755 --- a/rpi/sanitize-for-image.sh +++ b/rpi/sanitize-for-image.sh @@ -104,6 +104,8 @@ fi echo "" if [ "$AUTO_REBOOT" = false ]; then + # Flush input buffer before prompt + read -t 0.1 -n 10000 discard /dev/null || true read -p "Continue? This cannot be undone! [y/N] " -n 1 -r /dev/null || true + sleep 0.3 read -p "Reboot now? [y/N] " -n 1 -r /dev/null || true + sleep 0.3 read -p "Shut down now? [y/N] " -n 1 -r