summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
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);