diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 11:40:11 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 12:41:36 -0300 |
| commit | 3f1533813b6692a736251e4d467a7f108229ddee (patch) | |
| tree | 37a32c5ebbf9d3af08923856fd6fa516f3b33a39 /src/ninep/ctl.zig | |
| parent | cfd2b993feda1b3f7474225bb32db8cac8edc5ae (diff) | |
| download | pardes-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/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 3b8dae1e..96c44d14 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -382,7 +382,7 @@ pub fn statusText(p: *Pardes) []const u8 { var w: std.Io.Writer.Allocating = .init(p.scratch.allocator()); var count: usize = 0; for (p.panes) |slot| count += @intFromBool(slot != null); - const pid: u32 = if (comptime pardes.hosted) @intCast(std.c.getpid()) else 0; + const pid: u32 = @intCast(std.c.getpid()); w.writer.print("pid {d}\nversion {s}\npanes {d}\n", .{ pid, pardes.version, count }) catch {}; // Whether the pointer is over this window: what a grip let go past // another window's edge asks of every window, to find the one it was @@ -665,7 +665,7 @@ pub fn writePager(p: *Pardes, req: Req) Reply { var shown: [256]u8 = undefined; return tree.failText(req.tag, E.INVAL, std.fmt.bufPrint(&p.fs.ename, "pager: invalid directory \"{s}\": must be absolute", .{blanked(dir[0..@min(dir.len, shown.len)], &shown)}) catch "pager: invalid directory: must be absolute"); } - if (comptime pardes.hosted) if (dir.len > 0) if (pardes.filesystem.localPath(dir)) |local| { + if (dir.len > 0) if (pardes.filesystem.localPath(dir)) |local| { // A file there is no directory, ENOTDIR; nothing there, ENOENT. if (exec_line.kindOf(local) != .directory) { if (exec_line.kindOf(local) != null) @@ -1596,7 +1596,6 @@ test "exec Save writes the named file through the host" { } test "a refusal's +Unsaved goes in the session's directory when the active pane's directory is not there" { - if (comptime !pardes.hosted) return; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); const serial = serialOf(p); @@ -1697,7 +1696,6 @@ test "DumpConfig's whole report writes back to the root ctl, line by line, with } test "a Restore asks again for the ThemeFile the dump names, as a /ctl write of it does" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; const p = try withFile(gpa, "x\n"); defer p.deinit(); @@ -1726,7 +1724,6 @@ test "a Restore asks again for the ThemeFile the dump names, as a /ctl write of } test "a ThemeFile that fails to load changes nothing: the root ctl still names the one loaded, or none" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; const p = try withFile(gpa, "x\n"); defer p.deinit(); @@ -1752,7 +1749,6 @@ test "a ThemeFile that fails to load changes nothing: the root ctl still names t } test "after a ThemeFile the root ctl and DumpConfig say ThemeFile and its path, which writes back" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; const p = try withFile(gpa, "x\n"); defer p.deinit(); @@ -1827,7 +1823,6 @@ test "a look whose pane is refused a place fails with that alone, not a missing } test "a Restore of a file that is no dump fails the write before any warning, and a failed Dump fails its write" { - if (comptime !pardes.hosted) return error.SkipZigTest; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); const f = pane_files.fileOf(p.panes[0].?).?; @@ -2286,7 +2281,6 @@ test "with no pane at all, the root look opens its file and the root exec runs i } test "a restored pane whose file is gone from disk comes back dirty, and Del asks first" { - if (comptime !pardes.hosted) return error.SkipZigTest; const p = try withFile(testing.allocator, "kept text\n"); defer p.deinit(); // On disk when dumped, gone by the Restore. @@ -2336,7 +2330,6 @@ test "a focus moved over 9P tells the programs that asked for focus reports, as } test "a Restore of a name in the DumpDir asks for, and logs, the whole path it reads" { - if (comptime !pardes.hosted) return error.SkipZigTest; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); try pardes.dump.dumpState(p); @@ -2853,7 +2846,6 @@ test "a Rename the server answered for this file alone, with other open files sa } test "Find says what it skipped under its names, and a script's Find that finds nothing is told so" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); @@ -2896,7 +2888,6 @@ test "Lspinfo's answer is the +Lsp pane it fills, as a Rename preview's is its + test "DumpDir refuses a relative directory and one that may not be written, up front; a Dump there says permission denied" { - if (comptime !pardes.hosted) return; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); const root_ctl = @backingInt(tree.TopFile.ctl); |
