summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 22:48:21 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitf0e162d287f44a562ff79e7c1d2cf81ace00c836 (patch)
tree098428d08600eef0a8eb28939cad955315dd3d95 /src/terminal.zig
parent6f42f51cd652e189408eace598f99ec25b9542f8 (diff)
downloadpardes-f0e162d287f44a562ff79e7c1d2cf81ace00c836.tar.gz
pardes-f0e162d287f44a562ff79e7c1d2cf81ace00c836.zip
Dumps and init files from before 0.0.4 load no more of their old tag formats, and three orphan test scripts go
A2: a restored pane's tag tail comes from the dump's tag_tail, which every dump since 0.0.4 writes; the 27 earlier default tails that were recognised to upgrade, restoreTail, tailClass, savedPrefix and restoreTailAt, pdf_view's and image's legacySavedPrefix, a terminal's TTY tag prefix and its raw output tail replay, and the ThemeSel, FontSel and ColumnTags words (init lines and dumped output names) go, with their tests; the CHANGELOG says so. A4: test/fs_soak.py, referenced nowhere (monkey9p.py does its work). A6: test/column_grip.py and test/look_placement.py, referenced nowhere; the six review scripts docs/ui-review.md names stay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig33
1 files changed, 1 insertions, 32 deletions
diff --git a/src/terminal.zig b/src/terminal.zig
index c99a92a6..6bf46bef 100644
--- a/src/terminal.zig
+++ b/src/terminal.zig
@@ -509,13 +509,7 @@ pub fn restore(p: *Pardes, src: dump.Pane, live: bool) !*Pane {
pane.ovl = .{ .row = 0, .rows = 1, .text = try p.gpa.dupe(u8, terminal.stream) };
return pane;
}
- // An older dump's raw output tail cannot come back live: cut off mid
- // redraw, or written at sizes the pane no longer has, it replays as
- // garbage. Its rendered text can.
- const legacy_text = live and !terminal.stream_is_screen and terminal.stream.len > 0;
- const bytes = if (legacy_text)
- try std.mem.replaceOwned(u8, p.scratch.allocator(), terminal.stream, "\n", "\r\n")
- else if (terminal.stream_b64.len > 0)
+ const bytes = if (terminal.stream_b64.len > 0)
try dump.decodeBytes(p.scratch.allocator(), terminal.stream_b64)
else
&.{};
@@ -759,31 +753,6 @@ test "a restored terminal keeps its history above a marker and gets a shell wher
try std.testing.expect(old_at < mark_at);
}
-test "an older dump comes back live from its rendered text, not its raw output tail" {
- if (comptime !enabled) return error.SkipZigTest;
- const gpa = std.testing.allocator;
- const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 });
- defer p.deinit();
- // A tail cut mid-redraw: relative moves from a cursor it never set.
- const tail = try dump.encodeBytes(gpa, "\x1b[7A\x1b[2Kgarbage\x1b[3B\x1b[9Gmore");
- defer gpa.free(tail);
- const restored = try restore(p, .{
- .kind = .terminal,
- .tag = "",
- .body = "",
- .cols = 40,
- .rows = 12,
- .terminal = .{ .stream = "$ ls\na.txt b.txt\n$ ", .stream_b64 = tail },
- }, true);
- defer gpa.destroy(restored);
- defer deinitEmulator(restored, gpa);
- defer deinitPendingCommand(restored);
- const text = try screenTextAlloc(restored, gpa);
- defer gpa.free(text);
- try std.testing.expect(std.mem.indexOf(u8, text, "$ ls\na.txt b.txt") != null);
- try std.testing.expect(std.mem.indexOf(u8, text, "garbage") == null);
-}
-
/// Record and parse one live pty read, invalidate its motion surface, and
/// follow it only when the body (possibly parked under a tag edit) is raw.
pub fn feedOutput(p: *Pardes, pane: *Pane, bytes: []const u8) void {