summaryrefslogtreecommitdiff
path: root/src/tty
diff options
context:
space:
mode:
Diffstat (limited to 'src/tty')
-rw-r--r--src/tty/tty.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig
index 4c1e2db7..490958ee 100644
--- a/src/tty/tty.zig
+++ b/src/tty/tty.zig
@@ -1006,13 +1006,15 @@ const Shell = struct {
return true;
},
.pty_eof => |e| if (s.gens[e.id] == e.gen) {
+ var status: ?u8 = null;
if (s.ptys[e.id]) |*pt| {
pt.reader.await(s.io) catch {}; // reader just finished; join it or its future leaks
_ = libc.close(pt.file.handle);
- host_io.retireShell(pt.pid);
+ status = host_io.exitStatus(pt.pid, 100);
+ if (status == null) host_io.retireShell(pt.pid);
s.ptys[e.id] = null;
}
- core.update(.{ .eof = .{ .pane = @intCast(e.id) } });
+ core.update(.{ .eof = .{ .pane = @intCast(e.id), .status = status } });
},
.key_press => |key| if (s.in_paste) {
const bytes = pasteBytes(key);