From d9e0993cae11cd580fc658196ad4b78592c20cff Mon Sep 17 00:00:00 2001 From: Edu Date: Sat, 1 Aug 2026 11:14:06 +0200 Subject: [PATCH] feat: clear screen between runs in watch mode --- runner.bat | 4 ++-- runner.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/runner.bat b/runner.bat index 75b119f..6a7c5c6 100644 --- a/runner.bat +++ b/runner.bat @@ -68,14 +68,14 @@ if "%WATCH%"=="true" ( echo !YELLOW![WATCH] Watch mode enabled - save the file to rerun!RESET! REM Capture initial timestamp for %%F in ("%FILE%") do set "LAST_MOD=%%~tF" + cls call :run :watchloop - echo !YELLOW![WATCH] Waiting for changes... Press Ctrl+C to stop.!RESET! timeout /t 2 /nobreak >nul for %%F in ("%FILE%") do set "CURR_MOD=%%~tF" if not "!CURR_MOD!"=="!LAST_MOD!" ( set "LAST_MOD=!CURR_MOD!" - echo !YELLOW![WATCH] Change detected...!RESET! + cls call :run ) goto :watchloop diff --git a/runner.sh b/runner.sh index b822f22..6d835a5 100644 --- a/runner.sh +++ b/runner.sh @@ -126,6 +126,7 @@ run() { # ── Watch mode ──────────────────────────────────────────────── if $WATCH; then echo -e "${YELLOW}👁 Watch mode enabled - save the file to rerun${RESET}" + clear run || true if [[ "$PLATFORM" == "linux" ]]; then @@ -134,7 +135,7 @@ if $WATCH; then exit 1 fi while inotifywait -q -e close_write "$FILE"; do - echo -e "\n${YELLOW}↻ Change detected...${RESET}" + clear run || true done @@ -144,7 +145,7 @@ if $WATCH; then exit 1 fi fswatch -o "$FILE" | while read -r; do - echo -e "\n${YELLOW}↻ Change detected...${RESET}" + clear run || true done