summaryrefslogtreecommitdiff
path: root/src/macos.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/macos.zig')
-rw-r--r--src/macos.zig24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/macos.zig b/src/macos.zig
index b180d7ba..678b155d 100644
--- a/src/macos.zig
+++ b/src/macos.zig
@@ -1313,15 +1313,15 @@ fn drainInbox(st: *State) bool {
host_io.commandEof(st.core, &st.ptys, e.pane, st, closeWatched);
continue;
}
- // Unwatched, a command's exit is read here, as its end.
- if (st.core.panes[e.pane]) |pane| if (pane.command != null) {
- const status = host_io.exitStatus(pt.pid, 100);
- if (status != null) pt.pid = 0; // reaped: no shell to retire
- reap(st, e.pane);
- st.core.update(.{ .exited = .{ .pane = e.pane, .status = status } });
- st.core.update(.{ .eof = .{ .pane = e.pane } });
- continue;
- };
+ // Unwatched, a command's exit is read here, as its end,
+ // and a shell's, for a run waiting on it and the log.
+ const command = if (st.core.panes[e.pane]) |pane| pane.command != null else false;
+ const status = host_io.exitStatus(pt.pid, 100);
+ if (status != null) pt.pid = 0; // reaped: no shell to retire
+ reap(st, e.pane);
+ if (command or status != null) st.core.update(.{ .exited = .{ .pane = e.pane, .status = status } });
+ st.core.update(.{ .eof = .{ .pane = e.pane } });
+ continue;
}
reap(st, e.pane);
st.core.update(.{ .eof = .{ .pane = e.pane } });
@@ -2469,7 +2469,7 @@ fn ptyResize(ctx: ?*anyopaque, pane: u8, cols: u16, rows: u16) void {
fn ptySignal(ctx: ?*anyopaque, pane: u8, sig: pardes.PtySignal) void {
const st = hostState(ctx);
// A command whose exit is recorded is reaped: its group may be another's.
- if (st.ptys[pane]) |pt| if (!pt.cmd.exited) host_io.signalTty(pt.pid, pt.file.handle, sig);
+ if (st.ptys[pane]) |pt| if (!pt.cmd.exited) host_io.signalTty(pt.pid, pt.file.handle, sig, pt.cmd.watched);
}
fn ttyTaken(ctx: ?*anyopaque, pane: u8) bool {
@@ -2866,7 +2866,7 @@ test "pardes.h matches the Zig boundary" {
try expectEqual(@offsetOf(c.pardes_panel_box_s, field.name), @offsetOf(PanelBox, field.name));
try expectEqual(@sizeOf(c.pardes_panel_track_s), @sizeOf(PanelTrack));
inline for (@typeInfo(PanelTrack).@"struct".fields) |field| {
- const c_name = comptime if (std.mem.eql(u8, field.name, "_padding"))
+ const c_name = comptime if (std.mem.eql(u8, field.name, "motion"))
"reserved0"
else
field.name;
@@ -3000,7 +3000,7 @@ test "mac panel ABI has the documented compact byte layout" {
try std.testing.expectEqual(@as(usize, 4), @offsetOf(PanelTrack, "pane"));
try std.testing.expectEqual(@as(usize, 5), @offsetOf(PanelTrack, "phase"));
try std.testing.expectEqual(@as(usize, 6), @offsetOf(PanelTrack, "effect"));
- try std.testing.expectEqual(@as(usize, 7), @offsetOf(PanelTrack, "_padding"));
+ try std.testing.expectEqual(@as(usize, 7), @offsetOf(PanelTrack, "motion"));
try std.testing.expectEqual(@as(usize, 8), @offsetOf(PanelTrack, "frame"));
try std.testing.expectEqual(@as(usize, 10), @offsetOf(PanelTrack, "frame_count"));
try std.testing.expectEqual(@as(usize, 12), @offsetOf(PanelTrack, "from"));