summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 11:48:32 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitc3c3ef27ede2f69ef4f8c6acb10808f02ee46bb2 (patch)
tree523d03bbb555a4a6d9c991fa4ec43723223cda18 /src/exec.zig
parentcef529dc8cd080198f79d2b26bffbe9c7cf3e8bd (diff)
downloadpardes-c3c3ef27ede2f69ef4f8c6acb10808f02ee46bb2.tar.gz
pardes-c3c3ef27ede2f69ef4f8c6acb10808f02ee46bb2.zip
A builtin or setting this build lacks is refused GUI-only, from an exec too
On a terminal, Fonts written to an exec was no builtin there, so it ran as a shell command and ended exit 127; ctl said unknown control message. Both now say Fonts is GUI-only, invalid here (a builtin another platform's build has, not in this build). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 9ec6a426..cf4e01ab 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -657,6 +657,14 @@ pub fn executeFrom(p: *Pardes, id: usize, txt: []const u8, from_body: bool) ?usi
.sent => |to| return to,
.asked => return null,
};
+ // A builtin or setting this build lacks (Fonts on a terminal) is said,
+ // never run as a shell command.
+ const word = cmd[0 .. std.mem.indexOfAny(u8, cmd, " \t") orelse cmd.len];
+ if (builtins.absentWhy(word) orelse if (config.Runtime.find(word) != null) @as([]const u8, "GUI-only") else null) |why| {
+ var said: [96]u8 = undefined;
+ p.reportFailure(id, std.fmt.bufPrint(&said, "{s} is {s}, invalid here", .{ word, why }) catch "GUI-only, invalid here");
+ return null;
+ }
if (!takesCommandLine(p, id)) return runCommand(p, id, cmd);
panes.Terminal.padOutputBelowEdits(p, id);
panes.Terminal.noteCommand(pane, cmd);