summaryrefslogtreecommitdiff
path: root/src/host_io.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/host_io.zig')
-rw-r--r--src/host_io.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/host_io.zig b/src/host_io.zig
index 6ce26e41..9e0292b3 100644
--- a/src/host_io.zig
+++ b/src/host_io.zig
@@ -231,8 +231,8 @@ pub const Adoptions = struct {
/// takes this pty instead of forking a shell (`take`).
pub fn adoptShell(a: *Adoptions, core: *pardes.Pardes, pid: libc.pid_t, fd: c_int) void {
if (pid == 0) {
- var buf: [96]u8 = undefined;
- return core.setMessage(core.view().active, if (a.taken == 0) "Adopt: no shell of a session that died is waiting" else std.fmt.bufPrint(&buf, "Adopt: {d} shell{s} taken in; what they showed is gone", .{ a.taken, if (a.taken == 1) "" else "s" }) catch unreachable); // a count fits 96
+ var buf: pardes.Kind.Buf(96) = .{};
+ return core.setMessage(core.view().active, if (a.taken == 0) "Adopt: no shell of a session that died is waiting" else buf.print("Adopt: {d} shell{s} taken in; what they showed is gone", .{ a.taken, if (a.taken == 1) "" else "s" }));
}
if (a.len < a.list.len) {
a.list[a.len] = .{ .pid = pid, .fd = fd, .pane = null };
@@ -246,8 +246,8 @@ pub const Adoptions = struct {
}
// No room for it: its master goes, and the shell with this session.
_ = libc.close(fd);
- var buf: [96]u8 = undefined;
- core.setMessage(core.view().active, std.fmt.bufPrint(&buf, "Adopt: no room for shell {d}; it ends with this session", .{pid}) catch unreachable); // a pid fits 96
+ var buf: pardes.Kind.Buf(96) = .{};
+ core.setMessage(core.view().active, buf.print("Adopt: no room for shell {d}; it ends with this session", .{pid}));
}
/// The adopted shell pane `pane`'s spawn takes, off the list.