From b5ec6ba648099315a2b0e32eb081e7094b7f618d Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Thu, 29 Oct 2026 14:00:21 +0200 Subject: [PATCH] fix(efficacy): clear the watcher's console with its own clear The escape sequence left the progress window black on Windows: the text was drawn but scrolled out of view. The watcher now clears with cls, or clear elsewhere. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX --- tests/efficacy/progress.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/efficacy/progress.py b/tests/efficacy/progress.py index 066ce1a..e48cf77 100644 --- a/tests/efficacy/progress.py +++ b/tests/efficacy/progress.py @@ -134,9 +134,11 @@ def watch(root, every): while True: lines = render(root) - # Clear and home the cursor; Windows consoles take the sequence once - # the shell has enabled it, which `os.system("")` does. - sys.stdout.write("\x1b[2J\x1b[H" + "\n".join(lines) + "\n") + # The console's own clear, not an escape sequence: a Windows console + # can take the sequence and still leave the text scrolled out of the + # window, which then shows black. + os.system("cls" if os.name == "nt" else "clear") + sys.stdout.write("\n".join(lines) + "\n") sys.stdout.flush() time.sleep(every) @@ -248,7 +250,6 @@ def main(argv): if options.once: print("\n".join(render(options.root))) return 0 - os.system("") try: watch(options.root, options.every) except KeyboardInterrupt: