termio: use host-spawn for pty

This commit is contained in:
Mitchell Hashimoto
2023-02-25 22:36:20 -08:00
parent f012d31ed5
commit fc3802e632
4 changed files with 22 additions and 27 deletions

View File

@@ -104,15 +104,12 @@ pub fn childPreExec(self: Pty) !void {
if (setsid() < 0) return error.ProcessGroupFailed;
// Set controlling terminal
// TODO: maybe
if (!@import("os/main.zig").isFlatpak()) {
switch (std.os.system.getErrno(c.ioctl(self.slave, TIOCSCTTY, @as(c_ulong, 0)))) {
.SUCCESS => {},
else => |err| {
log.err("error setting controlling terminal errno={}", .{err});
return error.SetControllingTerminalFailed;
},
}
switch (std.os.system.getErrno(c.ioctl(self.slave, TIOCSCTTY, @as(c_ulong, 0)))) {
.SUCCESS => {},
else => |err| {
log.err("error setting controlling terminal errno={}", .{err});
return error.SetControllingTerminalFailed;
},
}
// Can close master/slave pair now