fix: wait-after-command confirmation set

This commit is contained in:
George Nicholas Padron
2025-06-12 14:09:40 -04:00
parent c3d65d3975
commit 82a3617a2b
2 changed files with 10 additions and 7 deletions

View File

@ -907,12 +907,7 @@ pub fn handleMessage(self: *Surface, msg: Message) !void {
}, },
.close => self.close(), .close => self.close(),
.child_exited => self.child_exited = true,
// Close without confirmation.
.child_exited => {
self.child_exited = true;
self.close();
},
.desktop_notification => |notification| { .desktop_notification => |notification| {
if (!self.config.desktop_notifications) { if (!self.config.desktop_notifications) {

View File

@ -418,6 +418,11 @@ fn processExitCommon(td: *termio.Termio.ThreadData, exit_code: u32) void {
return; return;
} }
// Notify our surface that the child process has exited
_ = td.surface_mailbox.push(.{
.child_exited = {},
}, .{ .forever = {} });
// We output a message so that the user knows whats going on and // We output a message so that the user knows whats going on and
// doesn't think their terminal just froze. We show this unconditionally // doesn't think their terminal just froze. We show this unconditionally
// on close even if `wait_after_command` is false and the surface closes // on close even if `wait_after_command` is false and the surface closes
@ -442,7 +447,7 @@ fn processExitCommon(td: *termio.Termio.ThreadData, exit_code: u32) void {
// Notify our surface we want to close // Notify our surface we want to close
_ = td.surface_mailbox.push(.{ _ = td.surface_mailbox.push(.{
.child_exited = {}, .close = {},
}, .{ .forever = {} }); }, .{ .forever = {} });
} }
@ -569,6 +574,9 @@ pub fn queueWrite(
_ = td.surface_mailbox.push(.{ _ = td.surface_mailbox.push(.{
.child_exited = {}, .child_exited = {},
}, .{ .forever = {} }); }, .{ .forever = {} });
_ = td.surface_mailbox.push(.{
.close = {},
}, .{ .forever = {} });
return; return;
} }