From 730343c600c4090410a7354d611d0f2bcda7e5c2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 30 Dec 2023 19:37:38 -0800 Subject: [PATCH] termio/exec: pass code and runtime to error but don't show it yet --- src/termio/Exec.zig | 5 ++++- src/termio/message.zig | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index c5d66decd..ff7841647 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -816,7 +816,10 @@ fn processExit( // Notify our main writer thread which has access to more // information so it can show a better error message. _ = ev.writer_mailbox.push(.{ - .child_exited_abnormally = {}, + .child_exited_abnormally = .{ + .code = code, + .runtime_ms = runtime, + }, }, .{ .forever = {} }); ev.writer_wakeup.notify() catch break :runtime; diff --git a/src/termio/message.zig b/src/termio/message.zig index 223e09c10..e6c8fc76f 100644 --- a/src/termio/message.zig +++ b/src/termio/message.zig @@ -66,7 +66,10 @@ pub const Message = union(enum) { /// as process exited but the surface hasn't been notified to /// close because termio can use this to update the terminal /// 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_small: WriteReq.Small,