From 6e2ed2e057ba95b3a86186c255d1965e1861bdf7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 09:47:53 -0300 Subject: A shell started again by pty/ctl exec is guarded against the rename flap as a new one is The guard that keeps a shell from taking this process's directory before its chdir lasted only until the first shell spoke; a shell started again in the same pane (pty/ctl exec) was asked with the old shell's word still standing. A spawn resets it. fs.py's naming test restarts one too. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/pardes.zig b/src/pardes.zig index 27cbf383..26c9246a 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4826,6 +4826,9 @@ pub const Pardes = struct { /// A child for pane `id` in `cwd`: a directory up to PATH_MAX, the ones /// past the effect's inline buffer kept here for perform to give. pub fn emitSpawn(p: *Pardes, id: usize, serial: u32, cwd: []const u8) void { + // A new shell has not said anything yet (setCwd's guard), whatever + // the one it replaces said. + if (p.panes[id]) |pane| pane.shell_spoke = false; if (p.spawn_dirs[id]) |old| p.gpa.free(old); p.spawn_dirs[id] = null; if (cwd.len > effect_path_cap) p.spawn_dirs[id] = p.gpa.dupe(u8, cwd) catch null; -- cgit v1.3