From e9e074c1e70f7a6c941deca31116882c434fd3b7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 8 Nov 2026 20:50:30 -0300 Subject: fix: a window handover under a runtime directory too long for a window's 9P socket made the window and waited 15 s on a registry entry that could never answer (past ~490 bytes its path was empty): it says so first, no new window: XDG_RUNTIME_DIR is N bytes, too long for its 9P socket; daemon.find's reason for a name past its room is cut, never empty (Zig 0.17's bufPrint writes what fits), and a test pins that Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/daemon.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/daemon.zig') diff --git a/src/daemon.zig b/src/daemon.zig index f02c339e..84c77f90 100644 --- a/src/daemon.zig +++ b/src/daemon.zig @@ -1232,3 +1232,13 @@ test "a message carries its words and its fds, and the peer's end is null" { _ = libc.close(pair[1]); try std.testing.expect(recv(pair[0], &buf) == null); } + +test "an attach by a name longer than any session's is refused in words, never an empty reason" { + var d: Daemon = .{}; + var why: [512]u8 = undefined; + const long: []const u8 = &@as([600]u8, @splat('n')); + try std.testing.expect(d.find(.tty, long, &why) == null); + const said = std.mem.sliceTo(&why, 0); + try std.testing.expect(std.mem.startsWith(u8, said, "no ")); + try std.testing.expect(said.len > "no ".len); +} -- cgit v1.3