diff options
Diffstat (limited to 'src/ninep/cols.zig')
| -rw-r--r-- | src/ninep/cols.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig index 1445a3c3..d74c044d 100644 --- a/src/ninep/cols.zig +++ b/src/ninep/cols.zig @@ -164,10 +164,10 @@ pub fn writeCtl(p: *Pardes, req: Req, serial: u32) Reply { } else false; // Plan 9's words for it, so a mount's errno is EINVAL as the root's // and a pane's ctl give (9ns reads "control message"). - if (!takes) return tree.failText(req.tag, E.INVAL, std.fmt.bufPrint(&p.fs.ename, "unknown control message \"{s}\": a column's ctl takes Delcol, Joincol, New or Term", .{pardes.ctlfs.ctl.firstWord(line)[0..@min(pardes.ctlfs.ctl.firstWord(line).len, 64)]}) catch "unknown control message"); + if (!takes) return pardes.ctlfs.ctl.refuseQuoting(p, req, "unknown control message", word, ": a column's ctl takes Delcol, Joincol, New or Term"); // Only Term takes a word (its shell); `New extra` is no New. if (!std.mem.eql(u8, word, "Term") and word.len != line.len) - return tree.failText(req.tag, E.INVAL, std.fmt.bufPrint(&p.fs.ename, "wrong #args in control message \"{s}\"", .{pardes.ctlfs.ctl.firstWord(line)[0..@min(pardes.ctlfs.ctl.firstWord(line).len, 64)]}) catch "wrong #args in control message"); + return pardes.ctlfs.ctl.refuseQuoting(p, req, "wrong #args in control message", word, ""); const col = layout.columnBySerial(p, serial) orelse return Reply.fail(req.tag, E.NOENT); p.exec_column = col; defer p.exec_column = null; @@ -197,7 +197,7 @@ pub fn writeExec(p: *Pardes, req: Req, serial: ?u32) Reply { // pane has the keyboard. The tag's own words (New, Term, Find, Grep // in a column's) are its to run. if (paneWord(line, if (serial == null) pardes.config.topbar_str else tagline.column_tag_default)) - return pardes.ctlfs.ctl.refuseTo(p, req, "not a session control message", line, "pane/<n>/ctl"); + return pardes.ctlfs.ctl.refuseQuoting(p, req, "not a session control message", pardes.ctlfs.ctl.firstWord(line), ": write it to pane/<n>/ctl"); const col = if (serial) |s| layout.columnBySerial(p, s) orelse return Reply.fail(req.tag, E.NOENT) else null; // With no pane at all, a word runs at the stand-in, as a click in // the empty window's tag does (runBuiltinFrom). |
