diff options
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/builtins.zig b/src/builtins.zig index 0ad59fd4..1dc428da 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -762,6 +762,19 @@ pub const Adopt = struct { } }; +/// Move this session onto the pardes installed since it started, in place: +/// its text, undo, views, terminals with their running shells, and its +/// terminals and windows come along. The pardes daemon moves too. +pub const Upgrade = struct { + pub const scope: Scope = .session; + pub const enabled = pardes.can_attach; + pub fn run(c: Ctx) void { + if (comptime !enabled) unreachable; + 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)); + } +}; + /// Mount another pardes's 9P tree under /n/<name>, given its dial address. pub const Mount = struct { pub const scope: Scope = .session; |
