summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/exec.zig b/src/exec.zig
index ee9e8ddf..0c559382 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -22,7 +22,6 @@ const python_lang = blk: {
};
const pdf_enabled = panes.Pdf.enabled;
const font_picker = pardes.font_picker;
-const hosted = pardes.hosted;
const fonts = pardes.fonts;
const Pane = panes.Pane;
const MAX_COLS = pardes.MAX_COLS;
@@ -436,7 +435,6 @@ fn refusedPlacement(p: *Pardes, id: usize) bool {
/// Whether a shell would be started in `dir` and `dir` is not there: asked
/// only of a host that starts shells, and only of a local path.
pub fn missingDir(p: *Pardes, dir: []const u8) bool {
- if (comptime !hosted) return false;
if (p.host.vtable.spawn == null) return false;
// A peer's directory (`/n/peer/x`) is no directory on this host, where
// the shell would start: no command or terminal runs there, and none
@@ -448,8 +446,6 @@ pub fn missingDir(p: *Pardes, dir: []const u8) bool {
/// What `path` is on this host, null when it is not there; the turn out
/// while it asks (it may be inside a mount this editor serves).
pub fn kindOf(path: []const u8) ?std.Io.File.Kind {
- // A freestanding build has no host to ask.
- if (comptime !pardes.hosted) return null;
var buf: [4096]u8 = undefined;
const z = std.fmt.bufPrintSentinel(&buf, "{s}", .{path}, 0) catch return null;
return pardes.tape.site(.kind, null, kindHost, .{z});
@@ -721,12 +717,6 @@ pub fn executeFrom(p: *Pardes, id: usize, txt: []const u8, from_body: bool) ?usi
/// A pane reused keeps what it showed: the new command runs below a line
/// naming it, as acme appends to +Errors and never clears it (util.c:213).
fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize {
- // The web page starts no processes: a command pane there
- // would say running for ever, and fill the slots.
- if (comptime !hosted) {
- p.reportFailure(from, "exec: not a builtin, and this build runs no commands");
- return null;
- }
if (line.len > command_max) {
p.reportFailure(from, "exec: a command line is at most 1024 bytes");
return null;
@@ -1059,12 +1049,10 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]
var said: [320]u8 = undefined;
return p.setMessage(p.active, std.fmt.bufPrint(&said, "Shell: the default again, {s} ($SHELL, else /bin/sh)", .{config.defaultShell()}) catch "Shell: the default again");
}
- if (comptime pardes.hosted) {
- var why: [320]u8 = undefined;
- if (pardes.tape.value(.shell, @import("host_io.zig").Shell.refusal, .{ want[0..@min(want.len, 200)], &why })) |refused| {
- var text: [340]u8 = undefined;
- return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Shell: {s}", .{refused}) catch "Shell: no such shell");
- }
+ var why: [320]u8 = undefined;
+ if (pardes.tape.value(.shell, @import("host_io.zig").Shell.refusal, .{ want[0..@min(want.len, 200)], &why })) |refused| {
+ var text: [340]u8 = undefined;
+ return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Shell: {s}", .{refused}) catch "Shell: no such shell");
}
if (!p.settings.apply(setting, want)) p.reportFailure(p.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?);
},