From ba10cc4ff30d08d27ad35576df04a03282b6521b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 22:15:16 -0300 Subject: Term: the two things a speculation writes into a terminal and no rollback puts back move into the pane, which the copy holds and the digest covers: the cell its program last heard the mouse at (Pane.term_mouse, handed to Term.mouse and Term.wheel, which ghostty's encoder reads and writes) and its kitty graphics as glyph art (Pane.term_petscii, which the Petscii builtin flips and the images' draw takes in ImagesAt): the sizing's table (reports/pardes-term-bytes.md, section 1; the brief's step 1c); Parts loses both (a dump of an older build carries them and they are passed over by name: a terminal's Petscii chosen before an Upgrade is off after it), Ops loses petscii and togglePetscii; term-test 17/17, core-test 848/991 (143 skipped), shell-test 1027/1030 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- abi/term.zig | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'abi/term.zig') diff --git a/abi/term.zig b/abi/term.zig index 68434e8e..40f9e4f3 100644 --- a/abi/term.zig +++ b/abi/term.zig @@ -231,6 +231,9 @@ pub const ImagesAt = struct { now_ms: u64, cell_w: u32, cell_h: u32, + /// Its images as glyph art even where pixels could be drawn (the + /// pane's Petscii). + petscii: bool = false, }; /// What a predicted echo reads of a cell: its codepoint, whether the shell @@ -286,8 +289,6 @@ pub const Applied = struct { seq: u32, extra: []const u8 }; pub const Parts = struct { reply: []const u8 = "", reply_dropped: u32 = 0, - mouse_cell: ?Coordinate = null, - petscii: bool = false, /// The view's top row, counted from the top of the history. view: usize = 0, phase: Prompt.Phase = .none, @@ -363,8 +364,8 @@ pub const Ops = struct { // ---- input ---- key: *const fn (s: *State, k: plain.Key, out: *std.Io.Writer) error{WriteFailed}!void, - mouse: *const fn (s: *State, buf: *[64]u8, action: MouseAction, button: ?MouseButton, mods: MouseMods, col: i32, row: i32, any_pressed: bool) []const u8, - wheel: *const fn (s: *State, buf: *[64]u8, turn: MouseButton, col: u16, row: u16, mods: MouseMods) ?[]const u8, + mouse: *const fn (s: *State, last: *?Parts.Coordinate, buf: *[64]u8, action: MouseAction, button: ?MouseButton, mods: MouseMods, col: i32, row: i32, any_pressed: bool) []const u8, + wheel: *const fn (s: *State, last: *?Parts.Coordinate, buf: *[64]u8, turn: MouseButton, col: u16, row: u16, mods: MouseMods) ?[]const u8, paste: *const fn (s: ?*const State, text: []u8) [3][]const u8, modes: *const fn (s: ?*const State) Modes, promptMoves: *const fn (s: *State, row: i32, col: i32) ?Moves, @@ -406,8 +407,6 @@ pub const Ops = struct { /// what it keeps to draw them is its own allocator's), and their /// placeholder cells blanked in `frame` (`frame_cols` wide). images: *const fn (s: *State, gpa: std.mem.Allocator, at: ImagesAt, out: *std.ArrayList(plain.Placement), frame: []plain.Cell, frame_cols: u16) void, - petscii: *const fn (s: ?*const State) ?bool, - togglePetscii: *const fn (s: *State) void, hasImages: *const fn (s: ?*const State) bool, // ---- its replicas ---- -- cgit v1.3