summaryrefslogtreecommitdiff
path: root/src/ninep/cols.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:52:39 -0300
committerGabriel Schneider <[email protected]>2026-11-05 00:58:29 -0300
commit1c7fd4c48f61695f396765c2f273b560a2e19963 (patch)
tree4b76acd5b742fb2d7cf90dc3c03d6ac26dbbcf2a /src/ninep/cols.zig
parentf88ed53afea4fb38bf0b78ecbfbd49edab6c252b (diff)
downloadpardes-1c7fd4c48f61695f396765c2f273b560a2e19963.tar.gz
pardes-1c7fd4c48f61695f396765c2f273b560a2e19963.zip
ninep ctl: a control message's refusal is one refuseQuoting with a tail, so refuseTo and the column ctl's two hand-built refusals, each cut at its own length, go; a captured run's failure is one failedWrite, said three times before; get returns getRefused's words, already in ename, where it copied them out and back; a constant was formatted into a throwaway buffer; writeSettingsOf had no caller; the tests' no-op spawn host is testing.zig's starting, not four copies
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/ninep/cols.zig')
-rw-r--r--src/ninep/cols.zig6
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).