summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig
index b6f57873..c36c4eb7 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -85,7 +85,8 @@ const help_text =
\\ --9p=<name> name the default 9P socket. Without this flag,
\\ the name is the detached session name or pid.
\\ The socket is under $XDG_RUNTIME_DIR, falling
- \\ back to ~/.local/state/pardes.
+ \\ back to ~/.local/state/pardes: a directory
+ \\ of the user's alone (mode 700), or none.
\\ --9p-tcp=<dial> also serve 9P at tcp!<numeric-ip>!<port>.
\\ --mount=<name>=<dial> mount a 9P session or Unix/TCP endpoint under /n/<name>.
\\ Repeat for more mounts; os and self are reserved.
@@ -746,11 +747,11 @@ fn nativeMain(std_init: std.process.Init) !void {
// 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;
+ var words_buf: [256]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
+ if (ninep_io.noSocket(entry, &words_buf)) |words| {
+ var line_buf: [300]u8 = undefined;
+ std.Io.File.stderr().writeStreamingAll(init.io, std.fmt.bufPrint(&line_buf, "pardes: {s}\n", .{words}) catch unreachable) catch {}; // 256 fits 300
}
// Nobody's size yet: one roomy enough for a script's panes; `size`
// sets another, and an attached terminal or window its own.