summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:40:11 -0300
committerGabriel Schneider <[email protected]>2026-11-05 12:41:36 -0300
commit3f1533813b6692a736251e4d467a7f108229ddee (patch)
tree37a32c5ebbf9d3af08923856fd6fa516f3b33a39 /src/builtins.zig
parentcfd2b993feda1b3f7474225bb32db8cac8edc5ae (diff)
downloadpardes-3f1533813b6692a736251e4d467a7f108229ddee.tar.gz
pardes-3f1533813b6692a736251e4d467a7f108229ddee.zip
targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 5dae567a..2f51d81b 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -17,7 +17,7 @@ const limits = @import("memory.zig").limits;
/// What this build's own frontend draws and its host does: the render's.
pub const frontend: config.Runtime.Capabilities = .{
.font_picker = pardes.font_picker,
- .panel_transitions = pardes.hosted,
+ .panel_transitions = true,
.scene_shaders = pardes.platform == .gui or pardes.platform == .macos,
// The tty's font belongs to its emulator.
.tagline_font_size = pardes.platform != .tui,
@@ -727,12 +727,12 @@ pub const Restore = struct {
// The file it reads, whole (`~`, the DumpDir, the directory it runs
// in): what the log's `restore` record and every message name.
var full_buf: [4096]u8 = undefined;
- const path = if (comptime pardes.hosted) @import("fs.zig").restorePath(typed, c.p.settings.dump_dir.get(), &full_buf) else typed;
+ const path = @import("fs.zig").restorePath(typed, c.p.settings.dump_dir.get(), &full_buf);
if (path.len > c.p.restore_buf.len) return c.p.reportFailure(c.id, "Restore: that name is too long");
// A dump that cannot be read is said now, and fails a ctl write: the
// host reads it only after this step, where nobody hears. First,
// so a Restore that could never happen spends no warning.
- if (comptime pardes.hosted) {
+ {
const bytes = @import("fs.zig").readRestore(c.p.gpa, path, c.p.settings.dump_dir.get()) catch |err| {
var buf: [limits.host_path_cap + 64]u8 = undefined;
var words: [128]u8 = undefined;
@@ -799,7 +799,6 @@ pub const Mount = struct {
pub const scope: Scope = .session;
pub const takes_arg = true;
pub const requires_arg = true;
- pub const enabled = pardes.hosted;
pub fn run(c: Ctx) void {
var args = std.mem.tokenizeAny(u8, c.arg orelse "", " \t");
const e_args = "wrong #args in control message \"Mount\": Mount name dial";
@@ -841,7 +840,6 @@ pub const Unmount = struct {
pub const scope: Scope = .session;
pub const takes_arg = true;
pub const requires_arg = true;
- pub const enabled = pardes.hosted;
pub fn run(c: Ctx) void {
var args = std.mem.tokenizeAny(u8, c.arg orelse "", " \t");
const name = args.next() orelse return c.p.reportError(c.id, "Unmount name", error.MissingArgument);
@@ -894,7 +892,6 @@ pub const ThemeFile = struct {
pub const scope: Scope = .session;
pub const takes_arg = true;
pub const requires_arg = true;
- pub const enabled = pardes.hosted;
pub fn run(c: Ctx) void {
var home_buf: [4096]u8 = undefined;
const arg = pardes.filesystem.expandHome(std.mem.trim(u8, c.arg orelse return, " \t\r\n"), &home_buf);
@@ -910,7 +907,6 @@ pub const ThemeFile = struct {
/// Write the bundled themes into the config directory's themes, to edit.
pub const DumpThemes = struct {
pub const scope: Scope = .session;
- pub const enabled = pardes.hosted;
pub fn run(c: Ctx) void {
if (c.p.configDir() == null) {
c.p.reportError(c.id, "dump themes", error.NoConfigDirectory);
@@ -1116,7 +1112,7 @@ pub const Get = struct {
const path = if (typed.len == 0) c.pane.file.?.path else std.fs.path.resolvePosix(c.p.scratch.allocator(), &.{ Pardes.paneDir(c.pane), @import("fs.zig").expandHome(typed, &home_buf) }) catch return;
// A file that is not there, or a directory, is said before unsaved
// edits are asked about: there would be nothing to load over them.
- if (comptime pardes.hosted) if (typed.len > 0) if (@import("fs.zig").localPath(path)) |local| {
+ if (typed.len > 0) if (@import("fs.zig").localPath(path)) |local| {
var said: [320]u8 = undefined;
const kind = exec.kindOf(local);
if (kind == null or kind.? == .directory)
@@ -1177,7 +1173,7 @@ pub const Incl = struct {
return p.reportFailure(c.id, std.fmt.bufPrint(&said, "Incl: invalid directory: {s} is relative", .{shown}) catch "Incl: invalid directory");
var home_buf: [4096]u8 = undefined;
const expanded = @import("fs.zig").expandHome(dir_word, &home_buf);
- if (comptime pardes.hosted) if (@import("fs.zig").localPath(expanded)) |local| if (exec.kindOf(local) != .directory)
+ if (@import("fs.zig").localPath(expanded)) |local| if (exec.kindOf(local) != .directory)
return p.reportFailure(c.id, if (exec.kindOf(local) != null)
std.fmt.bufPrint(&said, "Incl: not a directory: {s}", .{shown}) catch "Incl: not a directory"
else
@@ -1431,14 +1427,14 @@ pub const Term = struct {
const arg = std.mem.trim(u8, c.arg orelse "", " \t");
// A shell that is not there is said, where the host would quietly
// start its fallback in its place.
- if (comptime pardes.hosted) if (arg.len > 0) {
+ if (arg.len > 0) {
var why: [320]u8 = undefined;
// The authority's lookup, taped, as Shell's (exec.zig).
if (pardes.tape.value(.shell, @import("host_io.zig").Shell.refusal, .{ arg[0..@min(arg.len, 200)], &why })) |refused| {
var said: [340]u8 = undefined;
return c.p.reportFailure(c.id, std.fmt.bufPrint(&said, "Term: {s}", .{refused}) catch "Term: no such shell");
}
- };
+ }
const pane = exec.spawnTty(c.p, c.id) orelse return;
if (arg.len > 0) pane.shell = c.p.gpa.dupe(u8, arg) catch null;
}