From 98ed98178b667e551ff2bcaeb981e70d1f6ccb1f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 06:05:56 -0300 Subject: 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 --- src/ninep/ctl.zig | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ninep') 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); +} -- cgit v1.3