From e8c922b67e8cdc98efe61b6435a20e99c2cc9672 Mon Sep 17 00:00:00 2001 From: Will Pragnell Date: Sat, 4 Jan 2025 22:37:43 -0800 Subject: [PATCH] termio/exec: call wait on subprocess when it exits externally --- src/termio/Exec.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 1a3b8cad0..2bea8f0ce 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -1203,6 +1203,10 @@ const Subprocess = struct { /// Called to notify that we exited externally so we can unset our /// running state. pub fn externalExit(self: *Subprocess) void { + if (self.command) |*cmd| { + _ = cmd.wait(false) catch |err| + log.err("error waiting on subprocess: {}", .{err}); + } self.command = null; }