summaryrefslogtreecommitdiff
path: root/src/dump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:21:15 -0300
committerGabriel Schneider <[email protected]>2026-11-05 12:41:12 -0300
commitcfd2b993feda1b3f7474225bb32db8cac8edc5ae (patch)
tree3248246c043fd1865e74adb979a9cb555f918cd6 /src/dump.zig
parentc0b2e5d9194ce35b9fbb58d8d6e18de66cb209a8 (diff)
downloadpardes-cfd2b993feda1b3f7474225bb32db8cac8edc5ae.tar.gz
pardes-cfd2b993feda1b3f7474225bb32db8cac8edc5ae.zip
targets: the ESP32-P4 board port goes (src/esp32p4*.zig and src/esp32p4/, -Dplatform=esp32p4 with its pinned riscv32 target, -Desp32p4-cols and -rows, the Peek, Poke, Hexdump and Gpio words and the Board behind them, the board's 9P engine options, the gpio_toggle host slot), and with it every guard and limit only the board needed: terminal_panes and terminal.enabled (ghostty is in every build), memory.limits' board branching (the desktop values stay), MAX_PANES 64 and MAX_COLS 16 fixed, the board's boot buffer and its embedded boot, the pager's and the terminal's emulator-less paths; tests: the board's GPIO, ring and Board ones go, the boot-OOM and transition-grid ones stay under their own names; the perf harness loses the board's fixture, so the Debug baselines of both frontends are recorded again (--only medium --reps 10)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/dump.zig')
-rw-r--r--src/dump.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dump.zig b/src/dump.zig
index 153e4a82..6bdfb7d4 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -13,7 +13,6 @@ const config = @import("config.zig");
const pdf_enabled = pardes.pdf_enabled;
const platform = pardes.platform;
const isolated = pardes.isolated;
-const terminal_panes = pardes.terminal_panes;
const MAX_PANES = pardes.MAX_PANES;
const MAX_COLS = pardes.MAX_COLS;
const effect_path_cap = pardes.effect_path_cap;
@@ -73,7 +72,7 @@ test "two dumps in one second get names of their own" {
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "pardes-x.dump", .data = "" });
try std.testing.expect(std.mem.endsWith(u8, uniqueIn(&buf, dir, "pardes-x").?, "/pardes-x-2.dump"));
}
-/// The host's environment; a freestanding core (web, the board) has none
+/// The host's environment; a freestanding core (the web's) has none
/// and no libc to ask, so only a DumpDir with no `~/` names a directory there.
fn hostEnv(name: [*:0]const u8) ?[*:0]u8 {
if (builtin.os.tag == .freestanding) return null;
@@ -91,7 +90,7 @@ pub fn directory(buf: []u8, dir_setting: []const u8) ?[]const u8 {
var fba_buf: [4096]u8 = undefined;
var fba = std.heap.FixedBufferAllocator.init(&fba_buf);
var cwd_buf: [1024]u8 = undefined;
- // No libc on the web or the board: there a relative one is from `/`.
+ // No libc on the web: there a relative one is from `/`.
const cwd: []const u8 = if (comptime !pardes.hosted) "/" else if (std.fs.path.isAbsolute(raw)) "/" else if (std.c.getcwd(&cwd_buf, cwd_buf.len)) |c| std.mem.span(@as([*:0]const u8, @ptrCast(c))) else "/";
const resolved = std.fs.path.resolvePosix(fba.allocator(), &.{ cwd, raw }) catch return null;
return std.fmt.bufPrint(buf, "{s}", .{resolved}) catch null;
@@ -471,7 +470,7 @@ fn revivePane(p: *Pardes, id: usize, pane: *pardes.panes.Pane, was_on_disk: bool
pane.command_done = true;
return;
}
- if (comptime !(terminal_panes and platform != .web and !isolated)) return;
+ if (comptime platform == .web or isolated) return;
if (pane.cwdSlice().len > effect_path_cap) return;
pardes.panes.terminal.reviveShell(pane);
p.emitSpawn(id, pane.serial, pane.cwdSlice());
@@ -663,7 +662,7 @@ 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 (comptime !pardes.panes.terminal.enabled or isolated) return error.SkipZigTest;
+ if (comptime isolated) return error.SkipZigTest;
const gpa = std.testing.allocator;
const term = pardes.panes.terminal;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 });
@@ -684,7 +683,7 @@ 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 (comptime !pardes.panes.terminal.enabled or isolated) return error.SkipZigTest;
+ if (comptime isolated) return error.SkipZigTest;
const gpa = std.testing.allocator;
const term = pardes.panes.terminal;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12, .startup_config = "Verbose off\n" });