From 78d94c4a62ec3f4039a475b637ff6a60649fde52 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 16:41:27 -0300 Subject: core: the entries that take or answer a slot take and answer its type (P21, pardes-ids change 2): a pane's slot is `Pane.Id` in the twelve entries that took it, six as `usize` (setCwd, acknowledgeShell, setMessage, setStatus, reportError, noteLateFailure) and six as `u8` (readerFailed, shellFailed, restartFailed, saveFailed, reloadWatchedFile, File.deleted), and in what adoptShell answers (`?Pane.Id`); a view's slot is `View.Id` in closeView, leaveView, awayView, rejoinView and the hand-written toView (its `to_view` variant is `Pardes.View.Id` now, and its replay arm unchanged) and in what openView answers (`?View.Id`); the tape's other variants follow their inners' types with no edit (`Args`); each inner converts where its body indexes (`id.index()`), passes the id itself to another entry, and the core's own code stays integers; every caller converts at its own line, `p.reportError(.at(id), ..)` (the decl literal of the parameter's type), 514 calls in 56 files written by a script that refuses any path outside the workspace (`.scratch/sketch/reorg/pardes-ids/wrap.py`), 46 `.index()`; nothing the compiler caught was a pane's slot passed as a view's or the reverse: what it caught were a script's wrong guesses (Editor.reportError(err) and macos.zig's own reloadWatchedFile, same names, undone) and the integers a view's id met (views.zig's tests, replica.zig's Authority and Peers.join, host_io's Adoption); in files another agent is in, each conversion on the line that was there: core/Kind.zig 5 lines, core/Addon.zig 4, core/replica.zig 23 (Authority.openView and join, closeView/toView/awayView/rejoinView/leaveView calls, Peers.join's `openView`, tests), test/replicas.zig 1; the tape's records are smaller (a `usize` is a byte in six inputs) and its shape moves, so the semantics word moves, 313a99190b93a8c5 -> c47ecf638b3f4b9f; test/perf.zig untouched (its harness id does not move); the Mac: runtime/macos.zig 16 call lines, abi/pardes.h unchanged; 581 lines changed in 56 files, no line added. Gate (load 4 to 28: a drat build and other agents' gates beside): tui core-test 841/984 (143 skipped), shell-test 1020/1023, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds of 70 steps, 0 failures, process-test lspcomplete and lspcompletemoved (the base's), gui unit-test 1618/1622 (BaselineHarnessMismatch, the base's); replicas --clients 5 (TMPDIR /tmp/claude-1000/ids, alternated with the base twice, both pass both times): diverged 0, unequal 0 at rtt 30, 80, 207, deltas checked/wrong 1811/0, 1838/0, 1715/0, quiet checks 567/0, 650/0, 544/0, stops not on may_wait 0 (its corpus-through-a-client scene fails at step 21 as on the base with that TMPDIR); two earlier runs of this tree under a load of 10 to 28 ended in a leak of Places' compiled regex (Places.derive from Query.produce) and one rtt-207 run in an assertion in mouse.kindMouse's clamp during a client's speculation, the leak not seen in the eight runs of this tree after them (the full soak, each rtt alone, single seeds), the assertion not in the two full runs after it, and neither in three full runs of the base (by reading neither touches a slot: in the report); daemon.py plain, --far, --games, --window-clients, --upgrade both ways against pardes-tree's base prefix pass; test/cross_replay.py (tui records, gui replays): 27 digests agree in each of three replicas; rollback-bench runs; the macOS library for Linux and aarch64-macos and the FreeBSD cross-build build; frames (gpu/ids-2 against tree1) 77/77 byte-identical in Debug, unit-test 1618/1622 there too, perfab corpus2x -0.059% (session noise 0.134%, threshold 0.4%), pictures identical in all 10 runs, perfops 97 counts within 0.1% (largest image-frame on longline +0.0274%), key-down on medium 10,040,104 -> 10,039,959 an operation (-0.0014%), render on medium 11,455,764 -> 11,455,707 (-0.0005%) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- dev/Lsp.zig | 4 ++-- dev/file_watch.zig | 16 ++++++++-------- dev/gui/gui.zig | 30 +++++++++++++++--------------- dev/host_io.zig | 20 ++++++++++---------- dev/tui/tui.zig | 24 ++++++++++++------------ 5 files changed, 47 insertions(+), 47 deletions(-) (limited to 'dev') diff --git a/dev/Lsp.zig b/dev/Lsp.zig index edc99eeb..d7f11bfe 100644 --- a/dev/Lsp.zig +++ b/dev/Lsp.zig @@ -118,12 +118,12 @@ pub fn start(io: std.Io, gpa: std.mem.Allocator, core: *pardes.Pardes, task: *?T } const job = snapshot(gpa, core, req) catch |err| { core.update(.{ .lsp_resp = .{ .id = req.id, .rows = null } }); - return core.reportError(req.pane, "lsp", err); + return core.reportError(.at(req.pane), "lsp", err); }; const future = io.concurrent(work, .{ io, gpa, job, ctx, deliver }) catch |err| { job.free(gpa); core.update(.{ .lsp_resp = .{ .id = req.id, .rows = null } }); - return core.reportError(req.pane, "lsp", err); + return core.reportError(.at(req.pane), "lsp", err); }; task.* = .{ .id = req.id, .future = future }; } diff --git a/dev/file_watch.zig b/dev/file_watch.zig index 9d868e07..a02ad272 100644 --- a/dev/file_watch.zig +++ b/dev/file_watch.zig @@ -459,7 +459,7 @@ pub fn reloadPane( if (pane.file) |file| { const bytes = filesystem.read(core, file.path) catch |err| { // Gone from under the pane: said once, the text kept. - if (err == error.FileNotFound and watched.existed == std.hash.Wyhash.hash(0, file.path)) pardes.panes.File.deleted(core, @intCast(id)); + if (err == error.FileNotFound and watched.existed == std.hash.Wyhash.hash(0, file.path)) pardes.panes.File.deleted(core, .at(id)); return false; }; if (watches[id]) |*live| live.existed = std.hash.Wyhash.hash(0, file.path); @@ -477,7 +477,7 @@ pub fn reloadPane( }; return false; } - if (!core.reloadWatchedFile(@intCast(id), bytes)) return false; + if (!core.reloadWatchedFile(.at(id), bytes)) return false; const current = core.panes[id] orelse return false; if (current.serial != watched.serial) return false; const current_file = current.file orelse return false; @@ -488,7 +488,7 @@ pub fn reloadPane( } if (announce) { var msg_buf: [256]u8 = undefined; - core.setMessage(id, message.stamp(&msg_buf, "reloaded", current_file.path)); + core.setMessage(.at(id), message.stamp(&msg_buf, "reloaded", current_file.path)); } return false; } @@ -510,7 +510,7 @@ pub fn reloadPane( .text => {}, } // Its kind reads the file again (Kind.fileChanged): on the tape, no bytes. - if (!core.reloadWatchedFile(@intCast(id), &.{})) return false; + if (!core.reloadWatchedFile(.at(id), &.{})) return false; const current = core.panes[id] orelse return false; if (current.serial != watched.serial) return false; const current_path = kindPath(current) orelse return false; @@ -522,7 +522,7 @@ pub fn reloadPane( } if (announce) { var msg_buf: [256]u8 = undefined; - core.setMessage(id, message.stamp(&msg_buf, "reloaded", current_path)); + core.setMessage(.at(id), message.stamp(&msg_buf, "reloaded", current_path)); } return false; } @@ -611,12 +611,12 @@ pub fn applyThemeEffect( const pane = request.pane; const bytes = filesystem.readFile(&pardes.tape.none, gpa, request.path) catch |err| { colors.failThemeFile(core, generation, err); - core.noteLateFailure(pane); + core.noteLateFailure(.at(pane)); return false; }; defer gpa.free(bytes); if (!colors.loadThemeFile(core, generation, bytes)) { - core.noteLateFailure(pane); + core.noteLateFailure(.at(pane)); return false; } const hash = std.hash.Wyhash.hash(0, bytes); @@ -659,7 +659,7 @@ pub fn reloadTheme( live.generation = .{ .text = hash }; if (announce) { var msg_buf: [256]u8 = undefined; - core.setMessage(request.pane, message.stamp(&msg_buf, "reloaded theme", request.path)); + core.setMessage(.at(request.pane), message.stamp(&msg_buf, "reloaded theme", request.path)); } return false; } diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig index 798368e3..3d050bbf 100644 --- a/dev/gui/gui.zig +++ b/dev/gui/gui.zig @@ -2548,7 +2548,7 @@ const Shell = struct { /// last. True when it was not, and is now. fn windowView(s: *Shell) bool { if (s.core.live == s.gview or !pardes.views.isOpen(s.core, s.gview)) return false; - s.core.toView(s.gview); + s.core.toView(.at(s.gview)); return true; } @@ -2680,7 +2680,7 @@ const Shell = struct { s.gview = s.core.live; for (0..pardes.views.max) |i| { const k: u8 = @intCast(i); - if (k != s.gview and pardes.views.isOpen(s.core, k) and !pardes.views.isAway(s.core, k)) s.core.closeView(k); + if (k != s.gview and pardes.views.isOpen(s.core, k) and !pardes.views.isAway(s.core, k)) s.core.closeView(.at(k)); } } @@ -2759,7 +2759,7 @@ const Shell = struct { if (s.gens[e.pane] == e.gen) eof: { if (e.failure) |err| { s.closePty(e.pane); - s.core.readerFailed(e.pane, err); + s.core.readerFailed(.at(e.pane), err); break :eof; } const pt = if (s.ptys[e.pane]) |*pt| pt else { @@ -2789,7 +2789,7 @@ const Shell = struct { }, .lsp_status => |text| { var mbuf: [256]u8 = undefined; - s.core.setStatus(s.core.view().active, message.stamp(&mbuf, "lsp", text)); + s.core.setStatus(.at(s.core.view().active), message.stamp(&mbuf, "lsp", text)); s.lsp_allocator.free(text); }, .pipe => |response_value| { @@ -3334,25 +3334,25 @@ fn spawnPane(ctx: ?*anyopaque, pane: u8, cwd: []const u8) void { // start leaves the running one be (pty/ctl's exec). const running = s.ptys[pane] != null; const child = host_io.forkShell(s.core, pane, s.prompt_rcs, s.core.shellBin(), cwd, s.core.view().screen_h, s.core.view().screen_w) catch |err| { - if (running) return s.core.restartFailed(pane, err); - return s.core.shellFailed(pane, err); + if (running) return s.core.restartFailed(.at(pane), err); + return s.core.shellFailed(.at(pane), err); }; s.closePty(pane); if (s.ptys[pane] != null) { _ = libc.close(child.file.handle); host_io.retireShell(child.pid); - return s.core.reportError(pane, "shell", error.WorkersBusy); + return s.core.reportError(.at(pane), "shell", error.WorkersBusy); } s.gens[pane] +%= 1; const command = s.core.panes[pane].?.command != null; const pt: Pty = .{ .fd = child.file.handle, .pid = child.pid, .serial = s.core.panes[pane].?.serial, .cmd = .{ .watched = command and host_io.watchExit(child.pid), .fd = child.file.handle } }; s.ptys[pane] = pt; var lbuf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined; - if (host_io.shellCwd(pt.pid, &lbuf)) |wd| s.core.setCwd(pane, wd); + if (host_io.shellCwd(pt.pid, &lbuf)) |wd| s.core.setCwd(.at(pane), wd); if (!s.threads_ok) return; s.ptys[pane].?.reader = s.queue.startReader(.{ .handle = pt.fd, .flags = .{ .nonblocking = false } }, pane, s.gens[pane]) catch |err| { s.closePty(pane); - return s.core.reportError(pane, "terminal reader", err); + return s.core.reportError(.at(pane), "terminal reader", err); }; } @@ -3363,16 +3363,16 @@ fn takeShell(s: *Shell, pane: u8, a: host_io.Adoption) void { s.gens[pane] +%= 1; s.ptys[pane] = .{ .fd = a.fd, .pid = a.pid, .serial = s.core.panes[pane].?.serial, .cmd = .{} }; var exe_buf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined; - s.core.acknowledgeShell(pane, host_io.processExe(a.pid, &exe_buf) orelse "sh", host_io.marksPrompts(a.pid)); + s.core.acknowledgeShell(.at(pane), host_io.processExe(a.pid, &exe_buf) orelse "sh", host_io.marksPrompts(a.pid)); var lbuf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined; - if (host_io.shellCwd(a.pid, &lbuf)) |wd| s.core.setCwd(pane, wd); + if (host_io.shellCwd(a.pid, &lbuf)) |wd| s.core.setCwd(.at(pane), wd); const tiny: posix.winsize = .{ .row = 1, .col = 1, .xpixel = 0, .ypixel = 0 }; _ = posix.system.ioctl(a.fd, TIOCSWINSZ, @intFromPtr(&tiny)); if (s.core.panes[pane]) |pn| ptyResize(s, pane, @max(pn.cols, 1), @max(pn.rows, 1)); if (!s.threads_ok) return; s.ptys[pane].?.reader = s.queue.startReader(.{ .handle = a.fd, .flags = .{ .nonblocking = false } }, pane, s.gens[pane]) catch |err| { s.closePty(pane); - return s.core.reportError(pane, "terminal reader", err); + return s.core.reportError(.at(pane), "terminal reader", err); }; } @@ -3501,14 +3501,14 @@ fn lsp(ctx: ?*anyopaque, req: host_io.Lsp.Request) void { const s = shellOf(ctx); if (s.threads_ok) return s.queue.startLsp(s.core, req); s.core.update(.{ .lsp_resp = .{ .id = req.id, .rows = null } }); - s.core.reportError(req.pane, "lsp", error.WorkersUnavailable); + s.core.reportError(.at(req.pane), "lsp", error.WorkersUnavailable); } fn pipe(ctx: ?*anyopaque, id: u32) void { const s = shellOf(ctx); if (s.threads_ok) return selection_pipe.start(s.io, s.gpa, s.core, s.pipe_tasks, id, s.queue, Queue.pushPipe); s.core.update(.{ .pipe_resp = .{ .id = id, .success = false, .outputs = &.{} } }); - s.core.reportError(s.core.view().active, "pipe", error.WorkersUnavailable); + s.core.reportError(.at(s.core.view().active), "pipe", error.WorkersUnavailable); } /// A draw (api.draw) on a worker, as a job is. @@ -3579,7 +3579,7 @@ fn handOver(ctx: ?*anyopaque, seq: u32, bytes: []const u8) void { fn pollCwds(core: *pardes.Pardes, ptys: *[pardes.MAX_PANES]?Pty) void { for (ptys, 0..) |slot, id| if (slot) |pt| { var lbuf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined; - if (host_io.ttyCwd(pt.pid, pt.fd, core.settings.shell.effective.get(), &lbuf)) |cwd| core.setCwd(id, cwd); + if (host_io.ttyCwd(pt.pid, pt.fd, core.settings.shell.effective.get(), &lbuf)) |cwd| core.setCwd(.at(id), cwd); }; } diff --git a/dev/host_io.zig b/dev/host_io.zig index 377263a4..2ee7c47e 100644 --- a/dev/host_io.zig +++ b/dev/host_io.zig @@ -54,12 +54,12 @@ pub fn stopWorkers() void { pub fn restoreCore(gpa: std.mem.Allocator, core: *pardes.Pardes, path: []const u8, peers: *replica.Peers, inotify_fd: c_int, watches: *file_watch.Table) ?*pardes.Pardes { peers.dropAll(core); const bytes = pardes.dump.restoreBytes(core, gpa, path) catch |err| { - core.reportError(core.view().active, "Restore", err); + core.reportError(.at(core.view().active), "Restore", err); return null; }; defer gpa.free(bytes); const nc = pardes.dump.restore(core, bytes, path) catch |err| { - core.reportError(core.view().active, "Restore", err); + core.reportError(.at(core.view().active), "Restore", err); return null; }; file_watch.unwatchAll(inotify_fd, watches); @@ -93,13 +93,13 @@ pub const Adoptions = struct { pub fn adoptShell(a: *Adoptions, core: *pardes.Pardes, pid: libc.pid_t, fd: c_int) void { if (pid == 0) { 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" })); + return core.setMessage(.at(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 }; a.len += 1; if (core.adoptShell()) |id| { - a.list[a.len - 1].pane = id; + a.list[a.len - 1].pane = id.index(); a.taken += 1; return; } @@ -108,7 +108,7 @@ pub const Adoptions = struct { // No room for it: its master goes, and the shell with this session. _ = libc.close(fd); 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})); + core.setMessage(.at(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. @@ -549,7 +549,7 @@ pub fn forkShell( // The daemon keeps a dup: this session killed outright never hangs the // shell up (daemon.zig). @import("runtime").daemon.pty(pid, master); - if (core) |c| c.acknowledgeShell(pane, std.mem.span(spawn.path), one_line == null and spawn.argv[1] != null); + if (core) |c| c.acknowledgeShell(.at(pane), std.mem.span(spawn.path), one_line == null and spawn.argv[1] != null); return .{ .file = .{ .handle = master, .flags = .{ .nonblocking = false } }, .pid = pid }; } @@ -1481,7 +1481,7 @@ fn sleepMs(ms: i64) void { /// change), and "saved" said on the pane. pub fn writeFile(core: *pardes.Pardes, watches: *file_watch.Table, pane: u8, path: []const u8, bytes: []const u8) void { filesystem.write(core, path, bytes) catch |err| - return core.saveFailed(pane, path, err); + return core.saveFailed(.at(pane), path, err); if (core.panes[pane]) |pn| if (pn.file) |f| if (std.mem.eql(u8, f.path, path)) { if (watches[pane]) |*w| if (w.serial == pn.serial) switch (w.generation) { .text => w.generation = .{ .text = std.hash.Wyhash.hash(0, bytes) }, @@ -1489,7 +1489,7 @@ pub fn writeFile(core: *pardes.Pardes, watches: *file_watch.Table, pane: u8, pat }; }; var mbuf: [256]u8 = undefined; - core.setMessage(pane, pardes.Messages.Message.stamp(&mbuf, "saved", path)); + core.setMessage(.at(pane), pardes.Messages.Message.stamp(&mbuf, "saved", path)); // The init file, saved here (Config): its settings take effect now. pardes.exec.reapplyInitFile(core, path, bytes); // The plumbing file (Plumb): its rules in force now. @@ -1527,12 +1527,12 @@ pub fn writeDump(core: *pardes.Pardes, bytes: []const u8) void { pub fn dumpThemes(core: *pardes.Pardes, io: std.Io, gpa: std.mem.Allocator, pane: u8) void { const config_dir = core.opts.config_dir orelse return; const out_dir = pardes.config.User.dumpThemes(io, gpa, config_dir, pardes.themes) catch |err| { - core.reportError(pane, "dump themes", err); + core.reportError(.at(pane), "dump themes", err); return; }; defer gpa.free(out_dir); var mbuf: [256]u8 = undefined; - core.setMessage(pane, pardes.Messages.Message.stamp(&mbuf, "dumped themes", out_dir)); + core.setMessage(.at(pane), pardes.Messages.Message.stamp(&mbuf, "dumped themes", out_dir)); } pub const PtyTests = struct { diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index 70ea3295..48b5d3d1 100644 --- a/dev/tui/tui.zig +++ b/dev/tui/tui.zig @@ -1500,7 +1500,7 @@ const Shell = struct { if (t.stub >= 0) daemon.tellStub(t.stub, "d{s}", .{daemon.name()}); } if (rec.fresh) return; - for (0..pardes.views.max) |k| if (k != s.own and pardes.views.isOpen(core, @intCast(k)) and !pardes.views.isAway(core, @intCast(k))) core.closeView(@intCast(k)); + for (0..pardes.views.max) |k| if (k != s.own and pardes.views.isOpen(core, @intCast(k)) and !pardes.views.isAway(core, @intCast(k))) core.closeView(.at(k)); } fn waitInput(ctx: ?*anyopaque, timeout_ms: u32) void { @@ -1673,7 +1673,7 @@ const Shell = struct { // The terminal's input goes into its view. switch (event) { .key_press, .mouse, .paste, .paste_start, .paste_end, .winsize, .focus_in, .focus_out, .quit => { - if (s.local() and s.client == null) core.toView(s.own); + if (s.local() and s.client == null) core.toView(.at(s.own)); }, else => {}, } @@ -1807,7 +1807,7 @@ const Shell = struct { }, .lsp_status => |text| { var mbuf: [256]u8 = undefined; - core.setStatus(core.view().active, message.stamp(&mbuf, "lsp", text)); + core.setStatus(.at(core.view().active), message.stamp(&mbuf, "lsp", text)); s.lsp_gpa.free(text); }, .pipe_done => |response_value| { @@ -1851,7 +1851,7 @@ const Shell = struct { if (!sc.on or sc.vx.state.in_band_resize) return; const ws = sc.tty.getWinsize() catch return; if (sc.size) |was| if (std.meta.eql(was, ws)) return; - if (s.client == null) s.core.toView(s.own); + if (s.client == null) s.core.toView(.at(s.own)); s.resized(sc, ws); } @@ -1885,7 +1885,7 @@ const Shell = struct { }; for (&s.ptys, 0..) |*slot, id| if (slot.*) |pt| { var lbuf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined; - if (host_io.ttyCwd(pt.pid, pt.file.handle, s.core.settings.shell.effective.get(), &lbuf)) |cwd| s.core.setCwd(id, cwd); + if (host_io.ttyCwd(pt.pid, pt.file.handle, s.core.settings.shell.effective.get(), &lbuf)) |cwd| s.core.setCwd(.at(id), cwd); }; const sc = s.term() orelse return; @@ -2035,8 +2035,8 @@ const Shell = struct { // start leaves the running one be (pty/ctl's exec). const running = s.ptys[pane] != null; const child = host_io.forkShell(s.core, pane, s.prompt_rcs, s.core.shellBin(), cwd, s.core.view().screen_h, s.core.view().screen_w) catch |err| { - if (running) return s.core.restartFailed(pane, err); - return s.core.shellFailed(pane, err); + if (running) return s.core.restartFailed(.at(pane), err); + return s.core.shellFailed(.at(pane), err); }; closePty(ctx, pane); // a shell still in the slot goes, reaped s.gens[pane] +%= 1; @@ -2046,7 +2046,7 @@ const Shell = struct { // Only a shell given no directory is asked where it is: one given a // directory is named by it already (newShell), and asked now, before // its chdir, it would answer this process's, a rename to undo. - if (cwd.len == 0) if (host_io.shellCwd(child.pid, &lbuf)) |wd| s.core.setCwd(pane, wd); + if (cwd.len == 0) if (host_io.shellCwd(child.pid, &lbuf)) |wd| s.core.setCwd(.at(pane), wd); if (s.threads_ok) { if (s.ptys[pane]) |*pt| { pt.reader = s.io.concurrent(readPty, .{ s.io, s.gpa, pt.file, @as(usize, pane), s.gens[pane], s.loop }) catch pt.reader; @@ -2062,9 +2062,9 @@ const Shell = struct { const file: std.Io.File = .{ .handle = a.fd, .flags = .{ .nonblocking = false } }; s.ptys[pane] = .{ .file = file, .pid = a.pid, .reader = .{ .any_future = null, .result = {} }, .cmd = .{} }; var exe_buf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined; - s.core.acknowledgeShell(pane, host_io.processExe(a.pid, &exe_buf) orelse "sh", host_io.marksPrompts(a.pid)); + s.core.acknowledgeShell(.at(pane), host_io.processExe(a.pid, &exe_buf) orelse "sh", host_io.marksPrompts(a.pid)); var lbuf: [pardes.memory.limits.host_path_cap + 1]u8 = undefined; - if (host_io.shellCwd(a.pid, &lbuf)) |wd| s.core.setCwd(pane, wd); + if (host_io.shellCwd(a.pid, &lbuf)) |wd| s.core.setCwd(.at(pane), wd); const tiny: posix.winsize = .{ .row = 1, .col = 1, .xpixel = 0, .ypixel = 0 }; _ = posix.system.ioctl(a.fd, TIOCSWINSZ, @intFromPtr(&tiny)); if (s.core.panes[pane]) |pn| ptyResize(s, pane, @max(pn.cols, 1), @max(pn.rows, 1)); @@ -2185,7 +2185,7 @@ const Shell = struct { const s = of(ctx); if (!s.threads_ok) { s.core.update(.{ .lsp_resp = .{ .id = req.id, .rows = null } }); - return s.core.reportError(req.pane, "lsp", error.WorkersUnavailable); + return s.core.reportError(.at(req.pane), "lsp", error.WorkersUnavailable); } host_io.Lsp.start(s.io, s.lsp_gpa, s.core, &s.lsp_task, req, s, deliverLspRows); } @@ -2199,7 +2199,7 @@ const Shell = struct { const s = of(ctx); if (!s.threads_ok) { s.core.update(.{ .pipe_resp = .{ .id = id, .success = false, .outputs = &.{} } }); - return s.core.reportError(s.core.view().active, "pipe", error.WorkersUnavailable); + return s.core.reportError(.at(s.core.view().active), "pipe", error.WorkersUnavailable); } selection_pipe.start(s.io, s.gpa, s.core, &s.pipe_tasks, id, s, deliverPipe); } -- cgit v1.3