Clear keyboard queue while waiting schedule
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
# identification, and support for complex data extraction using JSON path expressions.
|
||||
import json
|
||||
import logging
|
||||
|
||||
import msvcrt
|
||||
import os
|
||||
import re
|
||||
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 ",
|
||||
end="", flush=True)
|
||||
sleep(1)
|
||||
# Flush keyboard buffer to prevent stray keystrokes from polluting subsequent prompts
|
||||
while msvcrt.kbhit():
|
||||
msvcrt.getwch()
|
||||
print()
|
||||
console.print("[green]✓ Starting processing.[/green]")
|
||||
except KeyboardInterrupt:
|
||||
|
||||
Reference in New Issue
Block a user