From a5a7110beae053800692c5bda692a2cd91aee05e Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Thu, 21 May 2026 20:34:21 -0400 Subject: [PATCH] configurator: drain tty input after each step() title gum's TUI startup queries the terminal (e.g., cursor position via CSI 6n) and doesn't always read the reply. The reply bytes ("^[[13;1R") then surface visibly next to the next step title. A one-time drain at script start (in .automated_script.sh) catches the boot-time replies but not the gum-per-call ones, since the artifact came back at every new step(). Add a small _drain_tty helper and call it from step() after the title gum-style invocation so any pending DSR replies are consumed before the next prompt runs. --- configs/airootfs/root/configurator | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configs/airootfs/root/configurator b/configs/airootfs/root/configurator index 470da96..dbd6183 100644 --- a/configs/airootfs/root/configurator +++ b/configs/airootfs/root/configurator @@ -13,10 +13,18 @@ abort() { exit 1 } +# Drain any pending terminal-reply bytes (cursor position reports, etc.) +# that gum's TUI startup sends but doesn't always consume. Without this, +# bytes like ^[[13;1R show up next to step titles. +_drain_tty() { + while IFS= read -r -t 0 -n 1024 _drain /dev/null; do :; done +} + step() { clear_logo echo gum style "$1" + _drain_tty echo }