summaryrefslogtreecommitdiff
path: root/src/ninep/events.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 11:36:18 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit03a96b0b49e1927548b4bb37e2b4eb58be14f5b7 (patch)
tree15c44d510c7008e44e381c672ed86f98a89c40ee /src/ninep/events.zig
parent05118f216d524c96ffe936e494b8ecce26303de1 (diff)
downloadpardes-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/ninep/events.zig')
-rw-r--r--src/ninep/events.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ninep/events.zig b/src/ninep/events.zig
index 95b4926e..2fe25071 100644
--- a/src/ninep/events.zig
+++ b/src/ninep/events.zig
@@ -145,6 +145,12 @@ pub fn announce(p: *Pardes) void {
}
}
+/// The panes present at boot are the log's first records: something said
+/// before the first update ends (an init file's notice) waits for them.
+fn bootFirst(p: *Pardes) void {
+ if (newest(p) == null) announce(p);
+}
+
/// Records `<kind> <serial> <name>`.
pub fn noteLog(p: *Pardes, kind: LogKind, pane: *Pane) void {
var buf: [4 * 4096 + 64]u8 = undefined;
@@ -161,6 +167,7 @@ pub fn noteMessage(p: *Pardes, serial: u32, said: []const u8) void {
var buf: [pardes.Messages.LoggedMessage.cap + 32]u8 = undefined;
const kept = pardes.Messages.clip(said, pardes.Messages.LoggedMessage.cap);
const cut = if (kept.len < said.len) "…" else "";
+ bootFirst(p);
pushCounting(p, (if (serial == 0)
std.fmt.bufPrint(&buf, "msg - {s}{s}\n", .{ kept, cut })
else
@@ -175,6 +182,7 @@ pub fn noteMessage(p: *Pardes, serial: u32, said: []const u8) void {
/// `dump <path>` when a Dump is written, `restore <path>` first in a
/// Restore's replacement.
pub fn notePath(p: *Pardes, what: []const u8, path: []const u8) void {
+ bootFirst(p);
var buf: [pardes.memory.limits.host_path_cap + 16]u8 = undefined;
pushLog(p, std.fmt.bufPrint(&buf, "{s} {s}\n", .{ what, path }) catch return);
}