From 429c1e5e65afa4c65fa42bbb117c4b32a46a9470 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 05:14:06 -0300 Subject: A chorded record written back with its two follow-ups runs once, with its argument Writing a chorded exec's three records back as read ran the argument and its location as shell commands. The first record (flag 8) now takes the next record as its argument when it comes in the same write, else the one kept from the click (or, with none kept, waits for it); its two follow-up records, however they are written, are consumed as its, never run. Tested written back together and one per write. Co-Authored-By: Claude Opus 5.5 --- src/ninep/pane.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ninep/pane.zig') diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index 4a50b9a1..899d8528 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -81,11 +81,19 @@ pub const State = struct { /// for the record's write-back at `chord_at`, which runs with it. chord_arg: ?[]u8 = null, chord_at: Range = .{}, + /// A chorded record written back: how many of its two follow-up records + /// (argument, location) are still to be consumed rather than run. + chord_follow: u8 = 0, + /// A chorded record written back alone with no argument kept: the + /// command, run when its argument record comes. + chord_pending: ?[]u8 = null, + chord_pending_tag: bool = false, pub const Range = struct { q0: u32 = 0, q1: u32 = 0 }; pub fn deinit(pf: *State, gpa: std.mem.Allocator) void { if (pf.chord_arg) |a| gpa.free(a); + if (pf.chord_pending) |c| gpa.free(c); pf.events.deinit(gpa); pf.pty_out.deinit(gpa); pf.tag_snap.deinit(gpa); -- cgit v1.3