From c820afd8601ef14fda651c63f542476e12adcf11 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 11:14:09 -0300 Subject: Nothing about a pane is logged before its new, and the boot terminal's new carries the session directory, not / and a rename A pane named in the update that made it (Config's init file, a look renamed on open) logged `rename N ` before `new N`, so a follower met a serial it had never seen. The boot shell, started with no directory, was announced as `new 1 /` and renamed once its shell spoke. Now noteLog drops the rename of a pane not yet announced, since its new carries the name, and announces a pane first for any other record about it. A terminal whose shell has not said where it is is named by the session's directory, where it was started, and the shell saying so is no rename. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index a63568db..ef713e0c 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5046,11 +5046,14 @@ pub const Pardes = struct { // is this process's directory, a rename to undo. That answer, then, // is not taken. if (pane.isTerminal() and !pane.shell_spoke and pane.cwd == .owned and std.mem.eql(u8, cwd, p.sessionDir())) return; + // One with no directory yet is named by the session's (nameOf): its + // shell saying it is there is no new name. + const same_name = cur.len == 0 and std.mem.eql(u8, cwd, p.sessionDir()); pane.setOwnedCwd(cwd) catch |err| return p.reportError(id, "directory", err); if (look.lookHoverPane(p) == id) look.cancelLookHover(p); // A terminal is named by its directory, so /log hears it renamed; one // not announced yet is announced under the new name. - if (pane.isTerminal() and !pane.fs.unannounced) ctlfs.events.noteLog(p, .rename, pane); + if (pane.isTerminal() and !same_name) ctlfs.events.noteLog(p, .rename, pane); } pub fn shellBin(p: *const Pardes) []const u8 { -- cgit v1.3