git.lucas.co / cce-terminal
terminal emulator
git clone https://git.lucas.co/cce-terminal.git

commit5959db287691c55a7e3c7600245d5f34ef50136a
parent2d74396a48
authorLucas Galante <lsgalante12@gmail.com>
date2026-09-28 19:15
fix: restore the reaping spawn cce-ui 4e94236 removed

cce-ui 4e94236 deleted its process module as caller-less, but the plate
menu's New Window action called cce_ui::process::spawn_detached to launch
a second instance, so the crate no longer compiled against the pinned
toolkit. Give plate_menu.rs its own copy of the helper — spawn, then wait
on the child from a background thread so a closed window never lingers as
a zombie — rather than restoring it in the shared crate, so the crate
keeps building standalone whatever the toolkit does next. Same fix as
cce-mail d5f8394.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

 src/plate_menu.rs | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/plate_menu.rs b/src/plate_menu.rs
index 42dc41a..959c18b 100644
--- a/src/plate_menu.rs
+++ b/src/plate_menu.rs
@@ -194,7 +194,7 @@ impl TerminalApp {
             PlateMenuAction::CloseTab => self.close_active_tab(),
             PlateMenuAction::NewWindow => match std::env::current_exe() {
                 Ok(exe) => {
-                    if let Err(e) = cce_ui::process::spawn_detached(std::process::Command::new(exe)) {
+                    if let Err(e) = spawn_detached(std::process::Command::new(exe)) {
                         log::warn!("cce-terminal: failed to spawn a new window: {e}");
                     }
                 }
@@ -234,3 +234,15 @@ impl TerminalApp {
         context_menu::paint_with_labels(pc);
     }
 }
+
+/// Spawn `cmd` and reap it on a background thread, so the child never lingers
+/// as a zombie once it exits. This was `cce_ui::process::spawn_detached` until
+/// the toolkit dropped that module (cce-ui 4e94236) as caller-less — the new-window
+/// action here was a caller.
+fn spawn_detached(mut cmd: std::process::Command) -> std::io::Result<()> {
+    let mut child = cmd.spawn()?;
+    std::thread::spawn(move || {
+        let _ = child.wait();
+    });
+    Ok(())
+}