feat: Implement terminal cleanup on exit and signal handling in ComfyConsole

This commit is contained in:
Andy
2025-07-31 18:25:18 +00:00
parent 8c798b95c4
commit 091d7335a3
2 changed files with 43 additions and 2 deletions

View File

@@ -765,7 +765,8 @@ class dl:
DOWNLOAD_LICENCE_ONLY.set()
try:
with Live(Padding(download_table, (1, 5)), console=console, refresh_per_second=5):
# Use transient mode to prevent display remnants
with Live(Padding(download_table, (1, 5)), console=console, refresh_per_second=5, transient=True):
with ThreadPoolExecutor(downloads) as pool:
for download in futures.as_completed(
(
@@ -1009,7 +1010,7 @@ class dl:
multiplex_tasks.append((task_id, task_tracks))
with Live(Padding(progress, (0, 5, 1, 5)), console=console):
with Live(Padding(progress, (0, 5, 1, 5)), console=console, transient=True):
for task_id, task_tracks in multiplex_tasks:
progress.start_task(task_id) # TODO: Needed?
muxed_path, return_code, errors = task_tracks.mux(