summaryrefslogtreecommitdiff
path: root/core/mouse.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 22:15:16 -0300
committerGabriel Schneider <[email protected]>2026-11-19 22:26:54 -0300
commitba10cc4ff30d08d27ad35576df04a03282b6521b (patch)
treee367489aa56f36d71485ce07b4022b512139a94c /core/mouse.zig
parent98b2bc05cd7b6c78952600029939bbc44c5fc56b (diff)
downloadpardes-ba10cc4ff30d08d27ad35576df04a03282b6521b.tar.gz
pardes-ba10cc4ff30d08d27ad35576df04a03282b6521b.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/mouse.zig')
-rw-r--r--core/mouse.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/mouse.zig b/core/mouse.zig
index 3d7c5af9..5e240930 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -184,7 +184,7 @@ fn programWheel(p: *Pardes, id: usize, m: Mouse, col: u16, row: u16) bool {
.wheel_left => .wheel_left,
else => .wheel_right,
};
- const bytes = panes.Term.wheel(pane.terminal.?, &buf, wheel, gcol, grow, .{ .alt = m.alt, .ctrl = m.ctrl }) orelse return true;
+ const bytes = panes.Term.wheel(pane.terminal.?, &pane.term_mouse, &buf, wheel, gcol, grow, .{ .alt = m.alt, .ctrl = m.ctrl }) orelse return true;
for (0..@intCast(config.wheel_rows)) |_| p.emitWrite(id, bytes);
return true;
}
@@ -298,7 +298,7 @@ fn programMouse(p: *Pardes, m: Mouse) bool {
};
if (m.kind == .press) grab.held |= bit;
if (m.kind == .release) grab.held &= ~bit;
- const bytes = panes.Term.mouse(pane.terminal.?, &buf, action, button, mods, col, row, grab.held != 0);
+ const bytes = panes.Term.mouse(pane.terminal.?, &pane.term_mouse, &buf, action, button, mods, col, row, grab.held != 0);
if (bytes.len > 0) p.emitWrite(grab.id, bytes);
if (grab.held == 0) v.mouse_grab = null;
return true;
@@ -322,7 +322,7 @@ fn programMouse(p: *Pardes, m: Mouse) bool {
pane.focus = .body;
pane.closePrompt();
v.mouse_grab = .{ .id = id, .serial = pane.serial, .held = bit, .unshift = shifted_to_program };
- const bytes = panes.Term.mouse(pane.terminal.?, &buf, .press, button, mods, cell.col, cell.row, true);
+ const bytes = panes.Term.mouse(pane.terminal.?, &pane.term_mouse, &buf, .press, button, mods, cell.col, cell.row, true);
if (bytes.len > 0) p.emitWrite(id, bytes);
return true;
},
@@ -330,7 +330,7 @@ fn programMouse(p: *Pardes, m: Mouse) bool {
// pardes's.
.release, .drag => return false,
.motion => {
- const bytes = panes.Term.mouse(pane.terminal.?, &buf, .motion, null, mods, cell.col, cell.row, false);
+ const bytes = panes.Term.mouse(pane.terminal.?, &pane.term_mouse, &buf, .motion, null, mods, cell.col, cell.row, false);
if (bytes.len > 0) p.emitWrite(id, bytes);
// Under 1003 the move is the program's; below that pardes
// hovers as ever.
@@ -432,7 +432,7 @@ fn chordCutPaste(p: *Pardes, cut: bool) edit.Error!void {
const row = @max(0, pane.sel[sel_slot].r1 - @as(i32, pane.tag_rows));
var mb: [64]u8 = undefined;
for ([_]panes.Term.MouseAction{ .press, .release }) |action| {
- const bytes = panes.Term.mouse(pane.terminal.?, &mb, action, .left, .{}, col, row, action == .press);
+ const bytes = panes.Term.mouse(pane.terminal.?, &pane.term_mouse, &mb, action, .left, .{}, col, row, action == .press);
if (bytes.len > 0) p.emitWrite(s.id, bytes);
}
}