diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 11:36:18 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 03a96b0b49e1927548b4bb37e2b4eb58be14f5b7 (patch) | |
| tree | 15c44d510c7008e44e381c672ed86f98a89c40ee /src/exec.zig | |
| parent | 05118f216d524c96ffe936e494b8ecce26303de1 (diff) | |
| download | pardes-03a96b0b49e1927548b4bb37e2b4eb58be14f5b7.tar.gz pardes-03a96b0b49e1927548b4bb37e2b4eb58be14f5b7.zip | |
The panes present at boot are the log's first records, before what an init file said
The boot announce ran after the init file, so its msg (ThemeSel: renamed to Themes) came before new 1. A msg or path record said while the log is still empty now announces the panes first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/exec.zig b/src/exec.zig index 9e46b434..421bfd13 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -824,10 +824,8 @@ pub fn applyStartupConfig(p: *Pardes) void { } test "an init file's ThemeSel runs as Themes and says it was renamed" { - const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 }); + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24, .startup_config = "ThemeSel\n" }); defer p.deinit(); - p.opts.startup_config = "ThemeSel\n"; - applyStartupConfig(p); var listed = false; for (p.panes) |slot| if (slot) |pane| if (pane.file) |f| if (f.output) |o| { listed = listed or std.meta.eql(o.from, panes.Output.Origin{ .cmd = .Themes }); @@ -838,6 +836,14 @@ test "an init file's ThemeSel runs as Themes and says it was renamed" { said = said or std.mem.eql(u8, pane.msg[0..pane.msg_len], "ThemeSel: renamed to Themes"); }; try std.testing.expect(said); + // The panes there at boot are the log's first records, before what the + // init file said. + const th = @import("ninep/testing.zig"); + const log = @intFromEnum(pardes.ctlfs.TopFile.log); + const h = th.call(p, .{ .tag = 1, .op = .open, .node = log }).reply.handle; + defer _ = th.call(p, .{ .tag = 3, .op = .release, .node = log, .handle = h }); + const text = th.call(p, .{ .tag = 2, .op = .read, .node = log, .handle = h, .size = 1 << 16 }).bytes; + try std.testing.expectStringStartsWith(text, "new "); } test "an init file's retired ColumnTags line is said and ignored" { |
