summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 17:09:06 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit8488e8a34256cf0545406ea9aad9c76bb45b47a3 (patch)
treec89b536d7fbcf2e0a7d10320ba5e4f45f12f7cce /src
parent04e4323a27237bc886e92ce20c02c42c6f594d1f (diff)
downloadpardes-8488e8a34256cf0545406ea9aad9c76bb45b47a3.tar.gz
pardes-8488e8a34256cf0545406ea9aad9c76bb45b47a3.zip
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/ninep/pty.zig4
1 files changed, 3 insertions, 1 deletions
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;