From 9c2fc736b9ccd7b7eea11e7f544ed540d2d2a6c2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:25:48 -0300 Subject: Term: input through the interface: Term.key writes a key's bytes as its program's keyboard protocol and modes ask, Term.mouse and Term.wheel a mouse event's and a wheel turn's, Term.paste a paste as xterm makes one, Term.modes is the plain record of the modes the core decides by (mouse, all motion, the wheel, focus, bracketed paste, the alternate screen) and Term.promptMoves how far a click on the prompt line moves the shell's cursor; the mouse's records (MouseMods, MouseButton, MouseAction) are the interface's; keys.forwardKey (the bytes queued, an error reported) and keys.enterTty (raw mode, the cursor handed to the shell) are the core's, in keys.zig, pardes.keys for the tests; bracketedPaste, reportsMouse, reportsFocus, ownsWheel, tracksAllMotion and onAlternateScreen go into the record; the tests that called them follow; nothing else changes --- src/edit.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/edit.zig') diff --git a/src/edit.zig b/src/edit.zig index 5fbabc83..3881020a 100644 --- a/src/edit.zig +++ b/src/edit.zig @@ -105,11 +105,11 @@ pub fn clipRequest(p: *Pardes, id: usize, mode: Paste) void { } /// Text pasted, yanked or sent into the program at `id`, as xterm pastes -/// (terminal.encodePaste). +/// (Term.paste). pub fn typeToTty(p: *Pardes, id: usize, pane: *const Pane, text: []const u8) void { if (text.len == 0) return; const cp = p.scratch.allocator().dupe(u8, text) catch |err| return p.reportError(id, "paste", err); - for (panes.terminal.encodePaste(pane, cp)) |part| if (part.len > 0) p.emitWrite(id, part); + for (panes.Term.paste(pane.terminal, cp)) |part| if (part.len > 0) p.emitWrite(id, part); } pub fn applyPaste(p: *Pardes, whole: []const u8) Error!void { -- cgit v1.3