summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.zig12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index 6d895307..f6a3a3ec 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -514,7 +514,17 @@ fn nativeMain(init: std.process.Init) !void {
// Does it answer? One that answers takes the file or says why not,
// as acme's B does: from here on never a nested editor, whose
// screen would be drawn inside the pane that asked.
- ninep_io.Client.probe(arena, parent.dial) catch break :forwarding;
+ ninep_io.Client.probe(arena, parent.dial) catch {
+ // `--wait` is someone's EDITOR waiting on that session: a screen
+ // of its own drawn in their terminal is no answer. Said, exit 1.
+ if (wait) {
+ var buf: [4300]u8 = undefined;
+ const text = std.fmt.bufPrint(&buf, "pardes: --wait: the session at {s} does not answer; it is gone\n", .{parent.dial[0..@min(parent.dial.len, 4096)]}) catch "pardes: --wait: the session does not answer\n";
+ std.Io.File.stderr().writeStreamingAll(init.io, text) catch {};
+ std.process.exit(1);
+ }
+ break :forwarding;
+ };
const Refuse = struct {
fn with(io: std.Io, what: []const u8, err: anyerror) noreturn {
var words_buf: [128]u8 = undefined;