summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 08:23:46 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit0bb3f6d4f71a3a10eba846ae3ab5064630b12201 (patch)
tree0edd1670bca26434325e29fb8768ca793649e3b5 /src/pardes.zig
parent8157972cff633ee0135c81fd3f1195d9a73eb92f (diff)
downloadpardes-0bb3f6d4f71a3a10eba846ae3ab5064630b12201.tar.gz
pardes-0bb3f6d4f71a3a10eba846ae3ab5064630b12201.zip
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 <dir>`: 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 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig4
1 files changed, 4 insertions, 0 deletions
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);