summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 20:54:21 -0300
committerGabriel Schneider <[email protected]>2026-11-04 21:12:33 -0300
commit0ff1fc99eb870f8a1e714a71c1a853066737c822 (patch)
tree2c8b4720e2ed190e6f9062cfe8586c3da22aeb42 /build.zig
parent3b082687c7da1c5d8cc52c71fdf4ddd38d860cd8 (diff)
downloadpardes-0ff1fc99eb870f8a1e714a71c1a853066737c822.tar.gz
pardes-0ff1fc99eb870f8a1e714a71c1a853066737c822.zip
rename: the terminal frontend is the tui (-Dplatform=tui, src/tui/tui.zig, --tui with --tty kept as its old spelling, the process tests' backend .tui and --backend=tui, docs/typ/builtins-tui.json, the Settings report's platform), and the builtin Tty is Term (its registry entry, SPC n t, every default tag, the docs, tests and snap scripts), Tty still run as Term through exec.acme_words, Tty+fish too on a tag and a ctl; tty as a pane's raw mode and as the OS's terminal unchanged
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig36
1 files changed, 18 insertions, 18 deletions
diff --git a/build.zig b/build.zig
index 05bc59b7..b790f57d 100644
--- a/build.zig
+++ b/build.zig
@@ -25,7 +25,7 @@ const deps_text = blk: {
break :blk text;
};
-pub const Platform = enum { tty, gui, web, macos, esp32p4 };
+pub const Platform = enum { tui, gui, web, macos, esp32p4 };
const PerfBuild = struct {
compiler: []const u8,
@@ -71,8 +71,8 @@ const gui_shaders = [_][]const u8{
};
pub fn build(b: *std.Build) void {
- const requested_platform = b.option(Platform, "platform", "which shell to build (tty, gui, web, macos, esp32p4); absent builds the tty cli and the SDL gui together");
- const platform = requested_platform orelse .tty;
+ const requested_platform = b.option(Platform, "platform", "which shell to build (tui, gui, web, macos, esp32p4); absent builds the tui cli and the SDL gui together");
+ const platform = requested_platform orelse .tui;
const also_gui = requested_platform == null;
// A bare `zig build` also copies the binaries into ~/.local/bin. Zig
// 0.17 keeps the prefix in the maker process, out of this script's
@@ -97,7 +97,7 @@ pub fn build(b: *std.Build) void {
.os_version_min = .{ .semver = macos_min_version },
} else .{},
.esp32p4 => esp32p4_target,
- .tty, .gui, .web => .{
+ .tui, .gui, .web => .{
.cpu_arch = .x86_64,
.os_tag = .linux,
.abi = .gnu,
@@ -225,13 +225,13 @@ pub fn build(b: *std.Build) void {
if (is_web and !is_web_target) return failBuild(b, web_step, "-Dplatform=web requires -Dtarget=wasm32-freestanding");
if (!is_web and (is_web_target or target.result.os.tag == .emscripten)) return failBuild(b, web_step, "wasm browser targets require -Dplatform=web");
if (platform == .web and dump_path == null) return failBuild(b, web_step, "-Dplatform=web requires -Ddump=<file.dump> (the browser has no ptys; state replays from an embedded dump)");
- if (enable_mupdf and is_web) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tty/Kitty and gui/SDL backends");
+ if (enable_mupdf and is_web) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tui/Kitty and gui/SDL backends");
// The board's target is pinned (`target` above), so what is asked of
// -Dtarget is checked, not what was resolved: another arch is refused,
// not silently built for the board anyway.
const requested_board = requested_target.result.cpu.arch == .riscv32 and requested_target.result.os.tag == .freestanding;
if (is_esp32p4 and !requested_board) return failBuild(b, web_step, "-Dplatform=esp32p4 requires -Dtarget=riscv32-freestanding (ESP32-P4 firmware)");
- if (enable_mupdf and is_esp32p4) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tty/Kitty and gui/SDL backends");
+ if (enable_mupdf and is_esp32p4) return failBuild(b, web_step, "-Dmupdf=true is supported only by the native tui/Kitty and gui/SDL backends");
if (is_esp32p4 and requested_grammars != null and requested_grammars.? != .disabled) return failBuild(b, web_step, "-Dplatform=esp32p4 has no tree-sitter: the grammars' parse tables are megabytes and the flash partition is 1.5 MiB (-Dtree-sitter=disabled)");
// build-time IO: slurps the grammars' highlights.scm queries, and reads
@@ -249,7 +249,7 @@ pub fn build(b: *std.Build) void {
.web => "src/web.zig",
.macos => "src/macos.zig",
.esp32p4 => "src/esp32p4.zig",
- .tty, .gui => "src/main.zig",
+ .tui, .gui => "src/main.zig",
}),
.link_libc = !freestanding_core,
});
@@ -260,7 +260,7 @@ pub fn build(b: *std.Build) void {
.link_libc = true,
});
- const isolated_mod: ?*std.Build.Module = if (platform == .tty) b.createModule(.{
+ const isolated_mod: ?*std.Build.Module = if (platform == .tui) b.createModule(.{
.target = target,
.optimize = optimize,
.root_source_file = b.path("src/main.zig"),
@@ -901,7 +901,7 @@ pub fn build(b: *std.Build) void {
\\
;
// And its event queue: a pop that makes room woke one blocked
- // writer, and only on the pop from full. The tty has two writers
+ // writer, and only on the pop from full. The tui has two writers
// (a pane's pty reader, and the input reader posting the frame
// ack's wake), so when the loop emptied a full queue in one batch
// the writer not woken waited on for good: under `yes` the pane
@@ -1041,10 +1041,10 @@ pub fn build(b: *std.Build) void {
// docs/typ/builtins-<platform>.json: every builtin, from the registry and the Help
// rows (src/builtins_json.zig), rewritten in the source tree so a plain
// `typst compile` reads it too; a unit test fails when it is stale.
- // A terminal build writes builtins-tty.json and a window build
+ // A terminal build writes builtins-tui.json and a window build
// builtins-gui.json; style.typ merges the two into one glossary.
- const builtins_json_step = b.step("builtins-json", "rewrite docs/typ/builtins-<tty|gui>.json from the builtin registry (-Dplatform=tty or gui)");
- if (requested_platform == .tty or requested_platform == .gui) {
+ const builtins_json_step = b.step("builtins-json", "rewrite docs/typ/builtins-<tui|gui>.json from the builtin registry (-Dplatform=tui or gui)");
+ if (requested_platform == .tui or requested_platform == .gui) {
const gen = b.addExecutable(.{ .name = "pardes-gen-builtins-json", .root_module = b.createModule(.{
.target = target,
.optimize = optimize,
@@ -1057,7 +1057,7 @@ pub fn build(b: *std.Build) void {
update.addCopyFileToSource(json, b.fmt("docs/typ/builtins-{s}.json", .{@tagName(platform)}));
builtins_json_step.dependOn(&update.step);
for (doc_renders) |r| if (r) |run| run.step.dependOn(&update.step);
- } else builtins_json_step.dependOn(&b.addFail("builtins-json writes one build's list: pass -Dplatform=tty or -Dplatform=gui").step);
+ } else builtins_json_step.dependOn(&b.addFail("builtins-json writes one build's list: pass -Dplatform=tui or -Dplatform=gui").step);
const gui_shell_mod: ?*std.Build.Module = gui_mod orelse
if (platform == .gui) root_mod else null;
@@ -1409,13 +1409,13 @@ pub fn build(b: *std.Build) void {
}
const run_image_harness = b.addRunArtifact(image_harness);
run_image_harness.addArtifactArg(exe);
- run_image_harness.addArg(if (platform == .gui) "gui" else "tty");
+ run_image_harness.addArg(if (platform == .gui) "gui" else "tui");
run_image_harness.has_side_effects = true;
b.step("image-harness", "exercise native Kitty/SDL image rendering end to end").dependOn(&run_image_harness.step);
// Kitty graphics through a terminal pane, end to end: a client in
// the pane's bash (and kitten icat, chafa when installed), a kitty
- // terminal outside (tty) or the GPU capture (gui). test/kitty.zig
+ // terminal outside (tui) or the GPU capture (gui). test/kitty.zig
// is the same protocol at the core.
const kitty_client = b.addExecutable(.{
.name = "pardes-kitty-client",
@@ -1443,7 +1443,7 @@ pub fn build(b: *std.Build) void {
const run_kitty_harness = b.addRunArtifact(kitty_harness);
run_kitty_harness.addArtifactArg(exe);
run_kitty_harness.addArtifactArg(kitty_client);
- run_kitty_harness.addArg(if (platform == .gui) "gui" else "tty");
+ run_kitty_harness.addArg(if (platform == .gui) "gui" else "tui");
run_kitty_harness.has_side_effects = true;
b.step("kitty-harness", "kitty graphics through a terminal pane end to end (a client inside, a kitty terminal or the GPU capture outside)").dependOn(&run_kitty_harness.step);
@@ -1451,7 +1451,7 @@ pub fn build(b: *std.Build) void {
if (enable_mupdf) {
const run_pdf_harness = b.addRunArtifact(image_harness);
run_pdf_harness.addArtifactArg(exe);
- run_pdf_harness.addArg(if (platform == .gui) "gui" else "tty");
+ run_pdf_harness.addArg(if (platform == .gui) "gui" else "tui");
run_pdf_harness.addArg("pdf");
run_pdf_harness.has_side_effects = true;
pdf_harness_step.dependOn(&run_pdf_harness.step);
@@ -1968,7 +1968,7 @@ pub fn build(b: *std.Build) void {
unit_step.dependOn(&run_deck_test.step);
if (unit_match) |check| check.addArtifactArg(deck_test);
- if (platform == .tty or platform == .gui) {
+ if (platform == .tui or platform == .gui) {
const shell_test = b.addTest(.{ .root_module = root_mod, .filters = test_filters });
if (test_nonce) |nonce| shell_test.root_module.addImport("test_rebuild_nonce", nonce);
test_build.dependOn(&shell_test.step);