summaryrefslogtreecommitdiff
path: root/core/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/builtins.zig')
-rw-r--r--core/builtins.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/builtins.zig b/core/builtins.zig
index ca13bd59..6f37e86d 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -447,7 +447,7 @@ pub const Kill = struct {
// the marks say is running is the one signalled, not whatever
// runs by then.
if (command != null) {
- c.p.emit(.{ .signal_pty = .{ .pane = @intCast(id), .serial = pane.serial, .sig = .term } });
+ c.p.emit(.{ .signal_pty = .{ .pane = .at(id), .serial = pane.serial, .sig = .term } });
stopped = true;
} else if (c.p.hostKillJob(id)) stopped = true else jobless = true;
}
@@ -537,7 +537,7 @@ pub const Detach = struct {
pub const scope: Scope = .session;
pub const enabled = pardes.can_attach;
pub fn run(c: Ctx) void {
- c.p.emit(.{ .detach = .{ .pane = @intCast(c.id) } });
+ c.p.emit(.{ .detach = .{ .pane = .at(c.id) } });
}
};
@@ -548,7 +548,7 @@ pub const Adopt = struct {
pub const enabled = pardes.can_attach;
pub fn run(c: Ctx) void {
const adopt = c.p.host.vtable.adopt orelse return c.p.reportFailure(c.id, "Adopt: no pardes daemon is keeping shells for this session");
- adopt(c.p.host.ctx, @intCast(c.id));
+ adopt(c.p.host.ctx, .at(c.id));
}
};
@@ -560,7 +560,7 @@ pub const Upgrade = struct {
pub const enabled = pardes.can_attach;
pub fn run(c: Ctx) void {
const upgrade = c.p.host.vtable.upgrade orelse return c.p.reportFailure(c.id, "Upgrade: this pardes cannot move to another build in place");
- upgrade(c.p.host.ctx, @intCast(c.id));
+ upgrade(c.p.host.ctx, .at(c.id));
}
};
@@ -682,7 +682,7 @@ pub const DumpThemes = struct {
c.p.reportError(.at(c.id), "dump themes", error.NoConfigDirectory);
return;
}
- c.p.emit(.{ .dump_themes = .{ .pane = @intCast(c.id) } });
+ c.p.emit(.{ .dump_themes = .{ .pane = .at(c.id) } });
}
};
@@ -2011,7 +2011,7 @@ test "Kill stops the commands pardes typed, bare all and by name those that matc
const term = p.view().active;
try std.testing.expect(p.panes[term].?.isTerminal());
const prompt = "\x1b]133;A;cl=line;aid=pardes\x07$ \x1b]133;B;aid=pardes\x07";
- p.update(.{ .output = .{ .pane = @intCast(term), .bytes = prompt } });
+ p.update(.{ .output = .{ .pane = .at(term), .bytes = prompt } });
while (p.nextEffect()) |_| {}
// The host the core asks: how many it was asked to stop, and whether
// their shells run jobs in groups of their own.
@@ -2019,7 +2019,7 @@ test "Kill stops the commands pardes typed, bare all and by name those that matc
var asked: usize = 0;
var job_control = true;
const vtable: pardes.Host.VTable = .{ .kill_job = answer };
- fn answer(_: ?*anyopaque, _: u8) bool {
+ fn answer(_: ?*anyopaque, _: pardes.Pane.Id) bool {
asked += 1;
return job_control;
}
@@ -2037,7 +2037,7 @@ test "Kill stops the commands pardes typed, bare all and by name those that matc
while (p.nextEffect()) |_| {}
// Typed but not started yet (no C mark): not running.
try std.testing.expectEqual(@as(usize, 0), killed.count(p, "Kill"));
- p.update(.{ .output = .{ .pane = @intCast(term), .bytes = "\x1b]133;C;aid=pardes\x07" } });
+ p.update(.{ .output = .{ .pane = .at(term), .bytes = "\x1b]133;C;aid=pardes\x07" } });
while (p.nextEffect()) |_| {}
try std.testing.expectEqual(@as(usize, 0), killed.count(p, "Kill ls"));
try std.testing.expectEqual(@as(usize, 1), killed.count(p, "Kill ls make"));
@@ -2053,7 +2053,7 @@ test "Kill stops the commands pardes typed, bare all and by name those that matc
p.fs.failure_len = 0;
killed.job_control = true;
// Ended (a D mark): nothing to stop again.
- p.update(.{ .output = .{ .pane = @intCast(term), .bytes = "\x1b]133;D;143;aid=pardes\x07" ++ prompt } });
+ p.update(.{ .output = .{ .pane = .at(term), .bytes = "\x1b]133;D;143;aid=pardes\x07" ++ prompt } });
while (p.nextEffect()) |_| {}
try std.testing.expectEqual(@as(usize, 0), killed.count(p, "Kill"));
}