From 0ee8d748c028ad5257f95e15db38646aecd2851b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 09:32:02 -0300 Subject: A root focus file names the pane with the keyboard and moves it; a pane's ctl says whether it is current Scripts had no way to ask which pane has the keyboard or to give it one. rio answers both through a window's wctl: its read ends with current or notcurrent, and a write of current takes the keyboard (rio(4)). A pane's ctl line now ends the same way, and since there is one keyboard for the whole tree, /focus reads the focused pane's serial and takes a serial to move the keyboard there, off any header that had it; a serial no pane has fails with "no such window". fs-bench's stale readdir check is fixed too. Co-Authored-By: Claude Opus 5.5 --- test/fs_bench.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/fs_bench.zig') diff --git a/test/fs_bench.zig b/test/fs_bench.zig index da9da47c..75b2eb11 100644 --- a/test/fs_bench.zig +++ b/test/fs_bench.zig @@ -123,7 +123,8 @@ fn checkReply(s: *Session, req: ctlfs.Req, reply: ctlfs.Reply) !void { if (req.node == s.node(.ctl)) { const tail = try checkNumbers(rest, &.{pane.cols}); if (!std.mem.startsWith(u8, tail, "default ")) return error.IncorrectReply; - if ((try checkNumbers(tail[8..], &.{pardes.config.tab_width})).len != 0) + const current = try checkNumbers(tail[8..], &.{pardes.config.tab_width}); + if (!std.mem.eql(u8, current, "current ") and !std.mem.eql(u8, current, "notcurrent ")) return error.IncorrectReply; } else return error.UnmeasuredOperation; } @@ -143,7 +144,7 @@ fn checkReply(s: *Session, req: ctlfs.Req, reply: ctlfs.Reply) !void { const size: usize = bytes[off + 9]; off += 10; if (dir > 1 or size == 0 or size > bytes.len - off) return error.IncorrectReply; - if (entry < names.len and (node != nodes[entry] or dir != @intFromBool(entry >= 7) or + if (entry < names.len and (node != nodes[entry] or dir != @intFromBool(entry >= 8) or !std.mem.eql(u8, names[entry], bytes[off..][0..size]))) return error.IncorrectReply; off += size; } -- cgit v1.3