From ee316b57d58c91e103210b1adc428f618f630002 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 07:11:20 -0300 Subject: A line address to no open pane, `@p77:3`, is a miss said as one, not the active pane `@p:` goes the line way (parsePathLine), where a serial naming no pane quietly did nothing and look read back the active pane. Co-Authored-By: Claude Opus 5.5 --- src/look.zig | 5 +++-- src/ninep/ctl.zig | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/look.zig b/src/look.zig index 6a4fe1d1..28986552 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1365,8 +1365,9 @@ pub fn lookAt(p: *Pardes, id: usize, operand: []const u8) void { }, .pane => |t| { - if (t.id >= MAX_PANES) return; - const target = p.panes[t.id] orelse return; + // `@p` names no open pane: a miss, said. + if (t.id >= MAX_PANES or p.panes[t.id] == null) return missed(p, id, "no pane {s}", .{pl.path[0..@min(pl.path.len, 32)]}); + const target = p.panes[t.id].?; const before = p.active; clearNavigationSelection(p, target); focusPaneLine(p, t.id, t.at, .center); diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index b6fefa01..47ac2846 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -1963,4 +1963,9 @@ test "@p:
takes any sam address; a miss and an unknown serial a _ = wr(p, root, "@p999:/foo/\n"); try testing.expect(th.logHas(p, "look: no pane @p999")); try testing.expectEqualStrings("", rd(p, root, 0, 64).bytes); + // A line address to no pane is a miss too, not the active pane. + _ = wr(p, root, "@p77:1\n"); + try testing.expect(th.logHas(p, "look: no pane @p77")); + try testing.expectEqualStrings("", rd(p, root, 0, 64).bytes); } + -- cgit v1.3