Fix CLI mode not exiting after transcription completes#260
Fix CLI mode not exiting after transcription completes#260alex-pradas wants to merge 2 commits intokaixxx:mainfrom
Conversation
Add app.quit() and app.destroy() calls before return statements in run_cli_mode() and show_available_models() to properly shut down the Tkinter event loop. Without this cleanup, the process would stall indefinitely after printing success message. Also add uv script metadata shebang for easier CLI invocation.
- Add headless parameter to App.__init__ to skip GUI widget creation - Add _cleanup_app() function for proper process termination - Guard GUI-dependent methods (set_progress, update_queue_table, update_queue_controls, logr) against headless mode - Skip auto-launching noScribeEdit in headless CLI mode - Prevents GUI window from appearing and process from hanging when using --no-gui flag
|
Thank you. I did not encounter the same issue, maybe because I mainly work on Windows. But I wanted to get rid of Tkinter in headless mode anyway, since this should also allow the script to run on Linux servers without any GUI framework installed, which is not possible atm. I will take a look at your changes after the holidays. |
|
@alex-pradas It looks like a |
|
@syssi: Interesting, and thank you for testing. I have no truly headless system to test on. |
|
OK, I have taken inspiration from this PR and introduced what should be a true headless mode: https://github.com/kaixxx/noScribe/tree/true_headless_mode (One could also say that [my] Codex took inspiration from [@alex-pradas] Claude Code.) @syssi : Could you test this new branch? I hope you can run noScribe from source, haven't compiled this version yet. It should not require any kind of display when used with |
|
@kaixxx Did you see my headless branch? syssi/noScribe@main...headless |
I will give it a try! |
No, I didn't... Anyhow, our approach seems very similar. Looking forward to your results. If my branch is still giving you problems, we can switch to your version instead. |
Goods good to me! May be
should be fixed? |
|
Looks good.
Good point. Fixed it here I hope: d12a8c3 |
|
The latest commit did not fix the issue. |
Hmm. My problem is that I don't see the warning. But, it is not a very serious issue, as far as I can tell. So we might as well ignore it for now. What do you think? |
|
Yes. Let's ignore it. |
|
OK, I have now implemented the changes here: #274 |
Summary
--no-guiflag)Changes
headlessparameter toApp.__init__to skip GUI widget creation_cleanup_app()function for proper process termination (handles mp_proc, ffmpeg, worker threads)set_progress,update_queue_table,update_queue_controls,logrTest plan
--no-guiflag🤖 Generated with Claude Code