summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main.zig b/src/main.zig
index 6f8a9923..623b6033 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -100,9 +100,9 @@ const help_text =
\\ --attach show the one detached session here (with
\\ none, the one session): in this terminal for
\\ `pardes`, a window for `pardes-gui`. One
- \\ attached already gets another view; one of the
- \\ other kind (a window's session in a terminal,
- \\ or the reverse) is joined as a client, as
+ \\ attached already, or of the other kind (a
+ \\ window's session in a terminal, or the
+ \\ reverse), is joined as a client, as
\\ --attach=<sock>:<name>. Returns when the
\\ session detaches or ends
\\ --attach=<name> ...the session called <name> (its --9p or
@@ -117,8 +117,8 @@ const help_text =
\\ --attach=<sock>:<name> ...through that socket (a path, with a '/'),
\\ one forwarded already, or this machine's
\\ --ps what the pardes daemon keeps: each session (its
- \\ pid, kind, whether attached) and its shells, then
- \\ the shells no session holds
+ \\ pid, kind, whether attached), its clients and its
+ \\ shells, then the shells no session holds
\\ --kill=<name> end session <name> and its shells (TERM, then
\\ KILL 2 s later); unsaved changes are lost
\\ --kill-all end every session and every shell the daemon keeps
@@ -858,6 +858,8 @@ fn manage(io: std.Io, verb: []const u8, name: []const u8) noreturn {
const kind = it.next() orelse "";
const state = it.next() orelse "";
w.print(" session {s} {s} ({s}, {s})\n", .{ std.mem.trim(u8, it.rest(), " "), pid, kind, state }) catch break;
+ } else if (std.mem.eql(u8, what, "client")) {
+ w.print(" client {s} {s}\n", .{ pid, comm }) catch break;
} else if (std.mem.eql(u8, what, "shell")) {
w.print(" shell {s} {s}\n", .{ pid, comm }) catch break;
} else if (std.mem.eql(u8, what, "orphan")) {
@@ -1023,8 +1025,8 @@ fn remoteAttach(init: std.process.Init, opts: pardes.Options, where: []const u8,
/// the daemon) to the detached session of that name, or the only one, and
/// this process its stub until the session leaves it. `pardes-gui
/// --attach`: the session asked to open its window again, and done. A
-/// session of the other kind is joined as a replica client, through this
-/// machine's replica socket.
+/// session attached already, or of the other kind, is joined as a replica
+/// client, through this machine's replica socket.
fn attachTo(init: std.process.Init, opts: pardes.Options, name: []const u8) noreturn {
const io = init.io;
var words: [600]u8 = undefined;
@@ -1057,7 +1059,8 @@ fn attachTo(init: std.process.Init, opts: pardes.Options, name: []const u8) nore
}
}
-/// A session of the other kind (`--attach`'s): a replica client of it here.
+/// A session attached already or of the other kind (`--attach`'s): a
+/// replica client of it here.
fn crossAttach(init: std.process.Init, opts: pardes.Options, name: []const u8) noreturn {
var sock_buf: [ninep_io.sun_path_len:0]u8 = undefined;
const sock = daemon.replicaSocket(&sock_buf) orelse die(init.io, "--attach: no runtime directory for the replica socket", .{});