diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 11:37:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | e61cc19e5d60403f721338f61e62a2e5569c9846 (patch) | |
| tree | 94fb8663bf91866b79592de265ed88ea24d54131 | |
| parent | 85728b391a0137f9c2b63c3234364b1f81f6be78 (diff) | |
| download | pardes-e61cc19e5d60403f721338f61e62a2e5569c9846.tar.gz pardes-e61cc19e5d60403f721338f61e62a2e5569c9846.zip | |
The Tutor pane is named +Tutor in the session's directory, not /Tutor
Every other generated pane is named `<dir>/+<Name>`: +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 <[email protected]>
| -rw-r--r-- | src/pardes.zig | 14 | ||||
| -rw-r--r-- | test/snapshots/builtins.golden | 2 | ||||
| -rw-r--r-- | test/snapshots/leader.golden | 2 | ||||
| -rw-r--r-- | test/snapshots/tutor.golden | 2 |
4 files changed, 16 insertions, 4 deletions
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); diff --git a/test/snapshots/builtins.golden b/test/snapshots/builtins.golden index 6b79d47f..0f13ed7c 100644 --- a/test/snapshots/builtins.golden +++ b/test/snapshots/builtins.golden @@ -27,7 +27,7 @@ |16: == snap tutor-from-index grid=120x67 cursor=7,16 |10: 1 pardes builtins under SPC h Tutor -|15: /Tutor Save Tty Collapse Del +|15: /tmp/pardes-snap/builtins/cwd/+Tutor Save Tty Collapse Del |16: 1 |17: 2 PARDES TUTOR |18: 3 tmux + vi + acme, from scratch. diff --git a/test/snapshots/leader.golden b/test/snapshots/leader.golden index 52528cde..bde9f7bf 100644 --- a/test/snapshots/leader.golden +++ b/test/snapshots/leader.golden @@ -18,7 +18,7 @@ |11: 6 == snap tutor grid=100x41 cursor=7,12 |6: 1 pardes builtins under SPC h Tutor -|11: /Tutor Save Tty Collapse Del +|11: /tmp/pardes-snap/leader/cwd/+Tutor Save Tty Collapse Del |12: 1 |13: 2 PARDES TUTOR |14: 3 tmux + vi + acme, from scratch. diff --git a/test/snapshots/tutor.golden b/test/snapshots/tutor.golden index 1be72b87..2976f99a 100644 --- a/test/snapshots/tutor.golden +++ b/test/snapshots/tutor.golden @@ -4,7 +4,7 @@ | /tmp/pardes-snap/tutor/cwd Tty+bash Save Mode Filter Collapse Del /tmp/pardes-snap/tutor/cwd Tty+bash Save Mode Filter Collapse Del | ls Tutor ls | -| /Tutor Save Tty Collapse Del +| /tmp/pardes-snap/tutor/cwd/+Tutor Save Tty Collapse Del | 1 | 2 PARDES TUTOR | 3 tmux + vi + acme, from scratch. |
