summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.zig b/src/main.zig
index 1075b596..6c46b22c 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -101,7 +101,7 @@ const help_text =
;
/// `pardes -` inside a session: `text` into the directory's one +Pager
-/// (root ctl `pager <dir>`, refilled when it is there), written into its
+/// (/pager, refilled when it is there), written into its
/// body through one open, as one undo step, and left clean. A text
/// the session would not take is never lost: it goes to stderr, with why,
/// and the exit is 1.
@@ -125,9 +125,10 @@ fn pageInto(io: std.Io, gpa: std.mem.Allocator, dial: []const u8, text: []const
if (c < ' ' or c == 0x7f) break false;
} else true;
var line_buf: [4200]u8 = undefined;
- const ctl_line = std.fmt.bufPrint(&line_buf, "pager {s}\n", .{if (plain) cwd else ""}) catch "pager\n";
- ninep_io.Client.write(gpa, dial, "/ctl", ctl_line) catch |err| Fail.with(io, text, "no +Pager pane", err);
- const answer = ninep_io.Client.read(gpa, dial, "/exec", "/exec") catch |err| Fail.with(io, text, "no +Pager pane", err);
+ const dir_line = std.fmt.bufPrint(&line_buf, "{s}\n", .{if (plain) cwd else ""}) catch "\n";
+ // Its serial read back on the open that asked: another client's exec
+ // meanwhile can never send this text into that client's pane.
+ const answer = ninep_io.Client.ask(gpa, dial, "/pager", dir_line) catch |err| Fail.with(io, text, "no +Pager pane", err);
const serial = std.fmt.parseInt(u32, std.mem.trim(u8, answer, " \n"), 10) catch |err| Fail.with(io, text, "no +Pager pane", err);
// The whole text through one open of the body (truncated once, then
// written at rising offsets): one undo step, and every byte of it.