termio/exec: pass code and runtime to error but don't show it yet

This commit is contained in:
Mitchell Hashimoto
2023-12-30 19:37:38 -08:00
parent 53dffc8e18
commit 730343c600
2 changed files with 8 additions and 2 deletions

View File

@ -816,7 +816,10 @@ fn processExit(
// Notify our main writer thread which has access to more // Notify our main writer thread which has access to more
// information so it can show a better error message. // information so it can show a better error message.
_ = ev.writer_mailbox.push(.{ _ = ev.writer_mailbox.push(.{
.child_exited_abnormally = {}, .child_exited_abnormally = .{
.code = code,
.runtime_ms = runtime,
},
}, .{ .forever = {} }); }, .{ .forever = {} });
ev.writer_wakeup.notify() catch break :runtime; ev.writer_wakeup.notify() catch break :runtime;

View File

@ -66,7 +66,10 @@ pub const Message = union(enum) {
/// as process exited but the surface hasn't been notified to /// as process exited but the surface hasn't been notified to
/// close because termio can use this to update the terminal /// close because termio can use this to update the terminal
/// with an error message. /// with an error message.
child_exited_abnormally: void, child_exited_abnormally: struct {
code: u32,
runtime_ms: u64,
},
/// Write where the data fits in the union. /// Write where the data fits in the union.
write_small: WriteReq.Small, write_small: WriteReq.Small,