diff options
Diffstat (limited to 'src/ninep')
| -rw-r--r-- | src/ninep/ctl.zig | 2 | ||||
| -rw-r--r-- | src/ninep/pane.zig | 4 | ||||
| -rw-r--r-- | src/ninep/screen.zig | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index a72e7259..2e045a73 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -426,7 +426,7 @@ pub fn paneText(p: *Pardes, pane: *Pane, buf: *[pane_text_cap]u8) []const u8 { pane.serial, if (pane_files.tagOf(p, pane)) |tag| tag.len else |_| 0, // a length, as a stat's: none when the tag cannot be made // A terminal's body is its history, read whole on an open's first read. - if (pane.isTerminal()) panes.terminal.screenTextLen(pane) else pane_files.bodyOf(pane).len, + if (pane.isTerminal()) pardes.Term.scrollbackLen(pane.terminal) else pane_files.bodyOf(pane).len, // A directory pane is one, as acme's isdir says. @intFromBool(if (pane.file) |f| f.listing != null else false), @intFromBool(pane_files.dirtyOf(pane)), diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index 3fa45404..13a15206 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -317,7 +317,7 @@ pub fn fileSize(p: *Pardes, id: usize, f: PaneFile) u64 { const pf = &pane.fs; return switch (f) { // A terminal's body reads its screen and history, as text. - .body => if (pane.file == null and pane.isTerminal()) panes.terminal.screenTextLen(pane) else if (kindText(p, pane)) |t| t.len else bodyOf(pane).len, + .body => if (pane.file == null and pane.isTerminal()) pardes.Term.scrollbackLen(pane.terminal) else if (kindText(p, pane)) |t| t.len else bodyOf(pane).len, // What addr selects, generated by each read: no length, as acme's // data and xdata have none. .data, .xdata => 0, @@ -441,7 +441,7 @@ fn readBody(p: *Pardes, req: Req, id: usize, pane: *Pane) Reply { // A kind's body is its text (a PDF's, the page shown's): read-only. if (kindText(p, pane)) |text| return tree.window(p, req, text); if (req.handle != 0 and pane.isTerminal()) return screen.readSnapshot(p, req, pane); - const text = panes.terminal.screenTextAlloc(pane, p.gpa) catch + const text = pardes.Term.scrollback(pane.terminal, p.gpa) catch return Reply.fail(req.tag, E.NOMEM); defer p.gpa.free(text); return tree.window(p, req, text); diff --git a/src/ninep/screen.zig b/src/ninep/screen.zig index 634ef640..1bfd9b63 100644 --- a/src/ninep/screen.zig +++ b/src/ninep/screen.zig @@ -64,7 +64,7 @@ pub fn readSnapshot(p: *Pardes, req: Req, pane: ?*Pane) Reply { const snapshot = &(tree.openOf(p, req) orelse return Reply.fail(req.tag, E.INVAL)).what.snapshot; if (snapshot.* == null) { const terminal = pane orelse return Reply.fail(req.tag, E.INVAL); - snapshot.* = panes.terminal.screenTextAlloc(terminal, p.gpa) catch return Reply.fail(req.tag, E.NOMEM); + snapshot.* = pardes.Term.scrollback(terminal.terminal, p.gpa) catch return Reply.fail(req.tag, E.NOMEM); } return tree.window(p, req, snapshot.*.?); } @@ -126,7 +126,7 @@ test "terminal body handles keep one history snapshot across fragmented reads" { const node = Node.of(serialOf(p), .body); p.update(.{ .output = .{ .pane = 0, .bytes = "old caf\xc3\xa9\r\nold tail" } }); while (p.nextEffect()) |_| {} - const original = try panes.terminal.screenTextAlloc(p.panes[0].?, gpa); + const original = try pardes.Term.scrollback(p.panes[0].?.terminal, gpa); defer gpa.free(original); const opened = call(p, .{ .tag = 1, .op = .open, .node = node }); try testing.expectEqual(Status.ok, opened.reply.status); |
