From 8488e8a34256cf0545406ea9aad9c76bb45b47a3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 17:09:06 -0300 Subject: The board build compiles again: pty status and run read no prompt marks where there are no terminals pty.zig reached into a terminal's stream handler, which is void on esp32p4, so the board build stopped at readStatus and writeRun. Both now know at comptime that such a build has no marks. Co-Authored-By: Claude Opus 5.5 --- src/ninep/pty.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ninep') diff --git a/src/ninep/pty.zig b/src/ninep/pty.zig index a2a40811..3599b612 100644 --- a/src/ninep/pty.zig +++ b/src/ninep/pty.zig @@ -92,7 +92,8 @@ pub fn readStatus(p: *Pardes, req: Req, id: usize, pane: *Pane) Reply { // Busy is what a run written now would be told: a command is running // or a line is typed at the prompt. Before the shell's first prompt a // run waits for it rather than answer busy, so that is not busy. - const marks = if (pane.terminal) |state| &state.stream.handler else null; + // A build with no terminal panes (the board) has no marks to read. + const marks = if (comptime !pardes.panes.Terminal.enabled) null else if (pane.terminal) |state| &state.stream.handler else null; const busy = p.hostTtyTaken(id) or (!pane.fs.unmarked and (waitingRun(p, pane) != null or (if (marks) |m| m.prompts > 0 and (m.phase != .input or !pardes.panes.Terminal.promptInputEmpty(pane)) else false))); const out = p.fs.stage(p.gpa); @@ -162,6 +163,7 @@ pub fn writeRun(p: *Pardes, req: Req, id: usize, pane: *Pane) Reply { if (std.mem.trim(u8, line, " \t").len == 0) return tree.failText(req.tag, E.INVAL, e_bad_line); if (line.len == 0) return tree.failText(req.tag, E.INVAL, e_bad_line); for (line) |c| if (c < ' ' and c != '\t') return tree.failText(req.tag, E.INVAL, e_bad_line); + if (comptime !pardes.panes.Terminal.enabled) return tree.failText(req.tag, E.INVAL, e_bad_line); const pf = &pane.fs; const state = pane.terminal orelse return tree.failText(req.tag, E.INVAL, e_bad_line); const marks = &state.stream.handler; -- cgit v1.3