Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

fix: use termios.tcflush for more reliable stdin flush

Nika Siradze2346f0a0b5cd
diff --git a/backend/cli.py b/backend/cli.py
index 15d2000..91b0e7e 100644
--- a/backend/cli.py
+++ b/backend/cli.py
@@ -1226,12 +1226,17 @@ def _clean_path(val):
def _flush_stdin():
"""Flush any buffered stdin (leftover newlines from previous inputs)."""
- import select
try:
- while select.select([sys.stdin], [], [], 0.0)[0]:
- sys.stdin.readline()
- except Exception:
- pass
+ import termios
+ termios.tcflush(sys.stdin.fileno(), termios.TCIFLUSH)
+ except (ImportError, termios.error, OSError):
+ # Fallback for non-Unix or piped stdin
+ import select
+ try:
+ while select.select([sys.stdin], [], [], 0.0)[0]:
+ sys.stdin.readline()
+ except Exception:
+ pass
def _ask(prompt, default=None, validate=None, required=False, is_path=False):