Skip to content

Commit 95bc540

Browse files
committed
fix: clear the terminal before the install intro animation
The intro absolute-positions the logo grid and progress bar to fixed screen rows, which assumes a clean screen. With prior shell output the frames interleave with old text. Clear the screen at animation start in both install.sh and install.ps1; the non-animated path is unchanged.
1 parent 9b1b195 commit 95bc540

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

.changeset/install-clear-screen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pythoughts/pythinker-code': patch
3+
---
4+
5+
Clear the terminal before the install script's animated intro so earlier shell output no longer interleaves with the logo animation.

apps/pythinker-web/public/install.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ function Stop-AntennaSpin {
148148
}
149149

150150
function Write-LogoAnimated {
151+
# The intro absolute-positions to screen rows (grid at 5-9, progress at
152+
# 17), which assumes a clean screen. Clear it first — otherwise earlier
153+
# shell output interleaves with the animation.
154+
Write-Host -NoNewline "${ESC}[2J${ESC}[H"
151155
$rows = 5; $cols = 13
152156
$frameMs = 60; $staggerMs = 40
153157
if ($env:PYTHINKER_LOGO_FRAME_DELAY) { try { $frameMs = [int]([double]$env:PYTHINKER_LOGO_FRAME_DELAY * 1000) } catch {} }

apps/pythinker-web/public/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ print_logo_animated() {
327327
local FRAME_DELAY="${PYTHINKER_LOGO_FRAME_DELAY:-0.06}"
328328
local STAGGER_DELAY="${PYTHINKER_LOGO_STAGGER_DELAY:-0.04}"
329329

330+
# The whole intro absolute-positions to screen rows (grid at 5-9,
331+
# progress at 17), which assumes a clean screen. Clear it first —
332+
# otherwise earlier shell output interleaves with the animation.
333+
printf '\033[2J\033[H'
334+
330335
# Hide the text cursor while we redraw in place — otherwise the block
331336
# cursor on terminals like Terminal.app renders as a stray white block
332337
# at the cursor's current cell. Show it again before returning so the

0 commit comments

Comments
 (0)