diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 16:18:03 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 2a842d241c462c11959102f96a3945aec493cb86 (patch) | |
| tree | 1e284852b1301cd3f19b6c42a61ba6406f59857f /src/pardes.zig | |
| parent | 062523f4684e81715dec844bb1983b7bde7df5fc (diff) | |
| download | pardes-2a842d241c462c11959102f96a3945aec493cb86.tar.gz pardes-2a842d241c462c11959102f96a3945aec493cb86.zip | |
A click written back to event is done as the click, REPL and all; a REPL's ctl line names it
Writing an M record back from a .py body with a REPL bound ran the text as a
shell command (exit 127), where the click itself went to the REPL. acme does
what the click would have done (xfideventwrite, xfid.c:842-844), so a body X
record written back now goes the way a middle click goes: to a bound REPL,
bracketed or line by line, the several-REPLs question included. An F record,
a line written to exec, was never a click and still runs as a command. For a
readable list of bindings, the smallest place: a bound terminal's ctl line
ends with its id after current/notcurrent.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 872ea171..9bf1c5f4 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1471,6 +1471,22 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe try std.testing.expect(!Sent.spawned); try std.testing.expect(file.msg_sent); try std.testing.expectEqualStrings("\u{2192} python-a", file.msg[0..file.msg_len]); + // A body's click written back to event is done as the click: sent. A + // line written to exec came back as F and runs as the command it was. + { + const th = @import("ninep/testing.zig"); + const event = ctlfs.Node.of(file.serial, .event); + const h = th.call(p, .{ .tag = 1, .op = .open, .node = event }).reply.handle; + defer _ = th.call(p, .{ .tag = 2, .op = .release, .node = event, .handle = h }); + // The 9P harness performs the effects: what it wrote is its answer's. + const sent = th.wr(p, event, "MX0 8\n"); + try std.testing.expectEqualStrings("print(1)\r", sent.pty_buf[0..sent.pty_len]); + const ran = th.wr(p, event, "FX0 0 2 2 ls\n"); + try std.testing.expect(ran.pty_len == 0 and ran.spawned); + // The pane's ctl line ends with the id it is bound as. + var line: [ctlfs.ctl.pane_text_cap]u8 = undefined; + try std.testing.expect(std.mem.endsWith(u8, ctlfs.ctl.paneText(p, p.panes[1].?, &line), " python-a ")); + } // Several selections executed at once: each is sent, not the first. { const text = try edit.flatSurface(p, &file.body); |
