diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index a55a22e0..7e426ba4 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5386,7 +5386,9 @@ pub const Pardes = struct { p.needs_frame = true; p.raw_hover_intent = false; look.cancelLookHover(p); + p.fs.serving = true; const reply = ctlfs.handle(p, req); + p.fs.serving = false; if (reply.status == .err and (req.op == .write or req.op == .setattr or (req.op == .open and reply.errno == ctlfs.E.NOSPC) or (req.op == .release and req.remove))) ctlfs.events.noteError(p, req, reply); // The request was a whole step of its own, so it settles the way a // step does: the cursor and scroll reconciled, the scripted panes @@ -5632,6 +5634,8 @@ pub const Pardes = struct { const asked = p.panes[id] orelse return null; switch (asked.prompt) { .del_side => return "k j", + // Any path; `-` takes it back. + .save => return "<path>", .repl_choice => { const ask = p.repl_ask orelse return null; var w = std.Io.Writer.fixed(buf); @@ -5990,6 +5994,15 @@ pub const Pardes = struct { p.fs.refused = true; return; } + // Asked for over 9P (Save from an exec on a terminal): a question + // the log says, `ask <serial> save path`, answered on the pane's + // ctl with `answer <path>` or `answer -`; asked again, the one + // already open stands, not a second on top of it. + if (request == .save and p.fs.serving) { + if (pane.prompt == .save) return; + var rec: [32]u8 = undefined; + ctlfs.events.notePath(p, "ask", std.fmt.bufPrint(&rec, "{d} save path", .{pane.serial}) catch ""); + } const marker = switch (request) { .search => |marker| marker, .save => config.save_marker, |
