From bac1c62c1905a5ce11a6b630d556bc349041628b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 13:30:42 -0300 Subject: An image's or a terminal's tag says petscii:on when it is drawn as glyph art, as it always is with no graphics; Petscii on|off still chooses for when there are The images and tagbottomimage goldens are re-recorded for the word. Co-Authored-By: Claude Opus 5.5 --- src/ninep/ctl.zig | 9 +++++++++ src/ninep/pane.zig | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/ninep') diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index f2490e38..75e4b823 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -1855,6 +1855,15 @@ test "a builtin for one kind of pane is refused on another, and still acts on it const glyphs = doc.image.?.glyph_art; try testing.expectEqual(Status.ok, wr(p, Node.of(doc.serial, .ctl), "Petscii\n").reply.status); try testing.expect(doc.image.?.glyph_art != glyphs); + // Its tag says what is drawn: with no graphics, glyph art whatever + // Petscii chose; with them, what it chose. + for ([_]bool{ false, true }) |art| { + doc.image.?.glyph_art = art; + p.native_images = false; + try testing.expect(std.mem.indexOf(u8, try pardes.tagline.tagPrefix(p, doc), " petscii:on ") != null); + p.native_images = true; + try testing.expect(std.mem.indexOf(u8, try pardes.tagline.tagPrefix(p, doc), if (art) " petscii:on " else " petscii:off ") != null); + } } test "exec Save writes the named file through the host" { diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index ae4dcd71..92ce8d8a 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -751,7 +751,7 @@ pub fn applyTagTruncation(p: *Pardes, pane: *Pane) void { pane.tag.own = empty; // what is left is the prefix; the cursor goes after it pane.tag.cur_row = 0; - pane.tag.cur_col = if (tagline.pathPrefix(p.scratch.allocator(), pane)) |prefix| @intCast(prefix.len) else |_| 0; + pane.tag.cur_col = if (tagline.pathPrefix(p, p.scratch.allocator(), pane)) |prefix| @intCast(prefix.len) else |_| 0; pane.tag.vsel.active = false; pane.tag.nsel = 0; pf.tag_rewrite = true; -- cgit v1.3