From 0f16886d2f8f53b8d746341e3e2c9fc55f2446c2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 11:38:12 -0300 Subject: A list pane opened from a terminal that has not said its directory yet lands in the session's ThemeSel (Themes) in an init file ran at a terminal whose shell had not reported its cwd, so +Themes opened as /+Themes. Co-Authored-By: Claude Opus 5.5 --- src/Output.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Output.zig') diff --git a/src/Output.zig b/src/Output.zig index b3c31be2..1461757f 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -669,7 +669,10 @@ pub fn openFonts(p: *Pardes, id: usize) !void { fn openStepped(p: *Pardes, id: usize, from: Origin, content: []u8) !void { errdefer p.gpa.free(content); const pane = p.panes[id] orelse return error.MissingPane; - const dir = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice(); + const own = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice(); + // A terminal whose shell has not said where it is yet (an init file's + // word at boot): the session's directory, not `/`. + const dir = if (own.len == 0) p.sessionDir() else own; const free = p.freeSlot() orelse return error.NoPaneSlots; _ = try open(p, free, dir, from, "", content); exec.placeNew(p, id, id, free, .doc); -- cgit v1.3