From 08ed20186188cb1d71e48ac2a8f6fc8e8074b68c Mon Sep 17 00:00:00 2001 From: Michael Sitarzewski Date: Fri, 5 Jun 2026 01:10:54 -0500 Subject: [PATCH] fix(installer): clear-to-end-of-line per row so frames don't bleed draw_frame only cleared below the frame (\033[0J), so when a new screen's lines were shorter than the previous screen's, the old tails (tool paths, warnings) bled through on the right. Now erase-to-eol (\033[K) on every line before the screen-clear. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/lib.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index 5c20b04..270388a 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -153,8 +153,11 @@ read_key() { esac } -# draw_frame — home cursor and paint a pre-composed frame, clearing -# trailing lines (flicker-free: one write, then clear-to-end-of-screen). +# draw_frame — home cursor and paint a pre-composed frame. +# Flicker-free: erase-to-end-of-line (\033[K) on every line so a shorter new +# line never leaves the previous frame's tail behind, then erase-to-end-of- +# screen (\033[0J) to drop any leftover lines below the frame. draw_frame() { - printf '\033[H%s\033[0J' "$1" + local buf="${1//$'\n'/$'\033[K'$'\n'}" + printf '\033[H%s\033[K\033[0J' "$buf" }