diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 11:14:09 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | c820afd8601ef14fda651c63f542476e12adcf11 (patch) | |
| tree | 181aca8abdffa387f1eff3a9bd8f6acf109a5deb /src/pardes.zig | |
| parent | f18b1adc04dad68e115bb70c42e26472733daf1d (diff) | |
| download | pardes-c820afd8601ef14fda651c63f542476e12adcf11.tar.gz pardes-c820afd8601ef14fda651c63f542476e12adcf11.zip | |
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 <name>` 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 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |
