From e50c1b3fc928bf860bc6e91b0a2fea469f7e41e7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 00:53:40 -0300 Subject: host_io: a Restore's new core is restoreCore's (the clients that replicate the old one let go, the dump read and restored, its failure said once, the old core's pane and theme watches dropped), with both ponytail notes, where the tty and the window each wrote those steps out; each keeps its own ptys, pipes and views, and the tty's dump import goes with its one use Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/tui/tui.zig | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/tui/tui.zig') diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 3a5c277e..5c16f1be 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -6,7 +6,6 @@ const libc = std.c; const vaxis = @import("vaxis"); const pardes = @import("../pardes.zig"); const vaxis_input = @import("../vaxis_input.zig"); -const dump = @import("../dump.zig"); const tracy = @import("../tracy.zig"); const look = @import("../look.zig"); const message = pardes.Messages.Message; @@ -1749,18 +1748,7 @@ fn localSession( // off a startup's way. daemon.watch(loop, deliverNote); if (core.takeRestore()) |rp| blk: { - // ponytail: a Restore replaces the core its clients replicate; - // they are let go, and attach again. - sh.peers.dropAll(core); - const bytes = filesystem.readRestore(gpa, rp, core.settings.dump_dir.get()) catch |err| { - core.reportError(core.active, "Restore", err); - break :blk; - }; - defer gpa.free(bytes); - const nc = dump.restore(core, bytes, rp) catch |err| { - core.reportError(core.active, "Restore", err); - break :blk; - }; + const nc = host_io.restoreCore(gpa, core, rp, &sh.peers, sh.inotify_fd, &sh.watches) orelse break :blk; if (sh.lsp_task) |*task| { task.future.cancel(io); sh.lsp_task = null; @@ -1768,10 +1756,7 @@ fn localSession( sh.pipe_tasks.cancelAll(io); for (&sh.gens) |*generation| generation.* +%= 1; for (0..pardes.MAX_PANES) |pane| Shell.closePty(&sh, @intCast(pane)); - file_watch.unwatchAll(sh.inotify_fd, &sh.watches); - _ = file_watch.applyThemeEffect(core, gpa, sh.inotify_fd, &sh.watches, 0, false, false); - // ponytail: a restored session is one view, the live one's - // terminal: the others are let go, as a detach of each. + // One view, the live one's terminal (host_io.restoreCore). const live = sh.term().?; for (&sh.terms) |*slot| if (slot.*) |sc| if (sc != live) { stopInput(io, &sc.thread); -- cgit v1.3