summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 07:27:13 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit22fb8b6147f7fb72407af80c36d5e99e4664fea2 (patch)
tree0f5543812af5421a55d21e3bd95d929a19b48d82 /src/look.zig
parentb3557640d6a0a4c2c41b6e1cae3c8182a32937ca (diff)
downloadpardes-22fb8b6147f7fb72407af80c36d5e99e4664fea2.tar.gz
pardes-22fb8b6147f7fb72407af80c36d5e99e4664fea2.zip
Mount dials its peer at once and fails if none answers; a peer out of reach is said as `dial failed: <reason>`
Mount took any well-formed dial and nothing was found out until the first look through it, which then said `look: look: dial`. Mount now probes the peer (version, attach, its root) with the turn out, and fails its write, mounting nothing, when none answers; the dial errors read as words, `no answer`, `timed out`, `hung up`, and a look through a peer gone since names its path: `look: /n/peer/f: dial failed: no answer`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/look.zig b/src/look.zig
index 2f712fae..4ee5a638 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -1458,7 +1458,7 @@ pub fn lookAt(p: *Pardes, id: usize, operand: []const u8) void {
if (!focusPaneByPath(p, target.path, target.at)) {
const free = p.freeSlot() orelse return p.reportError(id, "look", error.NoPaneSlots);
const nt = panes.File.open(p, free, target.path, target.at.line) catch |err|
- return p.reportError(id, "look", err);
+ return p.reportError(id, if (@import("Messages.zig").dialReason(err) != null) target.path else "look", err);
if (target.at.col > 0) nt.body.cur_col = @intCast(target.at.col - 1);
exec.placeNew(p, id, id, free, .doc);
layout.compute(p);
@@ -1476,7 +1476,7 @@ pub fn lookAt(p: *Pardes, id: usize, operand: []const u8) void {
if (focusPaneByPath(p, target.path, .{})) return;
const free = p.freeSlot() orelse return p.reportError(id, "look", error.NoPaneSlots);
_ = panes.Image.create(p, free, target.path, &.{}) catch |err|
- return p.reportError(id, "look", err);
+ return p.reportError(id, if (@import("Messages.zig").dialReason(err) != null) target.path else "look", err);
exec.placeNew(p, id, id, free, .doc);
},
}