diff options
Diffstat (limited to 'src/tty/tty.zig')
| -rw-r--r-- | src/tty/tty.zig | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig index 822c2d7f..96aec9a9 100644 --- a/src/tty/tty.zig +++ b/src/tty/tty.zig @@ -1050,12 +1050,13 @@ const Shell = struct { return true; } _ = libc.close(pt.file.handle); - // Unwatched, a command's exit is read here, as its end. + // 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 (core.panes[e.id]) |pn| pn.command != null else false; - const status = if (command) host_io.exitStatus(pt.pid, 100) else null; + const status = host_io.exitStatus(pt.pid, 100); if (status == null) host_io.retireShell(pt.pid); s.ptys[e.id] = null; - if (command) core.update(.{ .exited = .{ .pane = @intCast(e.id), .status = status } }); + if (command or status != null) core.update(.{ .exited = .{ .pane = @intCast(e.id), .status = status } }); } core.update(.{ .eof = .{ .pane = @intCast(e.id) } }); }, @@ -1272,7 +1273,7 @@ const Shell = struct { const s = of(ctx); // A command whose exit is recorded is reaped: its group may be // another's by now. - if (s.ptys[pane]) |pt| if (!pt.cmd.exited) host_io.signalTty(pt.pid, pt.file.handle, sig); + if (s.ptys[pane]) |pt| if (!pt.cmd.exited) host_io.signalTty(pt.pid, pt.file.handle, sig, pt.cmd.watched); } /// The pane is gone: hang its pty up, which the kernel passes on to the @@ -1314,7 +1315,7 @@ const Shell = struct { fn writeFile(ctx: ?*anyopaque, pane: u8, path: []const u8, bytes: []const u8) void { const s = of(ctx); filesystem.write(s.core, path, bytes) catch |err| - return s.core.saveFailed(pane, "save", err); + return s.core.saveFailed(pane, path, err); if (s.core.panes[pane]) |pn| if (pn.file) |f| if (std.mem.eql(u8, f.path, path)) { if (s.watches[pane]) |*w| if (w.serial == pn.serial) switch (w.generation) { .text => w.generation = .{ .text = std.hash.Wyhash.hash(0, bytes) }, |
