From e61cc19e5d60403f721338f61e62a2e5569c9846 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 11:37:45 -0300 Subject: The Tutor pane is named +Tutor in the session's directory, not /Tutor Every other generated pane is named `/+`: +New, +Errors, the outputs. Tutor alone was a bare `/Tutor`, a real path at the root, so a Save would try to write there, and /index listed it as if it were a file. A scan of the other generated panes found no other bare absolute name. The three snapshot goldens that show the Tutor tag were re-recorded by name (tutor, builtins, leader). Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 7fddf19f..eb9aa11f 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1112,6 +1112,16 @@ test "first document fallback splits like Tty from the originating pane" { }; } +test "the Tutor pane is named +Tutor in the session's directory, never a bare path at the root" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true }); + defer p.deinit(); + const session = "/project/src"; + @memcpy(p.session_dir[0..session.len], session); + p.session_dir_len = session.len; + const tutor = try p.openTutorView(1); + try std.testing.expectEqualStrings("/project/src/+Tutor", tutor.file.?.path); +} + test "first document keeps its originating shell and only opens a column when it fits" { for ([_]u16{ 199, 200 }) |width| { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = width, .rows = 32 }); @@ -6573,7 +6583,9 @@ pub const Pardes = struct { pub fn openTutorView(p: *Pardes, id: usize) !*Pane { const content = try p.gpa.dupe(u8, tutor_text); errdefer p.gpa.free(content); - const path = try p.gpa.dupe(u8, "/Tutor"); + // A generated pane, named as every one is: `+` in the session's + // directory, never a bare path Save could write at the root. + const path = try std.fs.path.join(p.gpa, &.{ p.sessionDir(), "+Tutor" }); errdefer p.gpa.free(path); const history = try panes.File.History.create(p.gpa); errdefer p.gpa.destroy(history); -- cgit v1.3