automated_script: drain stale tty input + drop redundant stdin redirect

Fix the ^[[13;1R cursor-position-report artifacts visible next to the
first configurator step. archiso's boot init leaves DSR responses in the
kernel tty input buffer; the first gum invocation reads them as stray
input and echoes them as visible escape sequences.

- Drain stdin (with a short timeout) from /dev/tty before configurator
  runs so any pending replies are consumed.
- Drop the explicit </dev/tty stdin redirect — the parent script's
  stdin is already tty1 (inherited from archiso autostart), and the
  explicit redirect opened a new fd with subtly different termios.
This commit is contained in:
Ryan Hughes committed 2026-05-21 19:51:35 -04:00
1 parent 22f94e6da6
commit c1828b13ad
1 file changed
+7 -1
+7 -1
View File
@@ -36,8 +36,14 @@ fi
# Configurator phase: real TTY on both streams. No tee/pipe.
mkdir -p /var/log
touch "$OMARCHY_INSTALL_LOG_FILE"
# Drain any stale terminal input (e.g., cursor-position-report responses left
# in the kernel tty input buffer by archiso's boot init). If we don't, the
# first gum invocation can echo them as visible "^[[13;1R" artifacts.
while IFS= read -r -t 0 -n 1024 _drain </dev/tty 2>/dev/null; do :; done
cd /root
./configurator >/dev/tty 2>/dev/tty </dev/tty
./configurator >/dev/tty 2>/dev/tty
# Install phase: now safe to capture output to the install log. Strip CSI
# escapes so the log file is readable. Keep stderr going to the log too so