From 0bb3f6d4f71a3a10eba846ae3ab5064630b12201 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 08:23:46 -0300 Subject: A new terminal is named by its directory from the start, so its shell arriving there is no rename Tty's terminal was `new N /` until its shell reported its directory, then `rename N `: a rename for no change of place. The pane owns the directory it is started in from the first; only a move elsewhere renames. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index de4d6abc..c6e68517 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4813,6 +4813,10 @@ pub const Pardes = struct { std.debug.assert(p.panes[id] == null); if (cwd.len > limits.host_path_cap) return error.PathTooLong; const pane = try panes.Terminal.create(p.gpa, p.screen_w, p.screen_h); + // Named by the directory it is started in from the first, so the + // shell saying it is there is no rename (`new N /` then `rename`); + // out of memory for it, the shell names it when it says. + if (cwd.len > 0) pane.setOwnedCwd(cwd) catch {}; panes.Terminal.armShellSpawn(pane); p.installPane(id, pane); p.emitSpawn(id, pane.serial, cwd); -- cgit v1.3