summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 06:05:56 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit98ed98178b667e551ff2bcaeb981e70d1f6ccb1f (patch)
treeceaa740ffd8367c81ee8b09827f1464ec366d8c7 /src/ninep/ctl.zig
parent554181b73fd53b898841203066382e4287b83e89 (diff)
downloadpardes-98ed98178b667e551ff2bcaeb981e70d1f6ccb1f.tar.gz
pardes-98ed98178b667e551ff2bcaeb981e70d1f6ccb1f.zip
A word written to a raw terminal's look is listed, as in normal mode
A new Tty is in raw mode, where a right click is its program's, and a look written to it over 9P did nothing for that reason. The look file is no keyboard input: over 9P a plain word is listed in a +Search pane and read back whatever the terminal's key mode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 3f7da44c..d623296b 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1877,3 +1877,16 @@ test "a builtin that fails through exec, tagexec or a column's exec fails the wr
try testing.expect(th.logHas(p, "look: no match for \"zzqqnotthere\""));
try testing.expect(!th.logHas(p, "msg 1 Look: no match"));
}
+
+test "a word written to a raw terminal's look is listed as in normal mode" {
+ const p = try th.withTerm(testing.allocator);
+ defer p.deinit();
+ const serial = serialOf(p);
+ const id = p.paneBySerial(serial).?;
+ p.update(.{ .output = .{ .pane = @intCast(id), .bytes = "one MARK two\r\n" } });
+ p.panes[id].?.body.mode = .tty;
+ try testing.expectEqual(Status.ok, wr(p, Node.of(serial, .look), "MARK\n").reply.status);
+ const said = std.mem.trimEnd(u8, rd(p, Node.of(serial, .look), 0, 64).bytes, "\n");
+ const made = p.panes[p.paneBySerial(try std.fmt.parseInt(u32, said, 10)).?].?;
+ try testing.expect(made.file.?.output.?.from == .search);
+}