summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 22:59:25 -0300
committerGabriel Schneider <[email protected]>2026-11-05 23:58:31 -0300
commit3ebdbe26a14546f8e4ee06462850aad85f1c9646 (patch)
tree10b81fa631e70d5ec0659ea05bb770587cf99405 /src/ninep/ctl.zig
parentdfcc040ac979b695dc2e68b9d866c2769ba6d928 (diff)
downloadpardes-3ebdbe26a14546f8e4ee06462850aad85f1c9646.tar.gz
pardes-3ebdbe26a14546f8e4ee06462850aad85f1c9646.zip
settings #3, the terminal's three go, each the value it had by default: Pager (a terminal's shell pages into a +Pager where the environment names no pager, so PAGER and GIT_PAGER set by the user are what an opt-out is; host_io's Paging.terminal_off goes), PagerColor (a +Pager keeps its program's colours; pager.parse loses its colour argument, its callers in Core.zig and ninep/ctl.zig with it) and TermImages (a new terminal draws its images as pixels where it can, Petscii still flips one; terminal.adoptSettings and its call in panes.zig go); deleted tests: "settings: Pager is pardes by default, off taken, anything else refused with its choices" and "PagerColor off: the same text, no spans, overstrike included" (the man page's overstrike case pins what stays); rewritten: TermImages' test as a new terminal drawing pixels, ctl's pager test with the second +Pager keeping its colours, host_io's environment test for the one terminal paging, process/tree's /commands row on Wrap; the reference, setup and changelog say an environment's PAGER is the way out; no golden changes; gates on tui: core-test 964/964, behaviour-test 241/241, unit-test 1480/1481, pane-test 171/172, snap all 105 scripts ok, process-test 0 of 37 failed; gui unit-test 1524/1525
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index f8cda59a..3784cf41 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -690,7 +690,7 @@ pub fn writePager(p: *Pardes, req: Req) Reply {
/// The text a /pager open wrote after its directory (`held`), a program's
/// output for a terminal, put in the +Pager `serial` as `pardes -` once
/// wrote it to the body: through ghostty-vt (pager.zig), its colours kept
-/// as the pane's spans unless PagerColor is off, one undo step, and left
+/// as the pane's spans, one undo step, and left
/// clean. Reads of the pane are its plain text. The held bytes go either way.
pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfMemory}!void {
if (held.items.len == 0) return;
@@ -698,7 +698,7 @@ pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfM
const id = p.paneBySerial(serial) orelse return;
const pane = p.panes[id].?;
const f = if (pane.file) |*file| file else return;
- const page = try pardes.pager.parse(p.gpa, held.items, p.settings.pager_color);
+ const page = try pardes.pager.parse(p.gpa, held.items);
held.clearAndFree(p.gpa);
if (page.text.len == 0 and f.content.len == 0) return page.deinit(p.gpa);
if (!pane.fs.nomark) panes.File.pushUndo(p, pane);
@@ -2715,9 +2715,8 @@ test "what a /pager open writes after its directory is the text: plain in the bo
try testing.expectEqualStrings("red /a\nNext\n", f.content);
try testing.expectEqual(@as(usize, 0), f.pager_spans.len);
- // PagerColor off, and an open closed with no read: the same text, plain,
- // in at the editor's next step (a close through a mount never waits).
- p.settings.pager_color = false;
+ // An open closed with no read: the text in at the editor's next step
+ // (a close through a mount never waits), its colours kept.
const kept = try testing.allocator.dupe(u8, f.content);
defer testing.allocator.free(kept);
const shut = call(p, .{ .tag = 7, .op = .open, .node = pager, .omode = 1 }).reply.handle;
@@ -2734,7 +2733,7 @@ test "what a /pager open writes after its directory is the text: plain in the bo
try testing.expectEqualStrings("", next.content);
fillClosedPagers(p);
try testing.expectEqualStrings("green\n", next.content);
- try testing.expectEqual(@as(usize, 0), next.pager_spans.len);
+ try testing.expectEqual(@as(usize, 1), next.pager_spans.len);
try testing.expectEqual(next.revision, next.saved_revision);
}