diff options
| -rw-r--r-- | build.zig | 16 | ||||
| -rw-r--r-- | build/core.zig | 3 | ||||
| -rw-r--r-- | core/CHANGELOG.md | 4 | ||||
| -rw-r--r-- | core/Dir.zig | 2 | ||||
| -rw-r--r-- | core/Plumb.zig | 2 | ||||
| -rw-r--r-- | core/Query.zig | 6 | ||||
| -rw-r--r-- | core/Stream.zig | 13 | ||||
| -rw-r--r-- | core/dump.zig | 7 | ||||
| -rw-r--r-- | core/edit_cmd.zig | 4 | ||||
| -rw-r--r-- | core/fs.zig | 15 | ||||
| -rw-r--r-- | core/look.zig | 16 | ||||
| -rw-r--r-- | core/root.zig | 2 | ||||
| -rw-r--r-- | dev/file_watch.zig | 12 | ||||
| -rw-r--r-- | dev/tui/tui.zig | 10 | ||||
| -rw-r--r-- | docs/next-terminal.md | 2 | ||||
| -rw-r--r-- | runtime/main.zig | 6 | ||||
| -rw-r--r-- | test/fs_namespace.zig | 3 | ||||
| -rw-r--r-- | test/terminal.zig | 2 |
18 files changed, 19 insertions, 106 deletions
@@ -175,8 +175,8 @@ pub fn build(b: *std.Build) void { // core.module. const root_set = core.module(b, parts, .{ .root = if (platform == .macos) "runtime/macos.zig" else "runtime/main.zig", .platform = platform, .builtin_addons = compiled_in, .tracy = true, .util = true }); const root_mod = root_set.root; - // hxdiff's headless core and pardes-isolate are the primary shell's - // configuration compiled two more ways, not two more frontends. + // hxdiff's headless core is the primary shell's configuration compiled + // another way, not another frontend. const core_cfg: core.Core = .{ .root = "core/root.zig", .platform = platform, .builtin_addons = compiled_in, .tracy = true }; const core_set = core.module(b, parts, core_cfg); const core_module = core_set.root; @@ -186,7 +186,6 @@ pub fn build(b: *std.Build) void { // and shell-test runs them all with one. const lean_cfg: core.Core = .{ .root = "core/root.zig", .platform = platform, .builtin_addons = compiled_in, .terminal = false }; const core_lean = core.module(b, parts, lean_cfg); - const isolated_mod: ?*std.Build.Module = if (platform == .tui) core.module(b, parts, .{ .root = "runtime/main.zig", .platform = platform, .builtin_addons = compiled_in, .isolated = true }).root else null; // `zig build static`'s: the addons compiled in (Addon.zig). Linked // statically on musl alone, as glibc links only dynamically; the gui's // is dynamic (SDL and the GPU need the display's libraries) with the @@ -270,17 +269,6 @@ pub fn build(b: *std.Build) void { static_step.dependOn(&b.addFail("static is the terminal's on musl (-Dplatform=tui -Dtarget=x86_64-linux-musl) or the gui's (-Dplatform=gui)").step); const run = b.addRunArtifact(exe); b.step("run", "descend to the pardes").dependOn(&run.step); - if (isolated_mod) |iso| { - const iso_exe = b.addExecutable(.{ - .name = "pardes-isolate", - .root_module = iso, - }); - const run_iso = b.addRunArtifact(iso_exe); - // Something to look at on arrival, read out of the binary itself. - run_iso.addPassthruArgs(); - const iso_step = b.step("run-isolated", "descend to a pardes with no host but the terminal"); - iso_step.dependOn(&run_iso.step); - } const addon_libs: []const *std.Build.Step.Compile = if (a.pdf.lib) |l| b.allocator.dupe(*std.Build.Step.Compile, &.{ a.image_addon, l }) catch @panic("OOM") else &.{a.image_addon}; // The scripted language server the tests' sessions and the tty cases ask. diff --git a/build/core.zig b/build/core.zig index 4e4a748b..4e619243 100644 --- a/build/core.zig +++ b/build/core.zig @@ -83,7 +83,6 @@ pub fn options(b: *std.Build, cfg: ShellConfig, c: Core, pdf: bool) *std.Build.S o.addOption(Platform, "platform", c.platform); o.addOption(TreeSitterGrammars, "grammars", cfg.tree_sitter_grammars); o.addOption(bool, "terminal", c.terminal); - o.addOption(bool, "isolated", c.isolated); o.addOption(bool, "builtin_addons", c.builtin_addons); // ...the pdf one only when it is built (-Dpdf=false leaves it out). o.addOption(bool, "builtin_pdf", c.builtin_addons and pdf); @@ -308,8 +307,6 @@ pub const Core = struct { platform: Platform, /// The terminal module; without it (core-test) a shell boot is a scratch pane. terminal: bool = true, - /// pardes-isolate's: no host but the terminal. - isolated: bool = false, /// The addons compiled in and registered at start (Addon.zig): the /// static step's, and every core off Linux, whose loader has no memfd. builtin_addons: bool = false, diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 9b551e9b..477e3461 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -570,6 +570,10 @@ - A scroll in the window never moves the tree-sitter context rows: the body glides under them. +- `zig build run-isolated` and its `pardes-isolate` are gone: the + terminal's pardes with no host but the terminal and no filesystem had + not compiled for some releases, and nothing ran it. + ## 0.24 - Edit runs all of acme's commands: `< | >` through your Shell (one undo diff --git a/core/Dir.zig b/core/Dir.zig index 29c5cdc8..869a7cd5 100644 --- a/core/Dir.zig +++ b/core/Dir.zig @@ -47,7 +47,6 @@ pub fn ofName(name: []const u8) []const u8 { /// dotfiles too; a directory's, a link to one's too, ending in `/`; sorted /// bytewise, the `/` counted; each ending in a newline. pub fn read(tape: *pardes.tape.Tape, gpa: std.mem.Allocator, dir: []const u8) ![]u8 { - if (comptime !filesystem.platform_has_fs) return error.FileNotFound; const local = filesystem.localPath(dir) orelse return error.NotLocal; // Its own copy: the caller's may be a pane's, gone while the turn is out. var own: [4096]u8 = undefined; @@ -294,7 +293,6 @@ test "a wide character counts its cells, not its bytes" { } test "a directory reads as acme lists it: dotfiles kept, . and .. not, directories and links to them marked, sorted bytewise" { - if (comptime !filesystem.platform_has_fs) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); const io = testing.io; diff --git a/core/Plumb.zig b/core/Plumb.zig index aeebfc64..f51ddace 100644 --- a/core/Plumb.zig +++ b/core/Plumb.zig @@ -1314,7 +1314,6 @@ test "plumb: a set rewrites the message for good, attr delete of one absent fail } test "plumb: isfile and isdir find a name as Look does, past its place, in the message's directory then Incl's; $file is where" { - if (!fs.platform_has_fs) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(testing.io, .{ .sub_path = "it.zig", .data = "x\n" }); @@ -1482,7 +1481,6 @@ test "plumb: plan9port's basic parses, its ¡- classes UTF-8's bytes and its } test "plumb: the Plumb word opens the plumbing file, include basic until one is saved; saved, or read at boot, its rules are in force, a bad one said with its line" { - if (!fs.platform_has_fs) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); var dir_buf: [4096]u8 = undefined; diff --git a/core/Query.zig b/core/Query.zig index 704206e6..e06199c5 100644 --- a/core/Query.zig +++ b/core/Query.zig @@ -2294,7 +2294,6 @@ fn settle(p: *Pardes) void { } test "Find: names fuzzy per keystroke, the group born with its +Preview, nothing else moves, Enter promotes the preview in place" { - if (!filesystem.platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.createDirPath(std.testing.io, "src"); @@ -2346,7 +2345,6 @@ test "Find: names fuzzy per keystroke, the group born with its +Preview, nothing } test "Grep: lines of the files under the owner's directory, under their file; All: every pane's, under @pN in serial order, a line once" { - if (!filesystem.platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "b.zig", .data = "const needle = 1;\nconst hay = 2;\nneedle needle\n" }); @@ -2568,7 +2566,6 @@ test "Enter on a frozen query pane's rows after its text was edited: no row to l } test "a query row's place is its text: the match tinted after it, B3 on it opens the place, the rows saved and read again still Look" { - if (!filesystem.platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 }); @@ -2627,7 +2624,6 @@ test "a query row's place is its text: the match tinted after it, B3 on it opens } test "the +Preview: the query's hits in its file are its places, the row's one current and selected, coloured as the file is" { - if (!filesystem.platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); const text = "const needle = 1;\nconst hay = 2;\nfn f() void {\n _ = needle;\n}\npub const needle_too = needle;\n"; @@ -2674,7 +2670,6 @@ test "the +Preview: the query's hits in its file are its places, the row's one c } test "a row's address is the shortest path a Look from the query pane resolves: in its directory, under it, above it, else absolute" { - if (!filesystem.platform_has_fs) return; if (!pardes.lsp.supports.contains(.references)) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); @@ -2716,7 +2711,6 @@ test "a row's address is the shortest path a Look from the query pane resolves: } test "a query row's address reaches every way a look arrives: an empty look written back to event and the whole row written to look, as the mouse on it" { - if (!filesystem.platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 }); diff --git a/core/Stream.zig b/core/Stream.zig index 5960d249..e5825e9d 100644 --- a/core/Stream.zig +++ b/core/Stream.zig @@ -478,7 +478,6 @@ fn parseWork(io: std.Io, job: *TextJob, ctx: ?*anyopaque, sink: Sink) void { } fn now() u64 { - if (comptime !filesystem.platform_has_fs) return 0; const t = std.Io.Clock.awake.now(std.Io.Threaded.global_single_threaded.io()); return @intCast(@max(0, t.nanoseconds)); } @@ -635,10 +634,6 @@ pub fn runHere(p: *Pardes, gen: u32, comptime in_call: bool) void { }; return; } - if (comptime !filesystem.platform_has_fs) { - p.stream.state = .failed; - return; - } const s = &p.stream; if (gen != s.gen or s.state != .searching) return; const job = makeJob(p.gpa, s) catch |err| { @@ -1163,7 +1158,6 @@ const Rogue = struct { }; test "Stream: a stale generation's rows never land in the query pane, however two generations race (walk and rg)" { - if (comptime !filesystem.platform_has_fs) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); var root_buf: [4096]u8 = undefined; @@ -1243,7 +1237,6 @@ test "Stream: a stale generation's rows never land in the query pane, however tw } test "Stream: the listing of files for Find on a worker, a cap of hits stops the walk on the loop" { - if (comptime !filesystem.platform_has_fs) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); var root_buf: [4096]u8 = undefined; @@ -1273,7 +1266,6 @@ test "Stream: the listing of files for Find on a worker, a cap of hits stops the } test "Stream: a big text's declarations are parsed on a worker, never the loop, and the rows of its / regroup under them" { - if (comptime !filesystem.platform_has_fs) return; const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 40 }); defer p.deinit(); var text: std.ArrayList(u8) = .empty; @@ -1312,7 +1304,7 @@ test "Stream: a big text's declarations are parsed on a worker, never the loop, } test "Stream: a scroll's colours are painted ahead on a worker, so PageDown after PageDown parses nothing on the frame" { - if (comptime !filesystem.platform_has_fs or !syntax.enabled) return; + if (comptime !syntax.enabled) return; const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 40 }); defer p.deinit(); var text: std.ArrayList(u8) = .empty; @@ -1355,7 +1347,6 @@ test "Stream: a scroll's colours are painted ahead on a worker, so PageDown afte } test "Stream: a Grep stops at its 2000 lines and waits; More in the query pane's tag goes on" { - if (comptime !filesystem.platform_has_fs) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); var root_buf: [4096]u8 = undefined; @@ -1404,7 +1395,6 @@ test "Stream: a Grep stops at its 2000 lines and waits; More in the query pane's } test "Stream: a Grep's rows recoloured are made again, never written, and a dump of them dropped by an edit loads to its digest" { - if (comptime !filesystem.platform_has_fs) return; if (!syntax.enabled or !syntax.readyApart("c.zig")) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); @@ -1476,7 +1466,6 @@ test "Stream: a Grep's rows recoloured are made again, never written, and a dump } test "Stream: a Grep's rows are coloured as their file's language colours them, the file painted on a worker, the match tint on top" { - if (comptime !filesystem.platform_has_fs) return; if (!syntax.enabled or !syntax.readyApart("c.zig")) return; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); diff --git a/core/dump.zig b/core/dump.zig index eb0ef263..c348dec2 100644 --- a/core/dump.zig +++ b/core/dump.zig @@ -11,7 +11,6 @@ const exec = @import("exec.zig"); const colors = @import("colors.zig"); const config = @import("config.zig"); const platform = pardes.platform; -const isolated = pardes.isolated; const MAX_PANES = pardes.MAX_PANES; const MAX_COLS = pardes.MAX_COLS; const effect_path_cap = pardes.effect_path_cap; @@ -662,13 +661,11 @@ fn revivePane(p: *Pardes, id: usize, pane: *pardes.panes.Pane, was_on_disk: bool if (pane.terminal != null) { // A command pane comes back finished, showing what it said: its // command is not run again. A host that runs shells starts one - // under the history in the old one's directory; an isolated build - // only shows it. + // under the history in the old one's directory. if (pane.command != null) { pane.command_done = true; return; } - if (comptime isolated) return; if (pane.cwdSlice().len > effect_path_cap) return; // Its shell not there, made ready for a new one: what the old // shell was, ran and said is gone with it (the REPL it ran, the @@ -1060,7 +1057,6 @@ test "a pane restored with unsaved text is asked about by Exit, Restore, Del and test "a loaded terminal's history stays above its banner, the cursor where it was" { if (pardes.Term.ops == null) return error.SkipZigTest; // it reads the emulator - if (comptime isolated) return error.SkipZigTest; const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 }); defer p.deinit(); @@ -1082,7 +1078,6 @@ test "a loaded terminal's history stays above its banner, the cursor where it wa test "an upgraded session's dump keeps its views and its running terminal as they were, and settings the startup config would change" { if (pardes.Term.ops == null) return error.SkipZigTest; // a shell, dumped and loaded - if (comptime isolated) return error.SkipZigTest; const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12, .startup_config = "Verbose off\n" }); defer p.deinit(); diff --git a/core/edit_cmd.zig b/core/edit_cmd.zig index 9f1f7862..9a5c6865 100644 --- a/core/edit_cmd.zig +++ b/core/edit_cmd.zig @@ -610,7 +610,6 @@ test "an Edit whose file is edited while its commands run is refused whole" { } test "X over open files, w, e, r, f, B and D on panes and the disk" { - if (comptime !filesystem.platform_has_fs) return error.SkipZigTest; const gpa = testing.allocator; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); @@ -687,7 +686,6 @@ test "X over open files, w, e, r, f, B and D on panes and the disk" { } test "an Edit's w to a file changed on disk is refused once, as Save is, and the others are written" { - if (comptime !filesystem.platform_has_fs) return error.SkipZigTest; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(testing.io, .{ .sub_path = "a.txt", .data = "a\n" }); @@ -723,7 +721,6 @@ test "an Edit's w to a file changed on disk is refused once, as Save is, and the } test "an Edit with no command runs beside one whose commands run, unless it touches what that one changes" { - if (comptime !filesystem.platform_has_fs) return error.SkipZigTest; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(testing.io, .{ .sub_path = "other.txt", .data = "x\n" }); @@ -784,7 +781,6 @@ test "a session that ends while an Edit's commands run lets the Edit go" { } test "e and r say a file that cannot be read as Get says it" { - if (comptime !filesystem.platform_has_fs) return error.SkipZigTest; const p = try th.withFile(testing.allocator, "x\n"); defer p.deinit(); const ctl = tree.Node.of(th.serialOf(p), .ctl); diff --git a/core/fs.zig b/core/fs.zig index 0797beb0..6e5829e1 100644 --- a/core/fs.zig +++ b/core/fs.zig @@ -163,7 +163,6 @@ fn osNode(p: *pardes.Pardes, path: []const u8) !u64 { /// outlives the yield, and nothing is staged into the shared reply buffer /// until the turn is back. pub fn osHandle(p: *pardes.Pardes, req: Req) Reply { - if (comptime !platform_has_fs) return Reply.fail(req.tag, E.NOENT); const path = osPath(p, req.node) orelse return Reply.fail(req.tag, E.NOENT); if (req.op == .release) return .{ .tag = req.tag }; const stat = p.tape.site(.os_stat, null, osStat, .{path}) catch return Reply.fail(req.tag, E.NOENT); @@ -307,7 +306,6 @@ pub fn statPath(io: std.Io, path: []const u8, options: std.Io.Dir.StatFileOption /// does: one already there is no failure. A failure shows at the open /// that follows. pub fn makeDirs(tape: *pardes.tape.Tape, dir: []const u8) void { - if (comptime !platform_has_fs) return; if (dir.len == 0) return; tape.site(.make_dirs, null, makeDirsHost, .{dir}); } @@ -320,7 +318,6 @@ fn makeDirsHost(io: std.Io, dir: []const u8) void { /// nearest ancestor that is there may not be searched or written (EACCES: /// `noperm/a/b`, `/proc/1/root/x`). pub fn deniedAbove(dir: []const u8) bool { - if (comptime !platform_has_fs) return false; var at: ?[]const u8 = dir; while (at) |d| : (at = std.Io.Dir.path.dirname(d)) { var z: [4096]u8 = undefined; @@ -443,7 +440,6 @@ fn userHome(name: []const u8) ?[]const u8 { } pub fn resolveOs(tape: *pardes.tape.Tape, path: []const u8, out: *[4096]u8) ?Resolved { - if (comptime !platform_has_fs) return null; var z: [4096]u8 = undefined; const path_z = std.fmt.bufPrintSentinel(&z, "{s}", .{path}, 0) catch return null; return tape.site(.resolve, null, resolveHost, .{ path_z, out }); @@ -676,8 +672,6 @@ fn findEmbeddedSource(path: []const u8, allow_root_suffix: bool) ?Source { return null; } -pub const platform_has_fs = !pardes.isolated; - fn isDir(path: [*:0]const u8) bool { const fd = libc.open(path, .{ .ACCMODE = .RDONLY, .DIRECTORY = true, .CLOEXEC = true }); if (fd < 0) return false; @@ -719,8 +713,8 @@ pub fn restorePath(tape: *pardes.tape.Tape, typed: []const u8, dir_setting: []co fn readFileLimit(tape: *pardes.tape.Tape, gpa: std.mem.Allocator, path: []const u8, limit: usize) ![]u8 { if (std.mem.indexOfScalar(u8, path, 0) != null) return error.OpenFailed; - if (!platform_has_fs or std.mem.startsWith(u8, path, "/virtual/")) { - const archive_path = if (std.mem.startsWith(u8, path, "/virtual/")) path[9..] else path; + if (std.mem.startsWith(u8, path, "/virtual/")) { + const archive_path = path[9..]; var normalized_buf: [4096]u8 = undefined; const normalized = normalizeVirtualPath(archive_path, &normalized_buf) orelse return error.OpenFailed; const source = findEmbeddedSource(normalized, true) orelse return error.OpenFailed; @@ -1215,7 +1209,6 @@ test "self files share the regular file limit without preallocating it" { } test "bounded reads accept exact OS file lengths and empty files" { - if (!platform_has_fs) return error.SkipZigTest; const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true }); defer p.deinit(); @@ -1327,7 +1320,7 @@ test "bounded reads release terminal snapshots after success and size refusal" { } test "bounded reads probe size-unknown proc files at the exact limit" { - if (!platform_has_fs or @import("builtin").os.tag != .linux) return error.SkipZigTest; + if (@import("builtin").os.tag != .linux) return error.SkipZigTest; const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true }); defer p.deinit(); @@ -1379,7 +1372,6 @@ test "self file reads release partial allocations when memory runs out" { } test "oversized OS files fail before allocating their contents" { - if (!platform_has_fs) return error.SkipZigTest; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); const file = try tmp.dir.createFile(std.testing.io, "oversized", .{}); @@ -1481,7 +1473,6 @@ test "a leading ~ is home, from HOME or else the passwd entry" { } test "Restore prefers default directory then falls back to original path" { - if (!platform_has_fs) return error.SkipZigTest; const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); diff --git a/core/look.zig b/core/look.zig index 1023a532..1d296775 100644 --- a/core/look.zig +++ b/core/look.zig @@ -7,7 +7,6 @@ const exec = @import("exec.zig"); const Plumb = @import("Plumb.zig"); const config = @import("config.zig"); const diff = @import("diff.zig"); -const platform_has_fs = filesystem.platform_has_fs; const layout = @import("layout.zig"); const modal = @import("modal.zig"); const tagline = @import("tagline.zig"); @@ -1758,7 +1757,6 @@ test "parsePathLine: `end` separates a whole-token target from a lenient read" { } test "lookableSpan peels prose punctuation off a path, largest first" { - if (!platform_has_fs) return; var realbuf: [4096]u8 = undefined; try std.testing.expectEqualDeep( @as(?Span, .{ .start = 0, .end = "core/look.zig".len }), @@ -1782,7 +1780,6 @@ test "lookableSpan peels prose punctuation off a path, largest first" { } test "lookableLineSpan takes the row's location and stops before its text" { - if (!platform_has_fs) return; var realbuf: [4096]u8 = undefined; try std.testing.expectEqualDeep( @as(?Span, .{ .start = 0, .end = "core/look.zig:12:5-9".len }), @@ -1813,7 +1810,6 @@ test "lookableLineSpan takes the row's location and stops before its text" { } test "lookableLineSpan prefers the longest run, so a blank inside a path is one span" { - if (!platform_has_fs) return; var realbuf: [4096]u8 = undefined; const io = std.testing.io; var tmp = std.testing.tmpDir(.{}); @@ -2054,7 +2050,6 @@ test "a pointer resting where a look-hover found nothing does not wake the core } test "Look on each kind of diff line opens the new file at the line it names" { - if (!platform_has_fs) return; const numbered = "line 1\nline 2\nline 3\nline 4\nline 5\nline 6\nline 7\nline 8\nline 9\n" ++ "line 10\nline 11\nline 12\nline 13\nline 14\nline 15\n"; const diff_text = @@ -2116,7 +2111,6 @@ test "Look on each kind of diff line opens the new file at the line it names" { } test "Look on plain diff -u output: names as written, timestamps cut, next to the diff" { - if (!platform_has_fs) return; const diff_text = "--- old/x.zig\t2026-09-30 10:00:00.000000000 +0000\n" ++ "+++ new/x.zig\t2026-09-30 11:00:00.000000000 +0000\n" ++ "@@ -1,2 +1,3 @@\n" ++ @@ -2136,7 +2130,6 @@ test "Look on plain diff -u output: names as written, timestamps cut, next to th } test "Look on a diff: headers and a hunk line's prefix are the whole line, hover and click alike" { - if (!platform_has_fs) return; const numbered = "one\ntwo\nthree\nfour\nfive\nsix\n"; const diff_text = \\diff --git a/src/old.zig b/src/new.zig @@ -2223,7 +2216,6 @@ test "Look on a diff: headers and a hunk line's prefix are the whole line, hover } test "a click, a 9P whole-line look and an empty event write-back take one expansion on every kind of diff line, a blank context line too" { - if (!platform_has_fs) return; const diff_text = \\diff --git a/src/new.zig b/src/new.zig \\--- a/src/new.zig @@ -2286,7 +2278,6 @@ test "a click, a 9P whole-line look and an empty event write-back take one expan } test "every entry point to Look takes one expansion: a diff line and a file:12:5: line land in one place by each" { - if (!platform_has_fs) return; const numbered = "l1\nl2\nl3\nl4\nl5\nl6\nl7\nl8\nl9\nl10\nl11\nline 12 here\nl13\n"; const diff_text = \\diff --git a/src/x.zig b/src/x.zig @@ -2378,7 +2369,6 @@ test "every entry point to Look takes one expansion: a diff line and a file:12:5 } test "a tag word looked at by a click and by Enter is one record to an event reader; an exec on a diff line takes its word, never the address" { - if (!platform_has_fs) return; const diff_text = \\diff --git a/src/x.zig b/src/x.zig \\--- a/src/x.zig @@ -2449,7 +2439,6 @@ test "a tag word looked at by a click and by Enter is one record to an event rea } test "Incl's directories find a name found nowhere else, <name> too; bare Incl lists them, Incl - empties them, and a dump keeps them" { - if (!platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.createDirPath(std.testing.io, "inc"); @@ -2489,7 +2478,6 @@ test "Incl's directories find a name found nowhere else, <name> too; bare Incl l test "LookNext in a command pane walks its own file:line places, whoever walked last" { if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane - if (!platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "x.c", .data = "a\nb\nc\n" }); @@ -2546,7 +2534,6 @@ test "Look outside a diff pane expands and looks as ever" { } test "Look on a diff under each git prefix opens the repository's file, and a real a/ directory under --no-prefix" { - if (!platform_has_fs) return; const Case = struct { text: []const u8, file: []const u8 }; const cases = [_]Case{ .{ .text = "diff --git a/src/x.zig b/src/x.zig\n--- a/src/x.zig\n+++ b/src/x.zig\n@@ -1,2 +1,2 @@\n-one\n+uno\n two\n", .file = "/src/x.zig" }, @@ -2573,7 +2560,6 @@ test "Look on a diff under each git prefix opens the repository's file, and a re } test "Look on a diff line is the look of the address it names, selected by hand: a cached patch, the checkout elsewhere" { - if (!platform_has_fs) return; const io = std.testing.io; const patch = "diff --git a/entry/src/entry.rs b/entry/src/entry.rs\n--- a/entry/src/entry.rs\n+++ b/entry/src/entry.rs\n" ++ "@@ -1,2 +1,2 @@\n-fn old() {}\n+fn new() {}\n fn kept() {}\n"; @@ -2635,7 +2621,6 @@ test "Look on a diff line is the look of the address it names, selected by hand: } test "Plumb: a look sends what it looks at, the rules written first: a rule's word or port takes it, a name open in a pane is focused unsent, one nothing takes is Look's own" { - if (!platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "pic.svg", .data = "<svg/>" }); @@ -2687,7 +2672,6 @@ test "Plumb: a look sends what it looks at, the rules written first: a rule's wo test "Plumb: a commit hash looked at in a git work tree is git show's, paged; outside one Diff declines, and the word is searched for" { if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane - if (!platform_has_fs) return; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.createDir(std.testing.io, ".git", .default_dir); diff --git a/core/root.zig b/core/root.zig index a57934a6..d116b87c 100644 --- a/core/root.zig +++ b/core/root.zig @@ -103,8 +103,6 @@ pub const platform = @import("pardes_options").platform; pub const version = @import("build_info").version; pub const commit: ?[]const u8 = @import("build_info").commit; -pub const isolated = @import("pardes_options").isolated; - pub const font_picker = platform == .gui or platform == .macos; /// Whose turn it is with the core (Turn.zig): one per process, like the diff --git a/dev/file_watch.zig b/dev/file_watch.zig index 84f37c81..6340d189 100644 --- a/dev/file_watch.zig +++ b/dev/file_watch.zig @@ -679,7 +679,7 @@ pub fn identify(io: std.Io, path: []const u8) !Identity { } test "a restored file is watched again: one clean takes what its file became since the dump, one unsaved keeps its text" { - if (comptime !supported or !filesystem.platform_has_fs) return; + if (comptime !supported) return; const io = std.testing.io; const gpa = std.testing.allocator; for ([_]bool{ false, true }) |dirty| { @@ -721,7 +721,7 @@ test "a restored file is watched again: one clean takes what its file became sin } test "a Zerox twin's save wakes its other twin's watch, which says nothing: their text is the file's already" { - if (comptime !supported or !filesystem.platform_has_fs) return; + if (comptime !supported) return; const io = std.testing.io; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); @@ -753,7 +753,7 @@ test "a Zerox twin's save wakes its other twin's watch, which says nothing: thei } test "ordinary file watches still reconcile changes between open and watch" { - if (comptime !supported or !filesystem.platform_has_fs) return; + if (comptime !supported) return; const io = std.testing.io; const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); @@ -788,7 +788,7 @@ test "ordinary file watches still reconcile changes between open and watch" { } test "a kind's pane whose file changed between its open and its watch opens again from it" { - if (comptime !supported or !filesystem.platform_has_fs) return; + if (comptime !supported) return; const io = std.testing.io; const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); @@ -817,7 +817,7 @@ test "a kind's pane whose file changed between its open and its watch opens agai } test "explicit OS directory watches refresh prefix-preserving listings" { - if (comptime !supported or !filesystem.platform_has_fs) return; + if (comptime !supported) return; const gpa = std.testing.allocator; const core = try pardes.Pardes.init(gpa, .{ .tty_only = true }); defer core.deinit(); @@ -930,7 +930,7 @@ test "theme watch reloads valid ZON and keeps the last theme across a bad save" } test "a watched file deleted wakes the watch at once, and its pane says so" { - if (comptime !supported or !filesystem.platform_has_fs or builtin.os.tag != .linux) return; + if (comptime !supported or builtin.os.tag != .linux) return; const io = std.testing.io; const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index 5c1945e6..e4e9fd10 100644 --- a/dev/tui/tui.zig +++ b/dev/tui/tui.zig @@ -1230,17 +1230,9 @@ const Shell = struct { } fn host(s: *Shell) host_io.Host { - return .{ .ctx = s, .vtable = if (comptime pardes.isolated) &isolated_vtable else &vtable }; + return .{ .ctx = s, .vtable = &vtable }; } - const isolated_vtable: host_io.Host.VTable = .{ - .wait_input = waitInput, - .now = clockNow, - .present = presentFrame, - .post_present = postPresent, - .poll_frame = ownFrame, - }; - const vtable: host_io.Host.VTable = .{ .wait_input = waitInput, .now = clockNow, diff --git a/docs/next-terminal.md b/docs/next-terminal.md index ad21ef9b..a34fc0f2 100644 --- a/docs/next-terminal.md +++ b/docs/next-terminal.md @@ -161,7 +161,7 @@ The ptys stay host resources: - The records the terminal writes (cells, placements) live in the interface module, or in a leaf module surface.zig's types are moved into. surface.zig today imports `pardes.zig` (surface.zig:3), so its cell types have to be lifted out. - **Registration.** - main.zig hands the core `&term.ops` (`Pardes.Options.terminal`, or one global set at start beside `pardes.turn`). - - Every root that builds a product imports `term`: the exe, the static build, `run-isolated`, the gui. + - Every root that builds a product imports `term`: the exe, the static build, the gui. - `core_module` does not. build.zig's `wireCore` stops giving it ghostty-vt, wuffs and zstbi, and core-test's link loses `-lc++`. - **The no-terminal core.** A core with no terminal ops (only a test can build one) boots to a scratch pane and says once "no terminal in this build". Words that make terminals (`Term`, `Repl`, an exec with no idle shell) refuse in words. `takesCommandLine` is false. - **The test fixtures.** This is decided at Phase 1 from the count of tests that need a real shell, as opposed to the ones that merely boot one: diff --git a/runtime/main.zig b/runtime/main.zig index 448dfa57..9724de03 100644 --- a/runtime/main.zig +++ b/runtime/main.zig @@ -1281,12 +1281,6 @@ fn nativeMain(std_init: std.process.Init) !void { } opts.tty_only = explicit_tty or session_only; opts.mounts = mounts[0..mounts_len]; - // `zig build run-isolated` with nothing named: something to look at on - // arrival, read out of the binary itself. - if (pardes.isolated and positional == null) { - session_only = false; - positional = "src/pardes.zig"; - } if (detach != null and attach != null) badArgs(init.io, "--detach and --attach are opposites: one runs the session, the other joins one", .{}); // --wait waits on the pane a FILE opens: with none there is nothing to diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig index ceda8158..90b610a9 100644 --- a/test/fs_namespace.zig +++ b/test/fs_namespace.zig @@ -118,7 +118,6 @@ test "transactional restore preserves host capabilities and advances pane identi } test "filesystem resolves OS first then virtual with explicit mounts and parent paths" { - if (!filesystem.platform_has_fs) return error.SkipZigTest; const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); @@ -185,7 +184,6 @@ test "filesystem resolves OS first then virtual with explicit mounts and parent } test "explicit OS file opens and restores keep their names and request watches" { - if (!filesystem.platform_has_fs) return error.SkipZigTest; const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); @@ -286,7 +284,6 @@ test "owned cwd failed file opens never publish a pane or retain a reservation" } test "images decode through explicit filesystem mounts, and a dump's pane reads its file again through the same mount" { - if (!filesystem.platform_has_fs) return error.SkipZigTest; const gpa = std.testing.allocator; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); diff --git a/test/terminal.zig b/test/terminal.zig index b7b9cd33..ec050c7a 100644 --- a/test/terminal.zig +++ b/test/terminal.zig @@ -203,7 +203,6 @@ test "a terminal's dump restores the cells it drew, its history and where its vi } test "a restored command pane comes back finished, its command not run again" { - if (comptime pardes.isolated) return error.SkipZigTest; const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 60, .rows = 16 }); defer p.deinit(); @@ -233,7 +232,6 @@ test "a restored command pane comes back finished, its command not run again" { } test "a restored terminal keeps its history above a marker and gets a shell where it was" { - if (comptime pardes.isolated) return error.SkipZigTest; const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 }); defer p.deinit(); |
