summaryrefslogtreecommitdiff
path: root/src/Terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 22:12:00 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit28d11d18a739864406a37a9b2c6f3fefc450b6bc (patch)
treeea48a3b269d2ad48f14f17bf2b7ea481a1bcd7f9 /src/Terminal.zig
parent5ee1e87a917bdca38351feeca88999cd67440994 (diff)
downloadpardes-28d11d18a739864406a37a9b2c6f3fefc450b6bc.tar.gz
pardes-28d11d18a739864406a37a9b2c6f3fefc450b6bc.zip
Restore brings a Tty bash pane back running bash
A dogfood agent's `Tty bash` pane came back from Restore running fish: the dump kept its directory but not the shell it was opened on. The dump's terminal record now carries that shell (empty for the configured one, as older dumps read), and Restore starts it again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Terminal.zig')
-rw-r--r--src/Terminal.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Terminal.zig b/src/Terminal.zig
index a390b76b..e50eb2df 100644
--- a/src/Terminal.zig
+++ b/src/Terminal.zig
@@ -668,6 +668,7 @@ test "a restored terminal keeps its history above a marker and gets a shell wher
const pane = p.panes[0].?;
feedOutput(p, pane, "old output\r\n$ ls\r\n");
try pane.setOwnedCwd("/tmp");
+ pane.shell = try gpa.dupe(u8, "bash"); // `Tty bash`: it comes back as bash
try dump.dumpState(p);
const restored = try dump.initFromDump(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 }, p.dump_out.?);
defer restored.deinit();
@@ -678,6 +679,7 @@ test "a restored terminal keeps its history above a marker and gets a shell wher
};
try std.testing.expect(spawned);
const again = restored.panes[0].?;
+ try std.testing.expectEqualStrings("bash", again.shell.?);
try std.testing.expectEqual(.spawn, again.pending_command.wait);
const text = try screenTextAlloc(again, gpa);
defer gpa.free(text);
@@ -1436,6 +1438,7 @@ pub fn dumpPane(
.collapsed = pane.collapsed,
.terminal = .{
.cwd = try arena.dupe(u8, pane.cwdSlice()),
+ .shell = try arena.dupe(u8, pane.shell orelse ""),
.stream = try arena.dupe(u8, text),
.stream_b64 = &.{},
.cursor = .{ .col = 0, .row = 0 },
@@ -1485,6 +1488,7 @@ pub fn dumpPane(
.collapsed = pane.collapsed,
.terminal = .{
.cwd = try arena.dupe(u8, pane.cwdSlice()),
+ .shell = try arena.dupe(u8, pane.shell orelse ""),
.stream = stream[0..len],
.stream_b64 = try dump.encodeBytes(arena, try screenVt(pane, arena)),
.stream_is_screen = true,