diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 06:37:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 07:16:43 -0300 |
| commit | 5d66ae0b2864dea14c2e3906bfc5c93a727c5518 (patch) | |
| tree | 071396a0934806229ff17bc5cfbc23e6964eedd6 /src/terminal.zig | |
| parent | 0ac1b5a0c52357927a6e1eb525821144e4365474 (diff) | |
| download | pardes-5d66ae0b2864dea14c2e3906bfc5c93a727c5518.tar.gz pardes-5d66ae0b2864dea14c2e3906bfc5c93a727c5518.zip | |
A terminal's petscii:on survives Dump and Restore: the dump says it, and the restored terminal draws its graphics as glyph art again
An image pane's Petscii choice was dumped; a terminal's was not, so a
Restore brought it back drawing pixels. dump.Terminal carries petscii,
and a restored terminal is turned to glyph art when it was.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/terminal.zig')
| -rw-r--r-- | src/terminal.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/terminal.zig b/src/terminal.zig index b7872d4e..80b9455c 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -1740,6 +1740,7 @@ pub fn dumpPane( .stream = stream[0..len], .stream_b64 = try dump.encodeBytes(arena, try screenVt(pane, arena)), .stream_is_screen = true, + .petscii = petscii(pane) orelse false, .cursor = .{ .col = pane.terminal.?.vt.screens.active.cursor.x, .row = pane.terminal.?.vt.screens.active.cursor.y, @@ -3086,6 +3087,11 @@ test "without pixels, or by the Petscii builtin, a terminal's image is glyph art try std.testing.expectEqual(@as(usize, 0), imagePlaces(s).len); try std.testing.expect(painted(s.at(tx, y))); try std.testing.expect(std.mem.indexOf(u8, try tagline.tagPrefix(p, pane), " petscii:on") != null); + // Dumped and restored, it is still glyph art. + try pardes.dump.dumpState(p); + const restored = try pardes.dump.restore(p, p.dump_out.?, "/tmp/pardes.dump.zon"); + defer restored.deinit(); + try std.testing.expectEqual(@as(?bool, true), petscii(restored.panes[0].?)); try std.testing.expect(p.executeBuiltinLine(0, "Petscii")); _ = frame.reset(.retain_capacity); s = try p.render(frame.allocator()); |
