From 5354090b6122faf0d18e246a55e8a4ead0955394 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:17:45 -0300 Subject: Term: output and view through the interface: Term.feed takes one read and the rows the core keeps positions on and gives back a Term.Told (where each went, erased or not, cleared, alive, a pin missed), Term.grid is the plain record of the view and the cursor (total, offset, len, the cursor, whether it shows, the view's row or null while it follows), Term.scroll, Term.follow, Term.viewTo, Term.resize (now or for later) and Term.resizeDeferred move it, Term.cellPixels sizes its cells in pixels and Term.replies hands over what it answered its program; the core's half is the core's: Pane.feedOutput and its row tracking (the edit copy's rows, the cursors and selections, their undo and the pointer's rows, gathered as rows and moved as the feed told, ingestWithPositions's core) and Pane.followOutput, Pane.resizeGrid and Pane.panFor in panes.zig with panes.resizeDeferred, the cursor a program shows read from the grid where the body draws it, tape.viewOnly beside tape.authorityOnly; scrollbar, gridOffset, gridCursor, visibleCursor, viewOf, atBottom and their types go; nothing else changes --- src/ninep/pty.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ninep') diff --git a/src/ninep/pty.zig b/src/ninep/pty.zig index 7333fac7..2ef9c13d 100644 --- a/src/ninep/pty.zig +++ b/src/ninep/pty.zig @@ -302,7 +302,7 @@ pub fn noteMarks(p: *Pardes, id: usize, pane: *Pane) void { // A prompt on the alternate screen (its program killed there): the // emulator leaves it first, as a reused command pane does, so the // run's output lands on the primary screen and is read whole. - if (pardes.panes.terminal.onAlternateScreen(pane)) pardes.panes.terminal.feedOutput(p, pane, "\x1b[?1049l"); + if (pardes.panes.terminal.onAlternateScreen(pane)) pane.feedOutput(p, "\x1b[?1049l"); p.emitWrite(id, slot.line); p.emitWrite(id, "\r"); pardes.panes.terminal.noteCommand(pane, slot.line); @@ -1005,10 +1005,10 @@ test "a run's answer says cut when its output's start is gone, and reads a bound // A resize between its start and end reflows the pins with the text. h = sh.send(p, node); sh.put(p, c ++ "one\r\ntwo\r\n"); - pardes.panes.terminal.resizeGrid(pane, 50, 20); + pane.resizeGrid(50, 20); sh.put(p, d ++ prompt); try testing.expectEqualStrings("exit 0\none\ntwo\n", sh.answered(p, node, h, into)); - pardes.panes.terminal.resizeGrid(pane, pane.cols, pane.rows); + pane.resizeGrid(pane.cols, pane.rows); // A full-screen program leaves nothing on the primary screen, and a D // with no status is not a success. -- cgit v1.3