From 6407d28c266d07eaf314d149274e84fbd750fea4 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Sat, 25 Jul 2026 18:25:55 +0900 Subject: [PATCH] bootloader: fix duplicate "Autobooting in X seconds" line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The countdown row was derived as list_y - 4, which landed one row too low (on the "Use Up/Down" line) instead of on the header line printed before the loop. The in-loop countdown therefore rendered a second "Autobooting in X seconds" copy directly below the static header, showing the phrase twice. Capture the header's row with get_text_position() right before printing it, so the loop updates that exact line in place — one countdown line, no stale copy. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a886e26aba..bb693f77b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -221,6 +221,11 @@ fn select_mode( let mut countdown = AUTOBOOT_SECONDS; let mut countdown_active = true; + // Capture the countdown line's row now, so the in-loop countdown updates it + // in place. Deriving it from list_y with a fixed offset landed one row too + // low (on the "Use Up/Down" line), leaving this header as a stale second + // "Autobooting in X seconds" copy above the live one. + let countdown_y = os.get_text_position().1; os.set_text_color(TextColor::Yellow); println!( " Autobooting in {} seconds (press any key to cancel)", @@ -240,7 +245,6 @@ fn select_mode( println!(); let (list_x, list_y) = os.get_text_position(); - let countdown_y = list_y.saturating_sub(4); loop { for (i, entry) in entries.iter().enumerate() {