summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-08 20:44:43 -0300
committerGabriel Schneider <[email protected]>2026-11-08 21:48:19 -0300
commitc35251904681f3a195a6ede71dba235463b0e962 (patch)
treec9bb7e3c2675c326bd3f94f770951e0c99e228be /src/main.zig
parentfb2b69bdbbf3cf33706989635ca3416b97667ea7 (diff)
downloadpardes-c35251904681f3a195a6ede71dba235463b0e962.tar.gz
pardes-c35251904681f3a195a6ede71dba235463b0e962.zip
fix: a session whose runtime directory makes its 9P socket's path pass sun_path said so only to std.log, off by default, so a detached one ran with no socket and no word: the check (9p_io.tooLong) gives the words, 9p: the socket path is N bytes, 108 is the most: set XDG_RUNTIME_DIR shorter, to the log, to pane 0's message and, at a --detach start, to stderr, and the session runs on; a unit test pins the check and the message
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index 7f6d1a05..b6f57873 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -743,6 +743,15 @@ fn nativeMain(std_init: std.process.Init) !void {
// socket holds already (a plain session is named by its pid too).
if (name.len != 0 and !resuming and ninep_io.taken(name)) die(init.io, "a session named {s} is already running", .{name});
if (opts.ninep_name.len == 0) opts.ninep_name = name;
+ // Said where it was started (stderr, as the log says it): no pane
+ // anyone sees would show it. The session runs on, with no 9P.
+ var pid_buf: [16]u8 = undefined;
+ var words_buf: [160]u8 = undefined;
+ const entry = if (opts.ninep_name.len != 0) opts.ninep_name else std.fmt.bufPrint(&pid_buf, "{d}", .{std.c.getpid()}) catch unreachable; // a pid fits 16
+ if (ninep_io.tooLong(entry, &words_buf)) |words| {
+ var line_buf: [200]u8 = undefined;
+ std.Io.File.stderr().writeStreamingAll(init.io, std.fmt.bufPrint(&line_buf, "pardes: {s}\n", .{words}) catch unreachable) catch {}; // 160 fits 200
+ }
// Nobody's size yet: one roomy enough for a script's panes; `size`
// sets another, and an attached terminal or window its own.
opts.cols = 160;