Start t3 serve from t3tui when no local server is up, stop it on quit
ensureLocalServer() probes the origin named by the runtime file; if nothing answers (and T3TUI_SERVER/T3TUI_TOKEN are unset) it spawns `t3 serve` detached in its own process group, waits for the runtime file to come up, and returns a handle whose stop() SIGTERMs the whole group (SIGKILL after a grace period). Wired into the UI's destroy handler, `list` and `tmux`, with a process exit hook as backstop. The server's output goes to ~/.config/t3tui/server.log so it can't corrupt the TUI screen. An existing, answering server is always used as-is. Tests cover spawn+stop, existing-server reuse, and the no-spawn env overrides, using a fake t3 binary. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
1 parent
57578ca4f5
commit
5ebff7b68d
5 files changed
+232
-13
No files matched your search
Reference in new issue
Block a user