Clear keyboard queue while waiting schedule

This commit is contained in:
2026-02-20 15:17:07 +00:00
parent cc709200a0
commit 9fbca92f37

View File

@@ -21,7 +21,7 @@
# identification, and support for complex data extraction using JSON path expressions. # identification, and support for complex data extraction using JSON path expressions.
import json import json
import logging import logging
import msvcrt
import os import os
import re import re
import sys import sys
@@ -395,6 +395,9 @@ def wait_for_scheduled_launch():
print(f"\r Starting in {h:02d}:{m:02d}:{s:02d}... (at {target_str}) — Ctrl+C to cancel ", print(f"\r Starting in {h:02d}:{m:02d}:{s:02d}... (at {target_str}) — Ctrl+C to cancel ",
end="", flush=True) end="", flush=True)
sleep(1) sleep(1)
# Flush keyboard buffer to prevent stray keystrokes from polluting subsequent prompts
while msvcrt.kbhit():
msvcrt.getwch()
print() print()
console.print("[green]✓ Starting processing.[/green]") console.print("[green]✓ Starting processing.[/green]")
except KeyboardInterrupt: except KeyboardInterrupt: